I am learning still and i have no idea how to write 8y''' - y' = cos(20t) + sin(2t) in matlab
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have not seen an example on how to write any equation with y'''. I need to write 8y''' - y' = cos(20t) + sin(2t).
2 comentarios
David Hill
el 21 de En. de 2023
What is the equation being used for? The application of the equation is important.
Respuestas (2)
Steven Lord
el 21 de En. de 2023
How are you trying to solve the ODE? Numerically or symbolically?
If numerically, see the van der Pol example on this documentation page. While that example turns a second order ODE into a system of two first order ODEs, you can generalize that technique to turn a third order ODE into a system of three first order ODEs, a fourth order ODE. Introduce three new variables
,
, and
such that
,
, and
.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1270720/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1270725/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1270730/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1270735/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1270740/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1270745/image.png)
If after trying to adapt the examples on one of those documentation pages you're still having difficulty, show us what you've tried and describe the difficulty you're experiencing and we may be able to offer more specific suggestions.
0 comentarios
David Hill
el 21 de En. de 2023
Editada: Torsten
el 21 de En. de 2023
Your boundary condition was not provided.
[t,y] = ode45(@vdp1,[0 1],[0; 0; 0]);
subplot(3,1,1);
plot(t,y(:,1));
subplot(3,1,2);
plot(t,y(:,2));
subplot(3,1,3);
plot(t,y(:,3));
function dydt = vdp1(t,y)
dydt = [y(2); y(3); (y(2)+cos(20*t)+sin(2*t))/8];
end
0 comentarios
Ver también
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!