.st0{fill:#FFFFFF;}

Optimizing system using Simulink Design Optimization 

 August 8, 2020

By  Edward Rodriguez

Introduction

Let's imagine that you want a system to be controlled. Therefore, you go to Simulink, you build the model, you simulate it, you compare the response obtained in simulation with your real measured data, and you see that they do not match, what happened? Are you sure that you have found the correct parameters for your model? No? Don't worry about it, with Simulink Design Optimization it is straight forward to discover this, you will only need actual measured data from your system, and then we will see how to estimate the parameters of your model. Actually, if you want more, we could use the same toolbox to get a proper response from the system according to your requirements.

Simulink Design Optimization is an exciting toolbox since it allows you to use some optimization methods to minimize a cost function. This toolbox is commonly used for dynamical systems, as seen in control systems. It can help you in improving your system response and estimate the parameters of your model. On this blog, the most important features of Simulink Design Optimization will be covered to give you a complete insight. Two important topics which will be discussed here:

  • Parameter estimation
  • Response optimization

First, we will use Parameter estimator app to match the response of a simulated model in Simulink comparing its response with real measured data, we will see that some previous steps will need to be done until estimate the model parameters like do preprocessing data.

Then, for the other approach, we are using the Response optimizer app to get a proper system response for some user-given requirements, there will be different ways to do this, and we will see the main ones.

Note: You must have Simulink Design Optimization Toolbox installed in your MATLAB. To check if it is present, use >>ver in MATLAB Command Window and locate this toolbox.

Simulink Design Optimization for parameter estimation

Simulink design optimization allows us to find some parameters of our model if they are missed or even give us an insight into possible parameter values according to the system's response (measured data). Next, we will introduce the model that we are using for parameter estimation.

Model

In this case, we have chosen a MATLAB built-in model: Engine Throttle model. The throttle system controls the flow of air and fuel mixture to the engine cylinders. There is a butterfly valve that opens when a driver presses the accelerator pedal. Opening this valve and depending on how the valve opens the engine speed will increase or decrease.

Simulink Design Optomization

As you see, there are two subsystems:

Motor subsystem

Throttle subsystem

Preprocessing data

Comparing real data vs simulated data

Extract Data

Replacing outliers

Filtering data

Estimating parameters

Validating parameters

Simulink Design Optimization for Response Estimation

Now, we are exploring some approaches that could be used for response estimation.

Using time-domain specifications

We are using a MATLAB built-in model: watertank_stepinput, so you can open or create this model from the command window.

Simulink Design Optimization

The Water-Tank system is given by:

A \dot{H}=b V-a\sqrt(H)

Where:
  • A= cross-sectional area
  • b= flow rate constant
  • a= flow rate constant
  • H= height of the water in the tank
  • V= voltage applied to the pump

This is a nonlinear model with single-input and single-output (SISO), where the height of the water is the output. We are starting with adding the model parameter values:

Go to the model workspace and add the model values:

Simulink Design Optimization

Now, there are different forms to specify the time-domain requirement, let's use the most friendly one! We are using Check Step Response Characteristics block, only be sure that this block is connected to the system output.

Simulink Design Optimization

And add your time-domain requirements:

Simulink Design Optimization

Now click on Ok and open response optimizer app

Simulink Design Optimization

Click on plot model response

Simulink Design Optimization

Black lines show the boundary constraints for time-domain requirements (settling time, rise time, so on) so, when optimization finishes, the model response should accomplish these boundaries.

Now it is time to select the parameters of the controller to obtain the desired response. Select Ki and Kp.

Simulink Design Optimization

Next step is to click on optimize, and finally, the result is shown:

Simulink Design Optimization

The final response (blue) met all the requirements, and Kp and Ki values are updated!

Specifying a tracking signal

The optimized response is:
Simulink Design Optimization

Conclusion

Simulink Design Optimization is an excellent tool if you are looking for how to estimate parameters of a model, you can both estimate and validate the obtained parameters, and this will help you to notice if there is any overfitting or underfitting as well. On the other side, you can use the estimating Parameter not only for your model but also to find your best controllers for any requirements and even if you need to track some user-defined reference.

Get instant access to the code, model, or application of the video or article you found helpful! Simply purchase the specific title, if available, and receive the download link right away! #MATLABHelper #CodeMadeEasy

Ready to take your MATLAB skills to the next level? Look no further! At MATLAB Helper, we've got you covered. From free community support to expert help and training, we've got all the resources you need to become a pro in no time. If you have any questions or queries, don't hesitate to reach out to us. Simply post a comment below or send us an email at [email protected].

And don't forget to connect with us on LinkedIn, Facebook, and Subscribe to our YouTube Channel! We're always sharing helpful tips and updates, so you can stay up-to-date on everything related to MATLAB. Plus, if you spot any bugs or errors on our website, just let us know and we'll make sure to fix it ASAP.

Ready to get started? Book your expert help with Research Assistance plan today and get personalized assistance tailored to your needs. Or, if you're looking for more comprehensive training, join one of our training modules and get hands-on experience with the latest techniques and technologies. The choice is yours – start learning and growing with MATLAB Helper today!

Education is our future. MATLAB is our feature. Happy MATLABing!

About the author 

Edward Rodriguez

My Name is Edward Rodriguez, I am 22 years old and I am from Cúcuta, Colombia (not Columbia). I studied Electronics Engineering at the Industrial of Santander University (UIS) in Bucaramanga, Colombia. I like listening to Salsa music and playing soccer in my free time!!!

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

MATLAB Helper ®

Follow: YouTube Channel, LinkedIn Company, Facebook Page, Instagram Page

Join Community of MATLAB Enthusiasts: Facebook Group, Telegram, LinkedIn Group

Use Website Chat or WhatsApp at +91-8104622179

>