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

1 次查看(过去 30 天)
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 个评论
Enterprixe
Enterprixe 2017-3-1
编辑:Enterprixe 2017-3-1
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by