can any one solve this ?
์กฐํ ์: 17 (์ต๊ทผ 30์ผ)
์ด์ ๋๊ธ ํ์
A small scale model of a passenger car can be represented by the simple mass supported by a spring and a damper as shown in Fig. Q2. The vertical motion of this system can be described by the following ordinary differential equation: ๐๐
๐๐๐
๐๐+๐๐
๐๐
๐+๐๐=๐
where x = displacement from equilibrium position (m), t = time (s), m =mass (kg) and c = the damping coefficient (N ยท s/m) and k = spring constant (N/m). The mass is 20 kg. The spring constant k = 20 N/m. The initial velocity (dx/dt) is zero, and the initial displacement x = 0.5 m.
The damping coefficient c takes on three values of 5 (underdamped), 40 (critically damped), and 200 (overdamped).
A- Write and execute a computer code using โOctave platformโ to solve this equation over the time period 0 โค t โค 5 s for the underdamped and overdamped cases.
B- Plot the displacement (x) and velocity (dx/dt) versus time for the under damped and overdamped cases for the whole time period.
C- Compare the results using different time steps for the underdamped case only.
๋๊ธ ์: 0
๋ต๋ณ (1๊ฐ)
Paresh yeole
2020๋
6์ 1์ผ
m = 20; % kg
k = 20; %N/m
x_0 = 0.5; %m
c1 = 5; %underdamped
c2 = 40; % critically damped
c3 = 200; %overdamped
syms x(t)
Dx = diff(x,t);
Dx2 = diff(x,t,2);
ode = m*Dx2+c1*Dx+k*x == 0;
ode1 = m*Dx2+c3*Dx+k*x == 0
cond1 = x(0) ==0.5;
cond2 = Dx(0) == 0;
conds = [cond1 cond2];
xSol(t) = dsolve(ode,conds);
xSol1(t) = dsolve(ode1,conds);
for t=1:5
dist(t) = eval(xSol(t));
dist1(t) = eval(xSol1(t));
end
The above code will help you complete the second and third question
๋๊ธ ์: 4
James Tursa
2020๋
6์ 1์ผ
Maybe the OP couldn't find anyone to do the homework for him on the Octave forum, so he came here ...
์ฐธ๊ณ ํญ๋ชฉ
์นดํ ๊ณ ๋ฆฌ
Help Center ๋ฐ File Exchange์์ Programming์ ๋ํด ์์ธํ ์์๋ณด๊ธฐ
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!