Borrar filtros
Borrar filtros

How to solve a second order ODE with variable coefficients with an excitation.

2 visualizaciones (últimos 30 días)
Hello, after knowing how to solve an homogeneous 2nd order ODE i was wondering how to solve the same problem just adding and armonic excitation. I would also like to have it solved using the symbolic math toolbox. The problem will be like the following:
y'' + sen(10*t)y' + 5y = p(t)
p(t) = sen( 0.5*t + 2*t^2)
y(0)= 0
y'(0)= 1
  2 comentarios
Enterprixe
Enterprixe el 1 de Mzo. de 2017
Editada: Enterprixe el 1 de Mzo. de 2017
i try this
syms t y(t) Y
D1y = diff(y,t);
D2y = diff(y,t,2);
Eqn = D2y + [-0.11674*(1-exp(-10*t)) + 0.5351*(1-cos(10*t))]*D1y + 3.2137*y == 0.2029*sin((0.89634+0.8102476*t)*t);
yode = odeToVectorField(Eqn);
Yodefcn = matlabFunction(yode, 'Vars',[t Y]);
% Yodefcn = @(t,Y) [Y(2);-exp(t.*-1.0e1)-sin(t.*1.0e1).*Y(2)-Y(1)];
tspan = [0:0.0254:50];
Y0 = [0 1.8989];
[T,Y] = ode45(Yodefcn, tspan, Y0);
plot(T, Y(:,1))
ylabel('coordenada 1')
xlabel('tiempo')
grid
but the problem is that the solution is almost equal to the homogeneous one( without the sin at the right side of the equation) and that makes me doubt im making things right. Also it would be nice how to program the excitation to a p(t) which after solving the equations gives me the values of it for each time.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by