Hourly demand data

Comments

4 comments

  • Avatar
    Jason

    Pooja,

    In your case, I would prefer that you make use of GoldSim's time capability if possible to return a vector instead of a matrix since GoldSim is walking through time and takes care of the time dimension. Please see my example below to see what I mean. Let's say I have a time series for 3 demand nodes (I am only using 3 demand nodes for simplicity of this example). It would look like this:

     

    Next, I have an hourly demand matrix that looks like the below example. Note that the rows are hours (0-23) and the columns are demand nodes.

    To calculate the hourly demand for a single node (node 1 in the case shown below), then I write this equation: 

    GoldSim has a built-in run property called "Hour" that you can refer to. This will look up the row of the hourly demand factor matrix. However, you can also do this for all the demand nodes at once, by writing a vector expression, like this:

     

    Notice how I refer to all the columns of the demand factor matrix using the [Hour, *] syntax. The "*" will refer to all at once. The result is the hourly demands over time. Below is a time history result showing this for just 1 of the 3 demand nodes:

     

    Does this answer your question?

    0
    Comment actions Permalink
  • Avatar
    Jason

    Also, in case you are interested, you can see how I use a normalized demand factor (daily not hourly) in this example: Municipal Water Demand – GoldSim Help Center

    0
    Comment actions Permalink
  • Avatar
    POOJA SINGH

    Amazing. Thank you, Jason. The way I did try was this - Vector(Daily_Demand[Row]* Hourly_Demand_factor[Hour, Row]). How is this different to what you suggested?

    0
    Comment actions Permalink
  • Avatar
    Jason

    Pooja,

    That is a good way to do it too and possibly better. 👍 When you use the vector() function, you can do other things on the array like apply an IF statement to avoid things like divide by zero, for example. The vector and matrix constructors are different because it gives you the ability to iterate over items of the array (using 'row' and 'col' names).

    In our case, since we are only multiplying two variables, I think it is fine to do it either way. 

    -Jason

    0
    Comment actions Permalink

Please sign in to leave a comment.