Step change in model parameters - simulate load step response with internal states as starting point

I'd like to know if it is possible in Matlab to simulate a linear system with an inital point for it's state variables given.
What I'd like to do is the following: I have a linear system model for which I can determine it's reference step response. I'd like to determine the steady-state system states after a reference step (i.e. until the system has setteled down). These values for the system states I'd like to use as inputs for a second simulation, for which I changed the values of certain model parameters, i.e. I'd like to simulate the system's response from a certain starting points to a step change in parameters.
How would I do that?
Background: I have a dynamic model in Matlab (describing the dynamics of a power electronic converter) for which I'd like to simulate reference and load step responses. So far I'm using the step() function for this which produces the desired results. However, for the load step I'm currently using a current source as a load model, i.e. I can simulate my load step as a regular input to my linear system.
However, my load step is actually an ohmic resistor being connected to my system, i.e., instead of an input I'd like to simulate what happens if connect resistor to my system at a certain time instance (after the system has settled to steady state). This is not a linear input to my system and could be desribed by a change in a step change in a parameter (the load resistance). How could I do that in Matlab?

 Accepted Answer

Hi J B,
Example system
sys1 = rss(2);
Use step to generate the initial step response and collect the state variables
[y1,t1,x1] = step(sys1); % allowing Matlab to determine the steady state time, or specify a time vector
Then use initial to generate the response with the updated model parameters, assuming the states of sys2 have the same physical meaning as the states of sys1
sys2 = sys1;
sys2.a(1,1) = 0.9*sys2.a(1,1);
[y2,t2] = initial(sys2,x1(end,:));
y = [y1;y2];
t = [t1;t1(end)+t2];
plot(t,y)
If the second part of the response also has an input, then use lsim. I think lsim() can be used with a time vector that has an initial point at t1(end), which makes the concatentation a bit simpler. If not, just define t2 and u2 as if they start at time = 0 and concatenate as above.

1 Comment

Thanks a lot for the quick response. Actually lsim is more convenient for in my case.

Sign in to comment.

More Answers (0)

Products

Release

R2021a

Asked:

J B
on 21 Aug 2022

Commented:

J B
on 21 Aug 2022

Community Treasure Hunt

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

Start Hunting!