modelica - How to initialize model with previous simulation solution? -


having run out of ideas again turn you.

i'm sure has have been answered before though life of me can't find clear description of it.

scenario:

you work hard model set initial guesses, etc., , solve 'real' steady state (ss) condition of parameters in model. solution want investigate events effects on system.

to perform deviation ss analysis, expedient able load ss solution .mat file model parameters generated dymola. loading solution removes need first simulate model achieve ss solution before performing deviations ss investigations. can conceive possible step @ takes place during 'initialization' phase of simulation.

given seem important concept, imagine idea have been considered stage of modelica/dymola development. manual extraction of each individual parameter not seem proper given size of these models become large.

question:

  1. is possible solve state of model (.mat file) , load simulation 'initial' values of variables? (this override/replace previous initial guesses in system)
  2. if possible, how achieved? (run script, hidden menu option, add sort of import command in model/simulation?)

i appreciate help. using dymola 2016.

i have found following answers own questions posted above.

edit: matth pointed following helpful reference on subject: http://claytex.com/blog/how-to-restart-a-simulation

these instructions dymola. cannot verify if applicable other modelica based programs. found documentation in dymola user manual volume 1 section 5.3.3 simulation > continue > import initial/continue.

1) yes possible start model generated .mat file. can continue dsfinal.txt file.

2) below steps using gui:

  • backup 'your_model.mat' file (e.g. your_model_orig.txt). once have run simulation new .mat file created , don't want overwrite accident.
  • translate model.
  • in ribbon, go simulation > continue > import initial. select .mat file want continue simulation.
  • a prompt generated requested time input specified range given. allows continue simulation @ point in time within .mat simulation results.
  • go simulation setup , select new simulation parameters. if want solution register start time of 0 rather large number associated initial ss simulation update 'start time' 0. not affect initial time used parameter data model_sim.mat file.
  • now simulate model. new .mat file generated starting off point specified.

alternative method: (an odd thing though method no .mat file seems generated or updated.)

  • backup 'dsfinal.txt' file (e.g. dsfinal_orig.txt). once have run simulation new dsfinal.txt file created , don't want overwrite accident.
  • translate model.
  • in ribbon, go simulation > continue > continue. simulation start using whatever dsfinal.txt file on path once option pressed.
  • the simulation continue final conditions of simulation generated dsfinal.txt file.
  • if desired start @ time 0 dsfinal.txt file can modified (line 9, 10, , 12 me) corresponds simulation start (9), stop (10) , , number of timesteps (12). appears trick.

Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -