MATLAB Answers

0

apply initial conditions to a subsystem

Asked by ariel bintang on 4 Nov 2019
Latest activity Edited by Fangjun Jiang
on 5 Nov 2019
I want to apply an external initial condition to my resettable system, just like how it is possible with a integrator block. Anyone know how to do that?

  2 Comments

What MATLAB release?

Sign in to comment.

1 Answer

Answer by Fangjun Jiang
on 4 Nov 2019

Use "Initialize Function" in library Simulink\User-Defined Functions.

  4 Comments

Show 1 older comment
Integrator is supported. Not sure why continuous State-Space is not supported. If dropping a continuous State-Space block, the StateWriter block seems to "see" it. I didn't try to see if it actually works.
would this be the correct way to implement it? The state space will reset when the resettable subsystem experiences a reset event (its "either" input becomes true)
No longer need to use "Resettable Subsyhstem"
  1. Construct your regular Subsystem with states
  2. Construct your reset logic to send a "reset" event, which trigs the "Reset Function"
  3. Inside your "Reset Function", construct those reset values and write to the states.
Take a look at the built-in demo models.

Sign in to comment.