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

5 次查看(过去 30 天)
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.
;)

采纳的回答

Anh Tran
Anh Tran 2018-1-3
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 个评论
Franck Donnadieu
Franck Donnadieu 2018-1-7
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Variable Initialization 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by