In this video you will see how to use Model Reducer app to create a low-order approximation of a complex model.
The complex model here is this nonlinear Simulink model of a boost converter.
We will approximate its dynamics around just one operating point.
As you will see, the resulting low-order linear model simulates significantly faster than the original nonlinear model.
Let’s take a closer look at the Simulink model.
The input is the duty cycle. As you can see here, the duty cycle command is a constant value plus a step signal.
This step signal creates a small perturbation around the steady-state operating point.
The output is load current.
Let’s minimize the model and use this script here to run the simulation and plot the resulting load current.
The step in duty cycle happens at one thousands of a second.
In this plot of a load current you see that the model starts in steady-state operating condition, and then experiences this small perturbation
around the steady-state operating point.
By using a small step change in the duty cycle we hope to stay within a linear region around the steady-state operating point.
Now we want to create a linear model and reduce its order to approximate this behavior.
So let’s go back to our Simulink model here and start by linearizing it.
To do that, we go into Analysis, Control Design, Linear Analysis, and start the Linear Analysis tool.
We will linearize the model from the duty cycle to load current.
The model is linearized, the linear system is calculated.
You can see it has 1 output, 1 input, and six states.
And here is the bode plot of this linear model.
Let’s copy the linear model to MATLAB workspace.
Now let’s go ahead and reduce the order of this linear model.
To do that we open a Model Reducer app.
This app provides several methods that we can use for model order reduction.
Let’s start with a method called balanced truncation.
This method analyzes the singular values of the model to determine states with low energy contribution,
and based on that determines the order of the reduced model.
In this case the tool determined that we can use 2nd order model, and it will do a good enough job to approximate our 6th order model.
You can see this in the upper plot, where the Bode plot of the reduced model is shown in red,
and the Bode plot of the 6th order model is shown in blue.
So let’s go ahead and create the reduced model.
It is created here.
Let’s go ahead and rename it.
Here, if we wanted, we could use other methods, such as mode selection,
where we can specify the region in the frequency domain where we want to keep the modes of the system
and create the corresponding approximation, or we could use pole-zero simplification
where we could cancel close pole-zero pairs.
So let’s take the reduced order model we calculated and export it to MATLAB workspace.
Now let’s see if this model really approximates the behavior of the original Simulink model.
To do that, we’ll open another Simulink model that you see here.
The input is the same step change in the duty cycle we used to perturb the original Simulink model,
but now we are feeding this step through the linear model, reduced model, that we just created using Model Reducer app.
You can see that we implemented this model in Simulink using LTI System block,
and to the output of the LTI System block we add the steady-state load current value from the original Simulink model.
Let’s go ahead, simulate this model, and plot the results.
Here the blue line is the output of the original, nonlinear Simulink model,
and the red line is the output of the Simulink model that uses reduced, 2nd order system.
You see that even though the match is not perfect, it is quite close,
probably close enough for us to use reduced order model for control design and for simulations.
Now, here is the real benefit of reducing order of the model.
Let’s run the nonlinear Simulink model three times and calculate the average time of the simulation.
We see that it is about 1.3 seconds.
Repeat this with the reduced model. We see that the average time here is just 0.68 seconds.
If we calculate the ratio of average run times, we see that the reduced model runs almost two times faster than the original.
For a more complex nonlinear model, the benefit would be even greater.
To approximate a nonlinear model not just around one operating point, but across the operating region,
we would create several linear, reduced order models, and schedule them with some parameters –
this is what’s called a linear parameter-varying model.
So,in summary, in this video you saw how to approximate complex model with reduced order linear models using Model Reducer app.
This concludes the video.