Page 1 of 1

Importing Data from Excel (24 hours in a year)

Posted: Wed Feb 14, 2018 4:55 pm
by bahareh1701
Hi there,

I am trying to import Excel file into vensim- My data is hourly electricity consumption in a year. when I import the values it sorts the data out in hours - Meaning all the 00:00s together followed by 01:00s, 02:00s and so on till 23:00- But it messes my calculation as I try to simulate the changes through the day (hourly)

Please see the attached file - Vensim sort the data out as all the 0s first then 1s and so on can I make changes to that?

How can I have my Hourly Data (For a year) following day after day in a Vensim ? showing the (00:00 to 23:00)1st Jan 2011followed by (00:00 to 23:00) 2nd Jan 2011 and so on for a year.

Best regards,
Bahar

Re: Importing Data from Excel (24 hours in a year)

Posted: Wed Feb 14, 2018 4:59 pm
by Administrator
My guess is it's the conversion between Excel date/time and integer not working correctly.

Can you upload the spreadsheet? It's impossible to help when we've only got screenshots. And are you importing using GET_XLS_LOOKUPS or actually importing the sheet?

Re: Importing Data from Excel (24 hours in a year)

Posted: Wed Feb 14, 2018 5:01 pm
by Administrator
You might also want to look at the decimal values of your time entries, they are almost certainly all less than zero. You'll need to convert these into 1, 2 etc to use them properly.

Re: Importing Data from Excel (24 hours in a year)

Posted: Thu Feb 15, 2018 12:51 pm
by bahareh1701
Hi,

Thanks for the respond. Please find the files attached. Well I am still not clear what should I do. Sorry I am new to vensim and this is my 1st model.

Thanks,
Bahar

Re: Importing Data from Excel (24 hours in a year)

Posted: Thu Feb 15, 2018 12:53 pm
by bahareh1701
HI again,

I am actually Import the data from lookup -in the equation.

Regards,
Bahareh

Re: Importing Data from Excel (24 hours in a year)

Posted: Thu Feb 15, 2018 3:26 pm
by tomfid
You can't directly import a 2-dimensional table like your solar radiation table, except as an array of constants.

Some options:

1. Import the table as an array with GET XLS CONSTANTS, and then use rows of it with VECTOR LOOKUP

2. Using copy-paste, create a separate lookup table each for Jan, Feb, Mar ... You can either make each one a separate named variable, or use an array dimension, as in:
MonthOfYear : Jan, Feb, ...
Insolation[Jan] (0,0),(0,0), ...
Insolation[Feb] (0,0),(0,0), ...

3. Reorganize the table so that there's a single time index from start to finish.

Normally, I would choose option 3 for time series data. However, I think 1 or 2 is the more natural choice here.