Consistency in output between a 10 year simulation and two 5 year simulation runs of the same model

1 visualización (últimos 30 días)
Dear Matlab community,
I'd like to run an extremely simple simulink model
(a) for 10 years straight
(b) for 5 years (called run A), record data of run A, and then run it the next 5 years using the final state of run A as input to run B; then record state data for run B
I'd like to obtain the same output for (b) as I do in (a), however I have been unsuccessful. (Run A output always matches the output of the first 5 years of (a); but run B data doesn't match years 5-10 of (a)). The block whose state doesn't match is the integrator block. I'm currently using the ode4(Runge-Kutta) solver.
Does anyone know how to get consistent output?
Thank you for your help! RJ
  2 comentarios
Kaustubha Govind
Kaustubha Govind el 27 de Oct. de 2011
What version of MATLAB are you using? Are you using the SimState save/restore functionality in (b)? If yes, do you think you could whittle down your model to reproduce this issue with a simple source and the integrator block? It might be worth reporting this to MathWorks Tech Support to see if it's a bug.

Iniciar sesión para comentar.

Respuestas (1)

Fangjun Jiang
Fangjun Jiang el 27 de Oct. de 2011
Do you have anything (inputs, parameters etc.) that is time dependent? When you run (b), you need to set the start time as 5, instead of 0. See the answer for this question.
  1 comentario
Rhonda Jordan
Rhonda Jordan el 28 de Oct. de 2011
Thanks! This is ultimately what Saving and Restoring the Complete SimState does (as suggested by Govind above). Thank you for your help!
Best,
RJ

Iniciar sesión para comentar.

Categorías

Más información sobre General Applications en Help Center y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by