Solve the differential equation numerically using matlab
Mostrar comentarios más antiguos
dy/dx=2xy
Respuestas (1)
Torsten
el 31 de Ag. de 2015
fun=@(t,y)2*t*y;
Tspan = [0 2];
y0=1;
[T,Y] = ode45(fun,Tspan,y0);
plot(T,Y(:,1));
Best wishes
Torsten.
7 comentarios
Ahamed Zajith
el 31 de Ag. de 2015
Editada: Ahamed Zajith
el 31 de Ag. de 2015
Walter Roberson
el 31 de Ag. de 2015
That is the beginner version.
Are you asking for the "beginner" version, or are you asking for the homework version in which you need to calculate it without using the ode functions?
Ahamed Zajith
el 31 de Ag. de 2015
Walter Roberson
el 31 de Ag. de 2015
If you have the symbolic toolbox then
dsolve('Dy=2*x*y', 'x')
Ahamed Zajith
el 31 de Ag. de 2015
Torsten
el 31 de Ag. de 2015
... but this is not a numerical solution.
Best wishes
Torsten.
Walter Roberson
el 31 de Ag. de 2015
For some reason what runs through my mind is the classic, "So nail it to a wall then."
Categorías
Más información sobre Mathematics en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!