0
\$\begingroup\$

I am trying to plot a non-linear model in order to compare it with it's linearized counterpart.

I am following this paper Nonlinear Model & Controller Design for Magnetic Levitation System and trying to reproduce the results the authors obtained. In particular I am trying to plot:

enter image description here

enter image description here

enter image description here

The above equations can be represented in vector format as follows:

enter image description here

I found no references on how to plot non linear state space model representations on MathWorks.

The Simulink state-space block is used to implement linear state-space systems and not non linear ones.

So, how can I plot the response of a non-linear state space model in Simulink ? Any suggestions would be appreciated.

\$\endgroup\$
0
\$\begingroup\$

One method is to use a Matlab Function Block to implement the nonlinear equations. You can define the inputs and outputs yourself in this block.

The body of the function block will look something like this:

function [xdot, y] = nonlinearss(x,u)

    % define  constants
    g = 9.81
    % etc...

    % nonlinear set of equations
    xdot = [x(2); g-C/m*(x(3)/x(1))^2; etc...] + [0;0;1/L]*u;

    y = x.';
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.