Borrar filtros
Borrar filtros

Simulating a non linear model in Simulink

2 visualizaciones (últimos 30 días)
Ryan Rizzo
Ryan Rizzo el 28 de Nov. de 2018
Editada: Ryan Rizzo el 28 de Nov. de 2018
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';

Respuestas (0)

Categorías

Más información sobre Modeling en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by