Using bisection method to solve vibrations problem

1 次查看(过去 30 天)
For my numerical methods class, we use MATLAB to solve all problems. I already have the bisection method code:
if true
function [x] = bisection(fun,a,b,maxtol,maxitr)
if nargin<5, maxitr=50; end
if nargin<4, maxtol=0.001; end
x = a;
k = 0;
fprintf('\nIter#\ta\t\t\tf(a)\t\t\tf(b)\t\tf(x)\n');
while k < maxitr && (abs(fun(x))) >= maxtol
k = k+1;
x = (a+b)/2;
if(fun(a) * fun(x)) < 0
b = x;
else
a = x;
end
fprintf('\n%i\t\t%f\t%f\t%f\t%f\t%f\t%f\n', k, a, fun(a), fun(b), fun(x))
end
For my problem, I have the solution as:
x(t) = x0*(exp(-ct/2m))*cos(sqrt((k/m) - ((c/2*m)^2)*t))
where t at t=0, x = x0.
I also have:
frequency: w = sqrt(k/m - (c/2*m)^2)
period: T = 2*pi / sqrt((k/m)-(c/2*m)^2)
critically damped: k/m - (c/2*m)^2 = 0
overdamped: k/m - (c/2*m)^2 < 0
I've been given values for k, c, and m.
My goal is to use the bisection method to find the time instants when the displacement is 5% of the initial displacement. I need the first three solutions.
I have no idea how to solve this, or even begin.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Acoustics, Noise and Vibration 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by