Hello,
I am relatively new to System Dynamics and I am currently working on a project for my school in the Netherlands about a nice subject, cocaine use in the Netherlands
However after inputting all the equations and fixing problems with simultaneous equations I get a new one- a fix floating point error, I really don't understand why this is happening and how to fix it, especially that I believe that my model is quite correct...
Could you please help?
Fix floating points error
Fix floating points error
- Attachments
-
- Cocaine-with-explanations.mdl
- Dutch cocaine dynamics
- (12.42 KiB) Downloaded 320 times
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: Fix floating points error
Division by zero is the cause. "Cocaine stock" is zero, causing the floating point problem in "Cocaine Price".
You probably want to use the ZIDZ function. I'd also try and remove "demand for cocaine/cocaine stock*(INITIAL PRICE*(1+CONTAINERS SCAN RATE+SUCCESSFUL DRUG SEARCHES RATE))" into a separate equation, nesting equations makes debugging difficult.
You probably want to use the ZIDZ function. I'd also try and remove "demand for cocaine/cocaine stock*(INITIAL PRICE*(1+CONTAINERS SCAN RATE+SUCCESSFUL DRUG SEARCHES RATE))" into a separate equation, nesting equations makes debugging difficult.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: Fix floating points error
Thank you for the suggestion, the model does run with that formula, but does not exactly show what I want him to show
But one thing puzzles me... Why at time 0 (2009) does cocaine stock show as 0 - it has an initial value of 13500 so it shouldn't be the case...
But one thing puzzles me... Why at time 0 (2009) does cocaine stock show as 0 - it has an initial value of 13500 so it shouldn't be the case...