2) A system is found to have an equation of motion of 2 8 10x 80sin(3t). Create
ID: 2087230 • Letter: 2
Question
2) A system is found to have an equation of motion of 2 8 10x 80sin(3t). Create a Matlab plot that can plot the displacement, velocity, and acceleration of this system subject to a variety of initial conditions. The output should be single, well-documented graph, and no data in the Command Window. Plot position vs time, velocity vs time, and acceleration vs time. Make sure to label each axis and create a title. Your code should be well-commented. The function should be titled _firstname>_ME3030HW10.m. For example, Dr. Lerner would calll her function lerner_annemarie_ME3030HW10.m. (Please note I omitted my hyphen, as Matlab would consider that a minus sign). (4 points)Explanation / Answer
close all
clear
syms x(t)
Dx = diff(x);
%%Dx is taken as diffrentiation of x wrt time t
D2x = diff(x,2);
%%D2x is double diffrentiation
ode = 2*D2x +(8*Dx)+ 10*x == 80*sin(3*t);
%%initial condition is taken x(0)==0, Dx(0)==0 i.e. displacement and
%%velocity at stating is zero
xSol = dsolve(ode, x(0)==0, Dx(0)==0)
figure
%%plotiing the solution i.e. displacement wrt time
ezplot(xSol)
xlabel(' time,t[sec]');
ylabel('displacemnt,x[m]');
hold on
v=diff(xSol)
figure
ezplot(v)
xlabel(' time,t[sec]');
ylabel('velocity,v[m/sec]');
hold on
a=diff(v)
figure
ezplot(a)
xlabel(' time,t[sec]');
ylabel('acceleration,a[m/sec^2]');
run the matlab code .you can see the displacement,velocity,acceleration
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.