Importing Data from Excel (24 hours in a year)

Use this forum to post Vensim related questions.
Post Reply
bahareh1701
Junior Member
Posts: 3
Joined: Wed Feb 14, 2018 4:20 pm
Vensim version: PRO

Importing Data from Excel (24 hours in a year)

Post 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
Attachments
Excel Data.docx
(31.25 KiB) Downloaded 167 times
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

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

Post 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?
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
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

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

Post 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.
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
bahareh1701
Junior Member
Posts: 3
Joined: Wed Feb 14, 2018 4:20 pm
Vensim version: PRO

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

Post 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
Attachments
Solar Radiation- Sample.xlsx
(11.76 KiB) Downloaded 162 times
Wind Speed Table.xlsx
(22.3 KiB) Downloaded 162 times
Consumption.xlsx
(21.99 KiB) Downloaded 161 times
bahareh1701
Junior Member
Posts: 3
Joined: Wed Feb 14, 2018 4:20 pm
Vensim version: PRO

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

Post by bahareh1701 »

HI again,

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

Regards,
Bahareh
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

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

Post 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.
Post Reply