Aplicaciones y herramientas informáticas, internet y otros sucedáneos informáticos
por
#320663
Hola a todos. Miren, tengo la siguiente función programada por mi profesor de la universidad:

function [u,t]=euls(u0, t0, T, n, funcs)
% [u,t]=euls(u0, t0, T, n)
% Euler method to solve the system of m ordinary differential equations
% with m unknowns u(1), u(2), ... u(m), and initial values
%
% u'=f(t,u)
% u(t0)=u0
%
% in the interval [t0, T], with a discretization of n subintervals.
%
%
% INPUT:
% u0: initial value of the solution at t0
% t0: initial t
% T: final t
% n: number of subintervals
% funcs: function handler specifiying f(t,u). The funtion must be especified
% with 2 arguments. First argument t. Second argument: a 1 x m vector u.
%
% OUTPUT:
% u: vector of approximations to u in t(i)=t0+ih, i=0, ...,n
% t: points where the approximation is computed
% LOCAL:
% h: subinterval length
% m: number of equations




h=(T-t0)/n;
m=length(u0);
u=zeros(n+1, m); % preallocation of u
t=((0:n)*h + t0)'; % preallocation of t
u(1, :)=u0;

for i=1:n
% Implement the Euler method
u(i+1, :)=u(i,:)+h*funcs(t(i), u(i,:));
end



A continuación debo usarla para resolver un problema de valores iniciales en donde u0=1, t0=0, T=1. Pero en cuanto al sistema de ecuaciones es : u'=v; v'=5v+4u

Así pues mi problema es que no se como invocarla. Ya hice problemas de estos cuando se trataba de una simple EDO, pero no para un sistema entonces no se como invocarla. Seria algo así?

[u,t]=euls(1, 0, 1, 100, .....)

Pero no se que poner en la ultima parte. Alguien me echa una mano? GRACIAS DE ANTEMANO!!!
por
#320680
JÓ--------------------que fuerte-----------
D---------------------------------------------
T---------------------------------------------
Palabras clave
Temas similares

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 0 invitados

Permisos de mensaje

No puede abrir nuevos temas en este Foro
No puede responder a temas en este Foro
No puede editar sus mensajes en este Foro
No puede borrar sus mensajes en este Foro
No puede enviar adjuntos en este Foro