how to write equation

Use this forum to post Vensim related questions.
Post Reply
rishabh.mech10
Junior Member
Posts: 8
Joined: Wed Apr 05, 2017 5:12 am
Vensim version: PLE

how to write equation

Post 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
Attachments
Equation.JPG
Equation.JPG (19.1 KiB) Viewed 1966 times
transportation model.mdl
(2.27 KiB) Downloaded 179 times
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: how to write equation

Post 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 )
            )
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
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: how to write equation

Post by tomfid »

You might also take a look at the QUANTUM function. https://www.vensim.com/documentation/in ... uantum.htm
Post Reply