Question

In: Computer Science

Solve using the same approach as the solution using Matlab for this differential equation d^2y/dt^2 +...

Solve using the same approach as the solution using Matlab for this differential equation
d^2y/dt^2 + 6dy/dt + 9y = cos(t)
has initial conditions y(0)=1 y'(0)=2, Find Y(s) and without finding y(t),
determine what function of time will appear in the solution

%}
clear, clc
syms Y s t real
rhs = laplace(cos(t),t,s)
eqn1 = s^2*Y - s*2 - 1 + 6*s*Y -1 + 9*Y ==rhs
myanss = solve(eqn1,Y)
mypart = partfrac(myanss,'FactorMode','real')
%{
 
mypart =
 
(0.08*s + 0.06)/(s^2 + 1.0) + 1.92/(s + 3.0) - 4.3/(s + 3.0)^2
first term yields
exp(-b*t)*cos(w*t)
2nd term yields exp(-3*t)
3rd term yields t*exp(-3*t)
check
%}
myanst = (ilaplace(mypart,s,t))
%{
 
myanst =
 
exp(-t*1.0i)*(0.04 + 0.03i) + exp(t*1.0i)*(0.04 - 0.03i) + 1.92*exp(-3.0*t) - 4.3*t*exp(-3.0*t)
%}


T = [0, 20]
fplot(myanst,T)

Solutions

Expert Solution

`Hey,

Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.

The equation was wrong. I corrected. L{y''(t)}=s^2*y(s)-s*y(0)-y'(0)

clc
clear all
close all
syms Y s t real
rhs = laplace(cos(t),t,s)
eqn1 = s^2*Y - s*1 - 2 + 6*s*Y -6 + 9*Y ==rhs
myanss = solve(eqn1,Y)
mypart = partfrac(myanss,'FactorMode','real')
%{

mypart =

(0.08*s + 0.06)/(s^2 + 1.0) + 1.92/(s + 3.0) - 4.3/(s + 3.0)^2
first term yields
exp(-b*t)*cos(w*t)
2nd term yields exp(-3*t)
3rd term yields t*exp(-3*t)
check
%}
myanst = (ilaplace(mypart,s,t))
%{

myanst =

exp(-t*1.0i)*(0.04 + 0.03i) + exp(t*1.0i)*(0.04 - 0.03i) + 1.92*exp(-3.0*t) - 4.3*t*exp(-3.0*t)
%}


T = [0, 20]
fplot(myanst,T)

Kindly revert for any queries

Thanks.


Related Solutions

find the solution to the differential equation. d^2y/dt^2 - 7dy/dt=0, y(0)=4, y'(0)=7
find the solution to the differential equation. d^2y/dt^2 - 7dy/dt=0, y(0)=4, y'(0)=7
Solve the following differential equation using Linear operators and the Annihilator approach as needed. y''+2y'+y=x^2-3x
Solve the following differential equation using Linear operators and the Annihilator approach as needed. y''+2y'+y=x^2-3x
Solve the given differential equation by undetermined coefficients (superposition approach) y'' + 2y' − 3y =...
Solve the given differential equation by undetermined coefficients (superposition approach) y'' + 2y' − 3y = (x^2 + x + 1) + e^−3x
Find the general solution of this ODE: d^2y/dt^2+7 dy/dt+10y=5t^2−3t+6 The solution will be of the form:...
Find the general solution of this ODE: d^2y/dt^2+7 dy/dt+10y=5t^2−3t+6 The solution will be of the form: y(t)=Cy1(t)+Dy2(t)+yp(t) so use C and D as the arbitrary constants. y(t)=y(t)=   
Solve the Differential equation y'' - 2y' + y = ex
Solve the Differential equation y'' - 2y' + y = ex
Solve the differential equation: y' + 2y = cos 5x
Solve the differential equation: y' + 2y = cos 5x
2. Find the general solution to the differential equation x^2y''+ y'+y = 0 using the Method...
2. Find the general solution to the differential equation x^2y''+ y'+y = 0 using the Method of Frobenius and power series techniques.
find the general solution for the differential equation (d^2y/dx^2)+16y= 1/cos(4x) +15x-7
find the general solution for the differential equation (d^2y/dx^2)+16y= 1/cos(4x) +15x-7
1. Consider the following second-order differential equation. d^2x/dt^2 + 3 dx/dt + 2x − x^2 =...
1. Consider the following second-order differential equation. d^2x/dt^2 + 3 dx/dt + 2x − x^2 = 0 (a) Convert the equation into a first-order system in terms of x and v, where v = dx/dt. (b) Find all of the equilibrium points of the first-order system. (c) Make an accurate sketch of the direction field of the first-order system. (d) Make an accurate sketch of the phase portrait of the first-order system. (e) Briefly describe the behavior of the first-order...
Solve the differential equation by variation of parameters. 2y'' + y' = 6x
Solve the differential equation by variation of parameters. 2y'' + y' = 6x
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT