Page 1 of 1

Import data using Calendar Time and fractional days

Posted: Sun Jul 02, 2017 2:57 pm
by nachtrieb
I'm learning to love the time series import and mapping features of Ventity.
I've been able to get Ventity to import a time series if DateTime is fractions of a day (e.g. 0, 0.0417, 0.0833, ...) or whole days (e.g. 1/1/2017, 1/2,2017,...) after checking "Use Calendar Time" in Run Control.
But I haven't figured out how to import hourly data using Calendar Time (e.g. Hourly solar flux throughout a year). Sure, I can hack this in Excel by making DateTime increment from 0 to 365 in steps of 1/24, but that seems to defeat the point of the Calendar Time feature.
Did I miss something?

Re: Import data using Calendar Time and fractional days

Posted: Mon Jul 03, 2017 6:40 pm
by tomfid
Here's an example that works with calendar time, using the date-time format in Excel.

Unfortunately, there appears to be a bug in the charting, such that hourly plots look wrong, but the underlying data in the results appears to be OK. We'll get that fixed.

Re: Import data using Calendar Time and fractional days

Posted: Tue Jul 18, 2017 11:56 am
by gsimpso4
I am in a similar state now, and cannot find the example you mention, Tom.

I need a variable that holds a date, to trigger a pulse flow.

I define a constant "expansion date", which I then would like to define in Entities 1, and eventually in Excel, as we are discussing.

I have Run Control "Use Calendar Time" checked.

When I enter a date value "01/01/2018" I get the error "input string was not in a correct format"

Re: Import data using Calendar Time and fractional days

Posted: Tue Jul 18, 2017 9:20 pm
by tomfid
Oops - forgot to attach it, and I don't have it here at the SD conference.

The basic idea was to use a DateTime in Excel initialization data to set the date at which an entity would be added. That looks like 7/18/2017 15:30.

However, you can't put a date in a variable; you need to use time as a number.

If the model is using calendar time, the model.time starts at 0 and thereafter is an offset from initial time, in the time unit of the simulation. So, if the model runs in months, and starts 1/1/2017, 1/1/2018 is time=12.