Runge kutta method matlab
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hello,
I am trying to make a runge-kutta code that solves a coupled ode by taking initial values (x0 and y0). Can you please guide me on this
4 comentarios
the cyclist
el 19 de Sept. de 2020
I don't have a solution to your main question, but just wanted to point out that you can do all 20 plots with this one line of code:
figure;
plot(x_rk', y_rk','y', 'MarkerSize',5);
Respuestas (1)
Wan Ji
el 20 de Ag. de 2021
Editada: Wan Ji
el 20 de Ag. de 2021
Use arrayfun to obtain your solutions and Plot them!
x0y0 = [20x2] array?
tspan = [0:dt:t_end];
[tsol, xysol] = arrayfun(@(i) ode45(@odefun, tspan, x0y0(i,:)), 1:20, 'uniform', false);
arrayfun(@(i)plot(xysol{i}(:,1), xysol{i}(:,2),'b'), 1:20);
0 comentarios
Ver también
Categorías
Más información sobre Function Creation 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!