Borrar filtros
Borrar filtros

error with function ode45

3 visualizaciones (últimos 30 días)
Cesar Cardenas
Cesar Cardenas el 21 de Feb. de 2023
Comentada: Cesar Cardenas el 21 de Feb. de 2023
Hello,I created this function and file but I'm getting this error:
not sure what I'm doing wrong. Any help will be greatly appreciated.
Error using odearguments
When the first argument to ode45 is a function handle, the tspan argument must have at least two elements.
Error in ode45 (line 107)
odearguments(odeIsFuncHandle,odeTreatAsMFile, solver_name, ode, tspan, y0, options, varargin);
Error in blasius_solution (line 6)
[eta, f] = ode45 (@mufun, 0.5, [0; 0; guess]);
function dfdeta = mufun (eta, f)
dfdeta = [f(2); f(3); -0.5 * f(1) * f(3)];
end
clear all;
close all;
guess = 0.1;
[eta, f] = ode45 (@mufun, 0.5, [0; 0; guess]);
plot(f, eta);

Respuestas (1)

John D'Errico
John D'Errico el 21 de Feb. de 2023
You need to tell the ODEsolver FROM where, TO where will it integrate? So will the integration be, perhaps FROM 0 to 0.5?
All you have passed in is a scalar, the number 0.5. Should it be able to guess?
  1 comentario
Cesar Cardenas
Cesar Cardenas el 21 de Feb. de 2023
finally, I could solve it. thanks

Iniciar sesión para comentar.

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by