I cant plot a graph of ode45 function for state space modeling, I don't know how to define.
2 次查看(过去 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
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
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!