sarra

270 Reputation

6 Badges

11 years, 128 days

MaplePrimes Activity


These are questions asked by sarra

Dear all;

Special thanks for all the member who help me in Maple.

My last question is:

Write a maple procedure that solves for y(1) in the initial value problem y'(x)=f(y), y(0)=1

using a Numerical stencil based on the n^{th] order taylor series expansion of y.

The procedure arguments include an arbitrary function f, an integrer n, representing the accuracy of the taylor series expansion, and N representing the number of steps between x=0 and x=1.

 

 

 

Dear all,

I need to compute the error, How to define the error between the exact and approximation.

 

                               d              
                              --- y(x) = -y(x)
                               dx             
                               y(x) = exp(-x)

 

I have a problem in this code, my goal is to compute the error between the approximate solution obtained by RK3 and Exact  and E ( approximation by RK3).

How to definie the error and prouve that the error is O(h^4)  ( with one step) and the global error is O(h^3).

Thank you  for helping me.

 

 

 

Dear all,

Please someone gave an idea,

I write in maple this line but  I get an error,

> Butcher, map(x->if (x=0) then `` else x end if,Butcher);
Error, invalid arrow procedure


Dear all

I would like to convert Matlab code to Maple, is there anu idea, this is the code.

 

% Usage: [y t] = abm4(f,a,b,ya,n) or y = abm4(f,a,b,ya,n)
% Adams-Bashforth-Moulton 4-th order predictor-corrector method for initial value problems
% It uses
% Adams-Bashforth 4-step method as a precdictor,
% Adams-Moulton 3-step method as a corrector, and
% Runge-Kutta method of order 4 as a starter
%
% Input:
% f - Matlab inline function f(t,y)
% a,b - interval
% ya - initial condition
% n - number of subintervals (panels)
%
% Output:
% y - computed solution
% t - time steps
%
% Examples:
% [y t]=abm4(@myfunc,0,1,1,10);          here 'myfunc' is a user-defined function in M-file
% y=abm4(inline('sin(y*t)','t','y'),0,1,1,10);
% f=inline('sin(y(1))-cos(y(2))','t','y');
% y=abm4(f,0,1,1,10);

function [y t] = abm4(f,a,b,ya,n)
h = (b - a) / n;
h24 = h / 24;

y(1,:) = ya;
t(1) = a;

m = min(3,n);

for i = 1 : m % start-up phase, using Runge-Kutta of order 4
    t(i+1) = t(i) + h;
    s(i,:) = f(t(i), y(i,:));
    s2 = f(t(i) + h / 2, y(i,:) + s(i,:) * h /2);
    s3 = f(t(i) + h / 2, y(i,:) + s2 * h /2);
    s4 = f(t(i+1), y(i,:) + s3 * h);
    y(i+1,:) = y(i,:) + (s(i,:) + s2+s2 + s3+s3 + s4) * h / 6;
end;

for i = m + 1 : n % main phase
    s(i,:) = f(t(i), y(i,:));
    y(i+1,:) = y(i,:) + (55 * s(i,:) - 59 * s(i-1,:) + 37 * s(i-2,:) - 9 * s(i-3,:)) * h24; % predictor
    t(i+1) = t(i) + h;
    y(i+1,:) = y(i,:) + (9 * f(t(i+1), y(i+1,:)) + 19 * s(i,:) - 5 * s(i-1,:) + s(i-2,:)) * h24; % corrector
end;

Dear all

Is there any one can help me to find  the Maple code to solve ODE : y'(x)=f(x,y(x))  using n-step  Adams-Moulton Methods.

The code exist  with mathematica in this link:

http://mathfaculty.fullerton.edu/mathews/n2003/AdamsBashforthMod.html

there is also the code of this method with Matlab, see please:

 http://www.math.mcgill.ca/gantumur/math579w10/matlab/abm4.m

 

But I want file.mw ( with maple)

Thank you very much for helping me.

 

 

 

 

 

 

First 18 19 20 21 Page 20 of 21