How to solve a system of second order nonlinear differential equations
22 次查看(过去 30 天)
显示 更早的评论
Hello, I am having troubles solving a system of second order nonlinear equations in MATALB
Here is the equations:
1.01 * (x'') + 0.025 * (θ'') * cos(θ) - 0.025 * (θ')^2 * sin(θ) + 200 * x^3 + 20 * (x') = 0
(x'') * cos(θ) + 2.5 * (θ'') + 9.8 * sin(θ) = 0
1 个评论
Lewis Fer
2021-6-10
移动:Dyuman Joshi
2024-4-4
Hello, I am having troubles solving a system of second order nonlinear equations with boundary conditions using MATALB
Here is the equations:
f''(t)=3*f(t)*g(t) -g(t)+5*t;
g''(t)=-4f(t)*g(t)+f(t)-7*t;
the boundary conditions are: f'(0)=0 et h'(o)=5;
g(0)=3 et h'(2)=h(2)
采纳的回答
Ameer Hamza
2020-11-18
编辑:Ameer Hamza
2020-11-18
If you have the symbolic toolbox, It will make things easier as shown in following code
syms x(t) theta(t)
d1x = diff(x,1);
d2x = diff(x,2);
d1theta = diff(theta,1);
d2theta = diff(theta,2);
eq1 = 1.01*d2x + 0.025*d2theta*cos(theta) - 0.025*d1theta^2*sin(theta) + 200*x^3 + 20*d1x == 0;
eq2 = d2x*cos(theta) + 2.5*d2theta + 9.8 * sin(theta) == 0;
[F, S] = odeToVectorField(eq1, eq2);
odeFun = matlabFunction(F, 'Vars', {t, 'Y'});
[t, y] = ode45(odeFun, [0 10], [1; 0; 0.1; 0]);
plot(t, y);
legend({'$\theta$', '$\dot{\theta}$', '$x$', '$\dot{x}$'}, ...
'FontSize', 16, ...
'Interpreter', 'latex', ...
'Location', 'best');
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!