The attached file produces an error message upon reset after adding the derivative operator. I tried the same simulation using Scilab and it ran as expected.
Hi Peter, could you explain exactly what you're trying to do? In the example you gave here, Inv is the derivative of a product, so given by the product rule
Inv = Profits * dPF/dt + PF * d Profits/dt
but Profits is the result of an integral, so
d Profits/dt = Cp + Inv.
What you have is a circular definition - so no wonder you get a maximum recursion error.
The question is are you defining the same thing in scilab, and if so why is scilab giving an answer?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
HI Russell,
I'm trying to implement Kalecki's definitions of Profit and
Investment. You're right it is circular or recursive, which is to say
there are positive feedback paths. This is fundamental to macro-economic
models as S.K demonstrates. I'm a retired E.E., not an economist.
Reading economic papers confuses me, I don't always know when they are
talking about rates or flows vs stocks. In short, I do need to revise
my simulation.
The equivalent Scilab model gives a solution although I had to use the
implicit solver for the derivative block to avoid an "algebraic loop".
In Minsky I checked the "implicit solver" option but it still gave the "
max recursion" error. The scilab solver may add delay.
Scilab has a flat delay block which I can insert in the feedback path to
add delay between a profit change and a subsequent Investment change.
With the delay block you can even stabilize an "algebraic loop".
In summary I can get a solution with Scilab but I'm not confident I have
the right model. I'm going to rework Minsky then see if I can get the
same solution with Scilab.
Peter F
On 11/1/2015 1:27 AM, High Performance Coder wrote:
Hi Peter, could you explain exactly what you're trying to do? In the
example you gave here, Inv is the derivative of a product, so given by
the product rule
Inv = Profits * dPF/dt + PF * d Profits/dt
but Profits is the result of an integral, so
d Profits/dt = Cp + Inv.
What you have is a circular definition - so no wonder you get a
maximum recursion error.
The question is are you defining the same thing in scilab, and if so
why is scilab giving an answer?
Status: open Milestone: Cantillon Created: Sun Nov 01, 2015 02:03 AM UTC by Peter FitzSimmons Last Updated: Sun Nov 01, 2015 02:03 AM UTC Owner: nobody Attachments:
The attached file produces an error message upon reset after adding
the derivative operator. I tried the same simulation using Scilab and
it ran as expected.
As for implicit solver, that requires a Jacobian to be defined, which has even more restrictions on the types of system solvable. Perhaps SciLab has a completely different algorithm, but if so, that would have to be in the nature of future request. ATM, I am limited to the algorithms available in GNU SL.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Peter, could you explain exactly what you're trying to do? In the example you gave here, Inv is the derivative of a product, so given by the product rule
Inv = Profits * dPF/dt + PF * d Profits/dt
but Profits is the result of an integral, so
d Profits/dt = Cp + Inv.
What you have is a circular definition - so no wonder you get a maximum recursion error.
The question is are you defining the same thing in scilab, and if so why is scilab giving an answer?
HI Russell,
I'm trying to implement Kalecki's definitions of Profit and
Investment. You're right it is circular or recursive, which is to say
there are positive feedback paths. This is fundamental to macro-economic
models as S.K demonstrates. I'm a retired E.E., not an economist.
Reading economic papers confuses me, I don't always know when they are
talking about rates or flows vs stocks. In short, I do need to revise
my simulation.
The equivalent Scilab model gives a solution although I had to use the
implicit solver for the derivative block to avoid an "algebraic loop".
In Minsky I checked the "implicit solver" option but it still gave the "
max recursion" error. The scilab solver may add delay.
Scilab has a flat delay block which I can insert in the feedback path to
add delay between a profit change and a subsequent Investment change.
With the delay block you can even stabilize an "algebraic loop".
In summary I can get a solution with Scilab but I'm not confident I have
the right model. I'm going to rework Minsky then see if I can get the
same solution with Scilab.
Peter F
On 11/1/2015 1:27 AM, High Performance Coder wrote:
Related
Bugs:
#521On https://en.wikipedia.org/wiki/Micha%C5%82_Kalecki#The_profit_equation, profits are given as P=Cp+I, not the derivative of the LHS. Could this be your resolution?
As for implicit solver, that requires a Jacobian to be defined, which has even more restrictions on the types of system solvable. Perhaps SciLab has a completely different algorithm, but if so, that would have to be in the nature of future request. ATM, I am limited to the algorithms available in GNU SL.