Question

In: Mechanical Engineering

Plot the solution of the equation 6ẏ + y = f(t) if f (t) = 0 for t + 0 and f(t) = 15 f

Plot the solution of the equation

6ẏ + y = f(t)

 

if f (t) = 0 for t + 0 and f(t) = 15 for t ≥ 0. The initial condition is y(0) = 7.

Solutions

Expert Solution

Program plan:

• To write a matlab code to plot the differential equation with the given conditions.

 

Program:

%**********************************************************

%A matlab code is written to plot the motion of a mass

%connected to a spring with viscous friction on the surface

%with the given condition.

%**********************************************************

%Declaration of function, File name :\'msd.m\'

function xdot = msd(t,x)

%Declaration of global variable

global c f k m

%Declaration of array

A = [0,1;-k/m,-c/m];

%Declaration of array

B = [0;1/m];

%Computes the value

xdot=A*x+B*f;

%End of function

end

%Declaration of variable

global c f k m

%Declaration of constant

m = 3;

%Declaration of constant

c = 18;

%Declaration of constant

k = 102;

%Declaration of constant

f = 10;

%Computes the vales of the function \'msd\'

[t, x] = ode23(\'msd\', [0, 2], [0, 0]);

%Plotting

plot(t,x(:,1)),

%Assigns text to x-axis

xlabel(\'t\'),

%Assigns text to y-axis

ylabel(\'y\')

 

Outtput:

 

%Output with different constants m=3,c=39 and k=120


%Output with different constants m=3,c=39 and k=120

Related Solutions

1. The differential equation y''+4y=f(t) and y'(0)=y(0)=0 a. Find the transfer function and impulse response. b....
1. The differential equation y''+4y=f(t) and y'(0)=y(0)=0 a. Find the transfer function and impulse response. b. If f(t)=u(t)-u(t-1). Find the y(t) by convolution and Laplace techniques. u(t) is unit step function. c. If f(t)= cos(t) ; find the y(t) by convolution and Laplace techniques. 2. The differential equation y''+3y'+2y=e^(-3t) and y'(0)=y(0)=0 a. Find the system transfer function and impulse response. b. Find the y(t) by convolution and Laplace techniques. 3. y''+3y'+2y=f(t) and y'(0)=y(0)=0 Plot y(t) without any calculations and write...
Solve the equation below for y(t): y''+2y'-3y=8u(t-3): y(0) = 0; y'(0)=0
Solve the equation below for y(t): y''+2y'-3y=8u(t-3): y(0) = 0; y'(0)=0
if y(t) is the solution of y′′+2y′+y=δ(t−3),y(0)=0,y′(0)=0 the find y(4)
if y(t) is the solution of y′′+2y′+y=δ(t−3),y(0)=0,y′(0)=0 the find y(4)
Solve the initial value problem: Y''-4y'+4y=f(t) y(0)=-2, y'(0)=1 where f(t) { t if 0<=t<3 , t+2...
Solve the initial value problem: Y''-4y'+4y=f(t) y(0)=-2, y'(0)=1 where f(t) { t if 0<=t<3 , t+2 if t>=3 }
Use the Saturation block to create a Simulink model to plot the solution of the following equation for 0 ≤ t ≤ 6.
Use the Saturation block to create a Simulink model to plot the solution of the following equation for 0 ≤ t ≤ 6.
Solve the differential equation by Laplace transform y^(,,) (t)-2y^' (t)-3y(t)=sint   where y^' (0)=0 ,y=(0)=0
Solve the differential equation by Laplace transform y^(,,) (t)-2y^' (t)-3y(t)=sint   where y^' (0)=0 ,y=(0)=0
Solve the Following Equation: y'' + y' + y = a*sin(ω*t), y(0) = 0 , y'(0)...
Solve the Following Equation: y'' + y' + y = a*sin(ω*t), y(0) = 0 , y'(0) = 0 Thanks
y′ = t, y(0) = 1, solution: y(t) = 1+t2/2 y′ = 2(t + 1)y, y(0)...
y′ = t, y(0) = 1, solution: y(t) = 1+t2/2 y′ = 2(t + 1)y, y(0) = 1, solution: y(t) = et2+2t y′ = 5t4y, y(0) = 1, solution: y(t) = et5 y′ = t3/y2, y(0) = 1, solution: y(t) = (3t4/4 + 1)1/3 For the IVPs above, make a log-log plot of the error of Backward Euler and Implicit Trapezoidal Method, at t = 1 as a function of hwithh=0.1×2−k for0≤k≤5.
y′ = t, y(0) = 1, solution: y(t) = 1+t2/2 y′ = 2(t + 1)y, y(0)...
y′ = t, y(0) = 1, solution: y(t) = 1+t2/2 y′ = 2(t + 1)y, y(0) = 1, solution: y(t) = et2+2t y′ = 5t4y, y(0) = 1, solution: y(t) = et5 y′ = t3/y2, y(0) = 1, solution: y(t) = (3t4/4 + 1)1/3 For the IVPs above, make a log-log plot of the error of Explicit Trapezoidal Rule at t = 1 as a function ofhwithh=0.1×2−k for0≤k≤5.
Suppose that y′=0.162sin2(ty)+1. Plot y(t) from t=0 to t=4 with y(0)=1.286 using Euler's method with a...
Suppose that y′=0.162sin2(ty)+1. Plot y(t) from t=0 to t=4 with y(0)=1.286 using Euler's method with a step size of 0.4.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT