MATLAB Answers

Gloria
0

ode23 , matrix equation , 2nd order DE

Gloria
さんによって質問されました 2019 年 6 月 14 日
最新アクティビティ darova
さんによって コメントされました 2019 年 6 月 19 日
How I will solve this matrix in Matlab ?
w=10.02;
p= 7850; %%%Kg/m^3;
g=9.81;
G=77*10^9; %%% N/m^2
E=206*10^9; %%% N/m^2
L=9.6; %%%m
D=0.15 ; %%m
m=pi*(D/2)^2*L*p;
A=pi*D^2/4 ; %%m2
J=m*D^2/8; %%Kg*m^2
Ip=pi*D^4/32 ; %% m^4
I=pi*D^4/64 ;
cx=0.05*m*w;
cy=0.05*m*w;
ct=0.08*J*w;
kx=3*E*I/L;
ky=3*E*I/L;
kt=G*Ip/L;

  0 件のコメント

サインイン to comment.

2 件の回答

darova
回答者: darova
2019 年 6 月 14 日
 採用された回答

You can find roots for x'', y'' and dtheta'' every iteration solving matrix equation
function du = func(t,u)
u1 = u(1:3)'; % [x y theta]'
du1 = u(4:6)'; % [dx dy dtheta]'
dth = u(6); % dtheta
C = [cx 0 0; 0 cy 0; 0 0 cz]; % C matrix
K = ... % K matrix
F = [me(w+dth)^2+Fx; ...] % force vector
A = [m 0 -mesin(wt)...] % mass matrix
B = -C*du1 -K*u1 + F;
du = zeros(6,1);
du(1:3) = u(4:6);
du(4:6) = A\B;
end

  7 件のコメント

darova
2019 年 6 月 19 日
Main mistake is using clear all in function. You clearing all variables including t and u (function arguments)
Gloria
2019 年 6 月 19 日
Error using ode45
Too many input arguments.
Error in Untitled2 (line 10)
[t,u] = ode45(@dokuz,tspan,IC);
BUT WITH ODE23 IT GIVES THE ANSWERS, THANK YOU SO MUCH
darova
2019 年 6 月 19 日
Can you accept the answer please?

サインイン to comment.


Torsten
回答者: Torsten
2019 年 6 月 14 日

Convert the system to a first order system and write it as
M*y' = f(t,y)
Then use the mass-matrix option of the ODE solvers to supply M, define f in a function file and use ODE45, ODE15S, ... to solve.

  6 件のコメント

Jan
2019 年 6 月 14 日
@Gloria: You can't. s6' is not Matlab code, but a mathematical expression.
Gloria
2019 年 6 月 16 日
But I got the figures;
sdot=@(t,s)...
[s(2);
(m*e*sin(w*t)*s(6)'-cx*s(2)-kx*s(1)+m*e*(w+s(6))^2*cos(w*t)+Fx(t))/m;
s(4);
(-m*e*cos(w*t)*s(6)'-cy*s(4)-ky*s(3)-m*g+m*e*(w+s(6))^2*sin(w*t)+Fy(t))/m;
s(6);
(m*e*sin(w*t)*s(2)'-m*e*cos(w*t)*s(4)'-ct*s(6)-kt*s(5)-m*e*g*cos(w*t)+Mt(t))/(J+m*e^2)];
So Can I write s(6)',s(2)'s(4)' or not?
Jan
2019 年 6 月 16 日
You can write s(6)', because ' is the Matlab operator for the complex conjugate transposition:
a = [1, 1i; ...
2, 2i]
a'
You provide real scalars. Then the ' operaotr does not change the value. So it is valid, but simply a confusing waste of time.

サインイン to comment.



Translated by