Items tagged with erro erro Tagged Items Feed

Dear all;

Please I need your help to find the error in my code.

I want to solve an ode, with condition on step size.

ode := diff(y(x), x) = 2*x+y(x);

analyticsol := rhs(dsolve({ode, y(0) = 1}));
RKadaptivestepsize := proc (f, a, b, epsilon, N)
local x, y, n, h,k,z,R,p;
h := evalf(b-a)/N; ## we begin with this setpsize
x[0] := a; y[0] := 1; ## Initialisation
for n from 0 to N-1 do  ##loop
x[n+1] := a+(n+1)*h;  ## noeuds
k[1] := f(x[n], y[n]);
k[2] := f(x[n]+h, y[n]+h*k[1]);
k[3] := f(x[n]+h/2, y[n]+h/4*(k[1]+k[2]));
z[n+1] := z[n]+(h/2)*(k[1]+k[2]);## 2-stage runge Kutta.
y[n+1] := y[n]+(h/6)*(k[1]+k[2]+4*k[3]);
R:=abs(y[n+1]-z[n+1]); ## local erreur
if R=<=epsilon    then
   x[n] := x[n+1]+h;


end if
 end do;
[seq([x[n], y[n]], n = 0 .. N)];
[seq([x[n], z[n]], n = 0 .. N)];
end proc:

RKadaptivestepsize((x,y)->2*x-y,0,1, epsilon,20)

Dear all,

Thank you for your Help.

h: stepsize;

x in [0,x0];

I give all the step of my code, but I think there is a mistake. I wait for your Help.

I would like to compute the error between  Method Huen with step size h and step size 2h using the definition of epsilon given below:

 ## The error written epsilon(x0,h)= sqrt(1/(N+1) * sum_i=0^N  (y_i^{2h}-y_(2i)^h)^2 ), where y_i^(2h) is the approximation of y(i*2*h).

 ## We want : loglog epsilon versus h.

  epsilon:=(x0,h)->sqrt( 1/(N+1)*add( (Heun1(f,x0,i)-Heun2(f,x0,i))^2,i=0..N ) );



ic:=y(0)=1;  h:=x0/(2*N);

## Method Heun with step size 2h

> Heun1 := proc (f, x0,)

local x, y, i, h, k;

y := Array(0 .. N);

x := Array(0 .. N);

h := evalf((1/2)*x0/N);

x[0] := 0;

y[0] := 1;

for i from 0 to N do

x[i+1] := (2*i+2)*h;

k[1] := f(x[i], y[i]);

k[2] := f(x[i]+h, y[i]+h*k[1]);

y[i+1] := y[i]+h*((1/2)*k[1]+(1/2)*k[2]);

end do;

[seq([x[i], y[i]], i = 0 .. N)];

end proc;

### Now Heun with step size h  ( the same h)

> Heun2 := proc (f, x0,)

local x, y, i, h, k;

y := Array(0 .. N);

x := Array(0 .. N);

h := evalf((1/2)*x0/N);

x[0] := 0;

y[0] := 1;

for i from 0 to N do

x[i+1] := (i+1)*h;

k[1] := f(x[i], y[i]);

k[2] := f(x[i]+h, y[i]+h*k[1]);

y[i+1] := y[i]+h*((1/2)*k[1]+(1/2)*k[2]);

end do;

[seq([x[2*i], y[2*i]], i = 0 .. N)];

end proc;



Thanks you for your help.




I'm trying to add the output of my function FunctionToTree,which gets all elements from an expression, to a graph using the Graph function but I'm getting erros even when I add it as a list.

local elem;
local Tree:=NULL;
local exprType := convert(whattype(expr),string);
local newExpr:=convert(expr,string);
if (nops(expr) <> 1) or (nops(op(1,expr)) <> 1) then
for elem in op(expr) do :

part of my codes are:
func[1] := (1/2)*(c+s)*x[1]+s*x[3]+(s-c)*x[1]*x[2];
func[2] := (1/2)*(c-s)*x[1]+s*x[3]+(s+c)*x[1]*x[2];
func[3] := -b*x[2]-x[1]^2;
They are just three ODE , how to fix the error?Where is the so-called recursive assignment...?
The program works well when:
"func[1] := x[2] + (x[1]^2 - x[1]*x[3]);
func[2] := - x[1] +  (x[2]^2 + x[1]*x[4]) + x[2]^3;

Hi in trying to solve these coupled differential equations i get a weird error:


> t := diff(X(x), x) = -(1-6*R(x)^(1/2))^(1/2)*x*X(x)/(X(x)*x+R(x))^(1/2), diff(R(x), x) = (1-6*R(x)^(1/2))^(1/2)*x^2*X(x)/(X(x)*x+R(x))^(1/2);
/ (1/2)\
d \1 - 6 R(x) / x X(x)
--- X(x) = - -----------------------------,

Hello every one,

I am gettting this error "unable to store HFloat", while solving a system of ODES numerically.






Hi, I'm trying to do this sum in a loop but it says "Error, too many levels of recursion". May I know how should I write it please? Thanks.

for m from 1 to 5 do
end do:

I'm trying to get Aplus=(1+(1*2))+(2+(2*2)+....+(5+(5*2))


I more than 20000 data points on a an excel file and i want to plot one column against the other. So I imported 10 data points from each column seperately and tried ploting it as a normal plot but it would not work. I kept on getting error messages like 


Error, (in plot) incorrect first argument [Array(1..10, 1..1, {(1, 1) = 0.83333e-2, (2, 1) = 0.166666e-1, (3, 1) = 0.249999e-1, (4, 1) = 0.333332e-1, (5, 1) = 0.416665e-1, (6, 1...
Does anyone know what the beneath error stated after the following coding means, can't find
the solution,
Although looked in mapleprimes site, and thanks for Joe Riel who pointed out the same problem in
2010,2 June...
But, it seems there is still no vivid solution for such problem, how to follow

p[0] := 1:
tr := 4:
T[n]:=(2 pi/omega[n]):

I was warming by Maple that:

Warning, Exception in unload function 'free': Error, (in _free) invalid dictionary ID

What is it? I have no information about this warning.

Why does:

G := Heaviside(x): int(G(x)*G(t-x), x = 0 .. 3);

Produce a "Error, (in unknown) too many levels of recursion"?

question.mwWhen I sloving an exercise in my textbook using maple,I had a difficult.

First,I write the differential equation, deq:=[...];then using command,sys1:=DiffEquation(...);I want to get the system transfer function,so I use command tf:=TransferFunction(sys1),but it returns an error[Error, (in DynamicSystems:-TransferFunction) cannot handle input with frequency variable, s].

Then,since TransferFunction...


I am just now learning how to use Maple and I am having trouble turning Ohm's Law into a function.

Here is what happens when I try to turn Ohm's Law into a function.



       Error, invalid operator paramet name (and then it puts a dotted red line box around everything to the right of the equal sign)


What really irritates me is that I can type

If I assign a list to a variable named depth it causes invalid object errors in for loops for Maple12


for i from 1 to 4 do
end do;

Error, invalid object: mspace(height = "0.0ex",width = "0.0em",[1, 2, 3, 4, 5, 6, 7, 8] = "0.0ex",linebreak = "newline") and  1 additional error.


Page 1 of 1