I cant plot a graph of ode45 function for state space modeling, I don't know how to define.

조회 수: 1 (최근 30일)
syms x1 x2 x3
m=1000; %Mass in Kg
L=3.5; %length in meters
g=9.81; %gravty term in m/s^2
c=1; %damping ratio
I=0.5; %inductance
u=0; %free response
kt=1; % torque constant
kb=1; %back emf constant
R=1;
A=[-R/I -kb/I 0; kt/m*L^2 -c/m*L^2 -g*0.5/L; 0 1 0];
B=[1/I;0;0];
C=[0 0 m*g*L/2];
D=0;
% x3dot=x2;
% x2dot=(1/m*L^2)*(kt*x1-c*x2-m*g*L*sin(x3));
% x1dot=1/I*(u-R*x1-kb*x2);
% y=m*g*L*sin(x3);
plot(t,y)
  댓글 수: 1
Jan
Jan 2022년 11월 1일
Please read the documentation of ODE45, where you find some examples:
doc ode45
For a numerical integration you do not need symbolic variables, but a function to calculate the derivative and an initial value.

댓글을 달려면 로그인하십시오.

답변 (1개)

Sai
Sai 2022년 11월 24일
Hi Jasmin,
Please refer to the follwing link on how to solve state space equation by ODE45
For more information on ode45, please refer to the following documentation link

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by