Weird Constant Value after Control-Z
System dynamics program with additional features for economics
Brought to you by:
hpcoder,
profstevekeen
I tried out your iota suggestion for my "Marginal Cost and MR" demo (successfully), then thought I'd change from my user-typed constant of 1 to the universal constant of 1. That failed, so I control-Z'd my way back to the original value, and saw these crazy numerical values (nan to some crazy power). They were it seems actually 1, 2 and 3 (for 3 powers of a polynomial) since that's what I saw as a value when I loaded the edit form.
Anonymous
That said, the iota function worked a treat, as does the Minsky model I produced using it to show the Neoclassical model of profit maximization (attached). Minsky killed this task compared to producing the same nonsense in Excel.
The only complaint I have is that I bet some Neoclassical twirp ends up using it in a lecture!
I spoke too soon. The weird constant effect also occurred on a save. I think Ty reported something similar recently.
Screenshots.
MKY file.
When loading a .mky file, Minsky::reset() is called. However, Minsky::reset() is meant to be idempotent (calling it a second time leaves the state unchanged), but this is not happening here, as pressing reset immediately after loading the file sets those constants to their correct values. Something is rotten in the state of Denmark.
Those bloody Danish, always up to no good...
It appears that reset needs to be called twice in order for the tensor valued variables to be correctly sized and allocated in the variable space.
Will have to do for now - this is an outcome of grafting on tensor valued expressions to a framework that expects scalars. Maybe in a future refactor, we can do it better.