如何在Simulink中绘制非线性状态空间模型? [英] How to plot non-linear state space models in Simulink?
问题描述
我正在尝试绘制非线性模型,以便将其与线性化模型进行比较.
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:
我没有找到有关如何在MathWorks上绘制非线性状态空间模型表示形式的参考.
I found no references on how to plot non linear state space model representations on MathWorks.
Simulink 状态空间块用于实现线性状态空间系统而不是非线性系统.
The Simulink state-space block is used to implement linear state-space systems and not non linear ones.
因此,如何在Simulink中绘制非线性状态空间模型的响应?任何建议将不胜感激.
So, how can I plot the response of a non-linear state space model in Simulink ? Any suggestions would be appreciated.
推荐答案
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.';
这篇关于如何在Simulink中绘制非线性状态空间模型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!