Matlab和力学(主要是物理学) [英] Matlab and mechanics (mostly physics)
问题描述
我正在尝试解决有关两个轴的动量的力学问题.我以前从未上过机械课,所以我不知道该如何解决这个问题.
I am trying to solve a mechanics problem regarding momentum of two shafts. I have never had a class an mechanics before, so i don't know how to approach this problem.
给出: 方程:
• J1*dw1/dt + Td(w12)+Ts(phi12) = T1;
• J2*dw2/dt - Td(w12) -Ts(phi12) = T2;
where w1 = dphi1/dt,
w2 = dphi2/dt,
phi12 = phi1 - phi2
w12 = w1 - w2
Td(w12) = c12 * w12
Ts(phi12) = ks * phi12
c12 and ks are some coefficients
• dphi12/dt = w12
• dw12/dt = T1/J1 - T2/J2 - Td(w12)/Jeq - Ts(phi12)/Jeq
ccr = 2*Jeq*wn
wn = sqrt(ks/Jeq)
Jeq = (J1*J2)/(J1+J2)
T1(t) = T0*1(t), T0 = 1 T2(t) = 0
J1+J2 = 10 wn = 100 rad/s c12 = 0 Ts(phi12) = ks*phi12
`
目标是绘制函数Tsmax/T0 = f(J1/(J1+J2))
任何指导将不胜感激.
The goal is to plot the function Tsmax/T0 = f(J1/(J1+J2))
Any guidance would be appreciated.
我尝试在simulink中求解方程,这是我到目前为止所做的
I tried solving the equation in simulink, here's what I did so far
我在matlab中的代码
My code in matlab
T0 = 1;
T2 = 0;
J1 = 5;
J2 = 10-J1;
wn=100;
Jeq=J1.*J2/(J1+J2);
ckr = 2.*Jeq*wn;
ks = (wn^2)*Jeq;
c12=0;
J1s = 1;
length(J1)
a2 = 0 :J1;
for c=1:J1
J1s = a2(c);
sim('model');
a = J1s/(J1s+J2);
plot(Ts,a)
hold all
end
grid on
它实际上并没有达到预期的效果. 据我所知,曲线应该类似于f(x)= -1x + b.
which really does nothing close to what is expected. To my information the curve should be something like f(x) = -1x+b.
推荐答案
我认为问题在于,在每次迭代中,您都没有重新计算J2
和Jeq
.现在,您的模型已使用J1
,J2
和Jz
参数化,因此这些是您每次迭代都需要更新的值.像这样:
I think the problem is that in each of your iterations, you are not re-calculating J2
and Jeq
. Now, your model is parameterised with J1
, J2
and Jz
so these are the values you need to update with each iteration. Something like:
a2 = 0:J1; % do you really want 0 inertia?
Tsmax = zeros(size(a2));
for ii=1:length(a2)
J1 = a2(ii); % Using J1 as model is parameterised with J1;
J2 = 10 - J1; % New value of J2
Jz = J1*J2/(J1+J2); % New value of Jz
sim('model'); % ks and c12 do not change with each iteration
Tsmax(ii) = max(Ts); % get max value of Ts
end
% Plot Tsmax as a function of Jeq
Jeq = (a2.*(10-a2))/10;
plot(Jeq,Tsmax)
grid on
这篇关于Matlab和力学(主要是物理学)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!