How to solve a system of second order nonlinear differential equations
22 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Yichao Shi
el 18 de Nov. de 2020
Movida: Dyuman Joshi
el 4 de Abr. de 2024
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 comentario
Lewis Fer
el 10 de Jun. de 2021
Movida: Dyuman Joshi
el 4 de Abr. de 2024
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)
Respuesta aceptada
Ameer Hamza
el 18 de Nov. de 2020
Editada: Ameer Hamza
el 18 de Nov. de 2020
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!