Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Data fitting with a model

Subject: Data fitting with a model

From: Ashgard

Date: 28 Apr, 2010 19:53:04

Message: 1 of 2

I have performed a system identification on a model (motor with load). The motor with load can be modeled as a fourth order system. The model looks like

sys = tf([m2 b k],[m1*m2 b*(m1+m2) k*(m1+m2) 0 0]);

Now I want to use matlab to find the optimal values for m1, m2, b, k such that the error between system sys and the measurement data (in frequency domain) is minimal.

What function should I use for this problem?

Thanks in advance,
Bob

Subject: Data fitting with a model

From: Miroslav Balda

Date: 28 Apr, 2010 20:49:04

Message: 2 of 2

"Ashgard " <azizz.bob@gmail.com> wrote in message <hra3n0$5$1@fred.mathworks.com>...
> I have performed a system identification on a model (motor with load). The motor with load can be modeled as a fourth order system. The model looks like
>
> sys = tf([m2 b k],[m1*m2 b*(m1+m2) k*(m1+m2) 0 0]);
>
> Now I want to use matlab to find the optimal values for m1, m2, b, k such that the error between system sys and the measurement data (in frequency domain) is minimal.
>
> What function should I use for this problem?
>
> Thanks in advance,
> Bob

Hi Bob,
If you have a vector of measured complex values g(f) for frequencies f, you may evaluate a vector of differencies rc=tf(f)-g(f), split it into real and imaginary components r = [real(r);imag(r)] via a function r = res(x), where x= [m1; m2; b; k], and use any function for solving a system of nonlinear equations by least squares method, say LMFnlsq from
     www.mathworks.com/matlabcentral/fileexchange/17534
or a function from the Optimization Toolbox.
Good luck!

Mira

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us