Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Can you help me please !

조회 수: 1 (최근 30일)
Johnny Vendetta
Johnny Vendetta 2019년 9월 22일
마감: MATLAB Answer Bot 2021년 8월 20일
I have 1 code vibration.
function main
d1=1;
v=10;
t_end=3;
t=0:0.01:t_end;
y0=[0;0;0;0];
[t,y]=ode45(@daodong,t,y0);
hold on;grid on;
plot(t,y(:,1))
end
function yp = daodong(t,y)
c=10;
vt=10;
k1=84.24;
m1=5.265;
I1=0.1594;
a=0.174;
yp = zeros(4,1);
yp(1) = y(2);
yp(2) = ((-(c*(y(2)-0.05*pi*vt*(sin(4*pi*vt*t))-(a*y(4)/4))+k1*(y(1)-(0.05*(sin(2*pi*vt*t))^2)-(a*y(3)/4))))/m1);
yp(3) = y(4);
yp(4) = ((-(a*c*(y(2)-0.05*pi*vt*(sin(4*pi*vt*t))-(a*y(4)/4))+a*k1*(y(1)-(0.05*(sin(2*pi*vt*t))^2)-(a*y(3)/4))))/(2*I1));
end
please help me determine acceleration at t=0 and t=t_end.
  댓글 수: 7
Walter Roberson
Walter Roberson 2019년 9월 22일
it seems pretty likely that y(1),y(3) are positions and y(2),y(4) are velocities
I though that at first. The first output depends upon y(2) and not directly on any other variables, which is consistent with a simple acceleration leading to the integrated first output being position and the second output being velocity. And at first glance, the third output has the same form, making it appear that the third output is also a position and the fourth output being velocity. However, the second output depends upon y(1), y(2), y(3), y(4), so the second output depends upon the integral of an integral and so if the first output is position and the second is velocity, the third would have to be accelaration, and the fourth would have to be rate of change of accelaration. But the fourth output also depends upon y(1), y(2), y(3), y(4) so you induce an infinite hierachy of accelations and so all of the variables become variables representing rate of change of an infinite chain of values, and none of them become acceleration in the classical sense.
I am getting the impression that this is a system with two coupled springs ??
Johnny Vendetta will have to define the variables for us to proceed any further.
Walter Roberson
Walter Roberson 2019년 9월 22일
Wait a second, though. The first column of output of the ode would be the integration of the first output of the function. It is unlikely that the integral of the position is desired. It is more likely that the first output of the function is a velocity which the ode would integrate to position. The second output of the function would then be an acceleration which the ode would integrate to velocity.
Although it might be possible to add another layer of variables to capture the acceleration directly in the y output as an integral of something else, it would probably be easier to just use gradient() of the time and the second column of the y output.

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by