Page 1 of 1

how to write equation

Posted: Mon May 22, 2017 7:22 am
by rishabh.mech10
Dear sir/Madam,
I am doing SD modeling for risk management in Food supply chain. For this I have included transportation in the modeling. I have attached the transportation modeling part. In this model, I want to write the equations for Number of truck, which can be find out by delivery rate and capacity of trucks. For different scenario equations are different. I have attached the equation in image form.
I request you, please suggest me how can I write such equation in vensim, which function should I use?
Kindly suggest me proper guidance.
Please find the transportation model and equation in the attached document.
Thank you

Regards
Rishabh Rathore
Research Scholar
IIT kharagpur

Re: how to write equation

Posted: Mon May 22, 2017 7:34 am
by Administrator
I'd suggest doing a simple tutorial in Vensim before you do anything else.
http://www.public.asu.edu/~kirkwood/sysdyn/SDRes.htm
On this page you will find a really good Vensim PLE tutorial.

I'm not sure I understand the image you've pasted, but all three equations are essentially the same. And you write it in Vensim exactly as it's written in your image,

But I think what you are being asked for is something like the following (please note, I would not normally nest IF THEN ELSE statements, in this case, it's so simple that I think it's ok).

Code: Select all

desired number of trucks = delivery rate / capacity of truck

number of trucks required = if then else ( 
                                desired number of trucks <= 1 , if then else ( desired number of trucks = 0 , 0 , 1 )
                               , integer ( 1 + desired number of trucks )
            )

Re: how to write equation

Posted: Tue May 23, 2017 2:13 pm
by tomfid
You might also take a look at the QUANTUM function. https://www.vensim.com/documentation/in ... uantum.htm