bisection method using matlab

1 次查看(过去 30 天)
vertical velocity of a motorcycle due to a road bump is given by:
V(t)=X*exp(-zeta*Wn*t)*(-zeta*Wn*sin(Wd*t)+Wd*cos(Wd*t))
Where; X=maximum displacement of the motor cycle , 0.4550m zeta=damping constant , 0.4037 Wn=undamped natural frequency of the system , 3.4338rad/s Wd= Wn*sqrt(1-zeta^2)=damped natural frequency of the system t=time
Determine the time, t, at which the velocity of the motorcycle attains a value of 1m/s.
I know how to find it by using microsoft excel. However, I would like to try it in matlab. Can anyone help me?
Thx
  1 个评论
bym
bym 2011-10-21
you usually have to show some attempt at using matlab, and ask a specific question to get a response

请先登录,再进行评论。

回答(1 个)

Niranjan Sundararajan
Hey there,
What you essentially want to compute is the inverse of the function V(t). To do so in MATLAB, you can use the fzero function. Documentation link - https://in.mathworks.com/help/matlab/ref/fzero.html
Now, you want to find V(inverse) of 1 m/s. To do so, follow the following code snippet. P.S. - I have used the formula you provided for velocity.
format long;
V=1; %m/s
f_inv_val_of_t = fzero(@(t) f(t) - V, 0) %seconds
f_inv_val_of_t =
0.103244252227968
verification_output = f(f_inv_val_of_t) % = 1 m/s only
verification_output =
1.000000000000000
function V = f(t)
%time in seconds
X = 0.4550; %m
zeta = 0.4037;
Wn = 3.4338; %rad/s
Wd = Wn*sqrt(1-zeta^2); %rad/s
V=X*exp(-zeta*Wn*t)*(-zeta*Wn*sin(Wd*t)+Wd*cos(Wd*t)); %m/s
end

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by