Setting tolerance in Runge-Kutta integration

Use this forum to post Vensim related questions.
Post Reply
Robyn Letts
Junior Member
Posts: 6
Joined: Tue Jun 05, 2018 9:32 am
Vensim version: PLE+

Setting tolerance in Runge-Kutta integration

Post by Robyn Letts »

Hi

I am struggling to implement a change to the absolute and relative tolerances in Runge-Kutta integration. I have read the help files and they simply say:

You can set ABSOLUTE TOLERANCE and RELATIVE TOLERANCE by writing equations for them inside of your model as in
ABSOLUTE TOLERANCE=.001 ~Dmnl~Max acceptable error for RK4|
RELATIVE TOLERANCE=.001 ~Dmnl~Max acceptable relative error for RK4|
These should be constant equations since only the initial value will be used. If you do not write equations for them, the default value of .001 will be used for both.

Does this literally mean creating auxiliary variables called ABSOLUTE TOLERANCE and RELATIVE TOLERANCE and specifying their constant values as smaller than 0.001? Does Vensim know to check such variables first or is there another setting I'm not aware of?

Thanks for any help.
Robyn
Robyn Letts
Junior Member
Posts: 6
Joined: Tue Jun 05, 2018 9:32 am
Vensim version: PLE+

Re: Setting tolerance in Runge-Kutta integration

Post by Robyn Letts »

No worries, sorted. It does work just by creating auxiliary variables but the effect wasn't noticeable until the tolerance was set much lower than 0.001 when it started causing errors.
Post Reply