Skip to content

Minor bug: manual numeric ode schemes #36

Description

@narmko

For instance, it works:

function [tline,yline] = Euler(odefun,tspan,y0,options)
    tline = tspan;
    yline = zeros(length(tspan),length(y0));
    yline(1,:) = y0;
    
    for i=1:length(tspan)-1
        vector = odefun(tline(i),yline(i,:)')';
        yline(i+1,:) = yline(i,:) + vector*(tline(i+1)-tline(i));
    end        
end

However, in the odefun(),
odefun(tline(i),yline(i,:)')';
the need of double transpose is strange since it requires an ode scheme to produce row vectors of states variables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions