Unwanted rounding when using GET XLS CONSTANTS

Use this forum to post Vensim related questions.
Post Reply
ema
Junior Member
Posts: 7
Joined: Wed Mar 07, 2018 8:12 am
Vensim version: DSS

Unwanted rounding when using GET XLS CONSTANTS

Post by ema »

Dear Ventana staff,

I have a query regarding the GET XLS CONSTANTS function. I am building a model that needs to be calibrated to start at a stationary state. We have thus created a separate model to calibrate certain parameters, and export them into an Excel spreadsheet. We then use the GET XLS CONSTANT function in the main file in order to assign the calibrated values to the relevant parameters.

However, Vensim is automatically rounding some of these values, which leads the model not to be on a stationary state from the beginning. In particular, we have a value on Excel equal to 10642.09766, and Vensim is instead assigning to the parameter a value of 10640. I have looked online but I don't seem to find any way of changing this. This issue seems to apply only to 'large' numbers. Other smaller calibrated values (e.g. 1.163..) are imported with their decimal numbers.

I attach all the relevant files, in case they might provide some additional information. Excuse their messiness. Let me know if you need additional files/info.

Many thanks for your support!

Best regards,
Emanuele
Attachments
JEEM_model_7 March.mdl
Main model (where the rounding error takes place)
(61.81 KiB) Downloaded 171 times
Calibration.xlsx
Excel spreadsheet with both some initial values and the calibrated values exported from the calibration file
(12.01 KiB) Downloaded 148 times
JEEM_model_CalibFile - 7 March.mdl
Calibration file
(62.23 KiB) Downloaded 174 times
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Unwanted rounding when using GET XLS CONSTANTS

Post by Administrator »

What parameter is reading the value from Excel and truncating it? My guess is that it is reading in floating point accuracy (8 digits), but you are displaying the table using "pretty" number format (which does not show the full accuracy).

I'd be very concerned if such a small change in a constant would lead to things not starting in a steady state. That would indicate to me one of the following.
1. I've got errors in the model.
2. I need to spend more time on that part of the model and find out why it is so sensitive

I certainly would not be attempting to calibrate until I had investigated the two points above.

Some things to consider.
1. Is the time step you are using appropriate? I tried to take a look at the delays in the model, but cannot identify any (for example, "savings", the equation "YD Nominal-C tot nominal" means nothing to me (and no units means I cannot guess either). The time step should be smaller than 1/4 of the shortest delay in the model.

2. Does your model pass the units test? The answer here is no (none of your parameters have any units), units tests often show up errors in equation formulation.
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
ema
Junior Member
Posts: 7
Joined: Wed Mar 07, 2018 8:12 am
Vensim version: DSS

Re: Unwanted rounding when using GET XLS CONSTANTS

Post by ema »

Dear Admin,

many thanks for your quick reply. Indeed, you were right, there was no rounding issue. Instead, there was a bug in the calibration file, which now runs smoothly. Thanks also for making us aware of the difference between 'pretty' and scientific' tables. We also modified the TIME STEP to 0.25, although nothing changes in our case. We'll get to units soon.

Many thanks for your help!

Best,
Emanuele
Post Reply