Creating a time series from a Do loop script

Answered

Comments

4 comments

  • Avatar
    Jason

    Hi Mruizs,

    Thanks for posting in the GoldSim Community Forum! Let me see if I understand your question. You have an array of values that you want transposed into a time series? One way to do this is simply by using the elapsed day as the index. Here is a very simple example:

    I have an array that is defined in a Data Vector:

    In the case shown above, I have 100 rows in this Data vector. Next, I will write an expression that puts each row's value into successive time values to create a time history for each value as each day passes in the simulation:

    As each day passes, we grab the value from the next row down.

    Would something like this work for you?

    0
    Comment actions Permalink
  • Avatar
    María Claudia

    Hi Jason!

    Thanks for your prompt answer.

    I just realized that in my script It was not necessary to write lines in order to give the order to create a time series as a result.

    I just have to select the option "Time History" in Save Results, and work with "DateTime" to call the item from another time series.

    I hope you understand my answer.

     

     

    1
    Comment actions Permalink
  • Avatar
    María Claudia

    However, what you showed me is very interesting!

    Surely I will use it in my model.

    0
    Comment actions Permalink
  • Avatar
    Jason

    I'm glad you found it useful and also found your solution. Because GoldSim is a dynamic simulator, it is very easy to work with time and datetime in your model expressions. Please let me know if you need anything else.

    -Jason

    0
    Comment actions Permalink

Please sign in to leave a comment.