How to insert a curve stemming from a measure in Simulink to use the parameter estimation?

11 views (last 30 days)
Hello to all, I explain you briefly the problem with which I am confronted.I would like using the "Parameter estimation". This tool allows to determine the parameters adequate of a component (in my case, the internal resistance, the constant of torque and the inertia of my rotor).
The goal is that the answer in simulation is the closest possible of the experimental statement
I have made a measure of the current absorbed by means of an oscilloscope I have marked some points with Excel log which I saved in *.mat file.
The problem it is because when I run the simulation, I have well my curve of simulated current (in red) but my experimental curve is in the form of "lines"??
What is infuriating it is that I manage to show this experimental curve with the PLOT command… If somebody had the solution to my problem I would be very grateful to him(her) for it.
Good evening.
PS: Sorry but i can't post no more pictures, "You are limited to 10 daily uploads. If you need to upload additional files, delete one or more files now or wait 24 hours to upload more files."
I Will try again tomorow.
;)

Accepted Answer

Anh Tran
Anh Tran on 3 Jan 2018
Hi Frank,
It seems that you are trying to input a vector into Simulink scope block. Simulink will treat each element of your vector as a signal and display as individual constant lines. For example, if you input a 10-by-1 vector, you will see 10 lines in your Scope.
There are many ways to serialize your vector. For a simple workaround, you may want to pass 1 element of your vector at each time step to your scope. You can do this with a MATLAB function block and a Clock block. You can check my set up below. Note that my input is a 1-by-10 vector and my configuration is for fixed step solver with 1 second. At each second, I pass 1 element from the vector to the below scope. The scope above, on the other hand, should show 10 lines. If you have different time step setting, you may want to tweak the MATLAB function block.
function y = fcn(u,t)
y = u(t+1);
There is a much easier way with Serilizer1D block if you have HDL Coder license.
Hope this helps.
Best,
Anh
  1 Comment
Franck Donnadieu
Franck Donnadieu on 7 Jan 2018
Hi Anh and thank you for your help. I did not obtain result with MATLAB Function Block but seriliser1D Block helped a lot me, I have just a problem with the scale of my curve. If you have time I would come back to you to explain yourselves my problem if I do not manage to find how to parametrize my blocks. Thank you again.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!