In: Mechanical Engineering
Use MATLAB DSOLVE to solve the folloing ODE and plot it:
300x'' + 60x' + 6840 = f(t)
here for f(t) we need to take some function here we use "f(t) = t" to solve you can use whatever given in question or generalized-
convert equation in form of x'' on LHS and rest on RHS -
Matlab code -
syms x(t)
eqn = diff(x,t,2) == (t/300)-22.8-0.2*diff(x,t);
xSol(t)= dsolve(eqn)
answer comes as -
xSol(t) = C1 - (1369*t)/12 + t^2/120 + C2*exp(-t/5) + 6845/12
where C1, C2 are constants and will depend on boundary conditions.
Plot - for plotting give value of C1 and C2 depending on boundary condition here if C1=C2=1
then -
xSol(t) = 1 - (1369*t)/12 + t^2/120 + 1*exp(-t/5) + 6845/12
Matlab code
y = xSol(t)
t = [1,100]
plot(t,y)
My plot came out to be -
Please give feedback and rating