Page 1 of 1

Integrating Vensim Excel

Posted: Thu May 20, 2021 12:43 pm
by jdewitte
We are developing a Vensim model to evaluate, among other issues, energy use and emissions for multimodal transportation options (e.g. combinations of water, road and rail transport). The model is running fine but we also would like to run Vensim scenario's for combinations of different classes of transportation units. Could you recommend a way to extract attribute values for specific classes from Excel and load them in our Vensim model.
E.g.: Vessel Class X: Average Speed, Pay Load, Power, Speed, Energy Type, CO2-emision, NOx Emission, etc.
To run a scenario I envisage that Vessel Class X is selected by some kind of menu in Vensim (?) and related data are automatically loaded from the Excel file into our Vensim model (transforming Excel data into Vensim constants)
Looking forward to your reply!
Thanks for your attention,

Joaquim de Witte

Re: Integrating Vensim Excel

Posted: Thu May 20, 2021 12:53 pm
by Administrator
In PLE+ you are fairly limited. You would first need to read all the data for all the classes into Vensim

Code: Select all

Vessel Class X Average Speed = GET XLS.....
Vessel Class X Pay Load = GET XLS.....

Vessel Class Y Average Speed = GET XLS.....
Vessel Class Y Pay Load = GET XLS.....

Vessel Class Z Average Speed = GET XLS.....
Vessel Class Z Pay Load = GET XLS.....
Now you can have a variable called "vessel class". If "vessel class" = 1, chose the values for "Vessel Class X", if 2, "Vessel Class Y", if 3, "Vessel Class Z".

Now you can have

Code: Select all

Average Speed = if then else ( vessel class = 1, Vessel Class X Average Speed , 0 )
                       + if then else ( vessel class = 2, Vessel Class X Average Speed , 0 )
                       + if then else ( vessel class = 3, Vessel Class X Average Speed , 0 )

pay load = if then else ( vessel class = 1, Vessel Class X payload , 0 )
                       + if then else ( vessel class = 2, Vessel Class X payload , 0 )
                       + if then else ( vessel class = 3, Vessel Class X payload , 0 )
This will do what you want. It gets a lot easier with Vensim Pro/DSS where you can use subscripts and do all vessels at the same time.

Re: Integrating Vensim Excel

Posted: Thu May 20, 2021 4:21 pm
by jdewitte
Thanks very much. This will do for the moment. We will certainly consider Pro/DSS as soon as initial funding is expanded in the next stage.