Simulating a non linear model in Simulink

3 ビュー (過去 30 日間)
Ryan Rizzo
Ryan Rizzo 2018 年 11 月 28 日
編集済み: Ryan Rizzo 2018 年 11 月 28 日
I am trying to model the non-linear system.
System Equations in Vector format:
Physical Parameters:
where x01, x02 and x03 are initial conditions representing displacement, velocity and acceleration.
In order to simulate this non-linear model I used a function block in Simulink:
My question is: Should I inlcude the initial conditions to the code below, and if so, how can I achieve this? Since in the code below the initial conditions are unused if initialized as they are.
function [xdot,y] = fcn(x,u)
% define your constants
g = 9.81;
m = 0.05;
R = 1;
L = 0.01;
C = 0.0001;
% x1 = 0.012;
% x2 = 0;
% x3 = 0.84;
% nonlinear set of equations
xdot = [x(2); g-((C/m)*(x(3)/x(1))^2); -((R/L) +(((2*C)/L)*(((x(2)*x(3))/((x(1))^2)))))] + [0;0;1/L]*u;
y = x';

回答 (0 件)

カテゴリ

Help Center および File ExchangeLinearization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by