How to plot non-linear state space models in Simulink?

柔情痞子 提交于 2019-12-25 00:24:13

问题


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:

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

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.


回答1:


You can 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 your constants
    g = 9.81
    % etc...

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

    y = x.';


来源:https://stackoverflow.com/questions/53338098/how-to-plot-non-linear-state-space-models-in-simulink

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!