Page 1 of 1

reference value in MESSAGE

Posted: Sat Mar 20, 2010 11:07 am
by yusuke
I have a trouble using MESSAGE function reference value .

My easy sample is attached one.
Which has:
to show=Time+1
Start=IF THEN ELSE( start signal=Time,MESSAGE('\to show/',1) ,0)
start signal=6

I hope to return MESSAGE value "7".
But it return "6" in my environment.

I think it mean 'to show' value is previous value when 'Start' function active.

Is there a culculation order ?
I hope your support.

Yusuke tarumoto

Posted: Sat Mar 20, 2010 12:16 pm
by Administrator
Try
start signal=7

Posted: Sun Mar 21, 2010 1:48 am
by yusuke
Thank you see my model

To show my trouble.
I attached capture of simulation.

I find to change "integration type" Euler to another
will change the message value correct one.

To use Message function, integration type selection
is important?

Yusuke tarumoto

Posted: Sun Mar 21, 2010 10:17 am
by bob@vensim.com
Hi Yusuke,

You have uncovered an interesting deficiency in the use of the MESSAGE function. During equation ordering the displayed value coming out of the message function is not considered. This means that the variable "to show" is not computed until after "start" is already computed so the MESSAGE function get the old value for this. You can work around this by being sure that the equation with the MESSAGE function is embedded appears last alphabetically (starting with a Z if only alphabetical characters are used or you will need to just look in the variable list to see what is latest if you are using Japanese).

Posted: Tue Mar 23, 2010 12:27 am
by yusuke
Thank you bob.
I can clear the problem.

Yusuke Tarumoto