# Maple 14 Questions and PostsMaple 14 Questions and Posts Feed

These are Posts and Questions associated with the product, Maple 14

### Error, (in soru) illegal use of a formal parameter...

May 19 2015
1 2

Hello. I have a question. If you can help me, i am pleasure.

Have nice day. :)

restart;
soru := proc(n,x)
local top::0;
for x from 2 to n do
top =top+(((x^(2+i))*top)^(1/(n+2-i)));
print(top);
od;
end proc;

soru(5,1);

Error, (in soru) illegal use of a formal parameter

### Error, reserved word `do` unexpected...

May 19 2015
1 2

Hello. I have a question. If you can help me, i am pleasure.

Have nice day. :)

Question: Enter a number after maple find(understand) to prime number or normal number.

restart;
> asal := proc(n)
> local m;
> if n<2 then
> m := s=n/2+1;
> print(m);
> else
> for i from 2 to n do
> if irem(n,i,0) then
> print("asal değil");
> if i = m then
> print("asaldir");
> end do;
> end if;
> end if;
> end proc;

### do not draw diagrams...

May 08 2015
0 0

Hi

I want to run the following code repeatedly displays but do not draw diagrams.

> dsnumsort := proc (numpr::list, Coor::list)
local i, j, n; global C1, C2, C3, V1, V2, V3;
n := nops(Coor); print("Order of the variables:");
for i from 2 to 2*n+1 do
for j to n do
if [numpr[i]] = select(has, numpr, diff(Coor[j](t), t)) then C[j] := i-1; V[j] := i;
print(Coor[j], C[j], " ", diff(Coor[j](t), t), V[j])
fi;
od;
od;
end:
>dx := diff(x(t), t, t) = -G*Mz*x(t)/(x(t)^2+y(t)^2)^(3/2);
>dy := diff(y(t), t, t) = -G*Mz*y(t)/(x(t)^2+y(t)^2)^(3/2);
>IniC := x(0) = 7*10^6, (D(x))(0) = 1, y(0) = 0, (D(y))(0) = 9*10^3;
>Ns := dsolve({dx, dy, IniC}, {x(t), y(t)}, numeric);
>dsnumsort(Ns(0), [x, y]):
>for i from 0 to 328 do T := 40*i; NsT := Ns(T);
>X[i], Y[i], Vx[i], Vy[i] := (eval([x(t), y(t), diff(x(t), t), diff(y(t), t)], NsT))[]
>od:
>i := 'i'; j := i+1;
>with(plots);
> plot([seq([X[i]-XS[j], Y[i]-YS[j]], i = 0 .. 328)], labels = ['dx', 'dy']);
>plot([seq([Vx[i]-VxS[j], Vy[i]-VyS[j]], i = 0 .. 328)], labels = ['dx', 'dy'])
> R := sqrt(XS[j]^2+YS[j]^2);
>sin := YS[j]/R; cos := X[j]/R;
> GCX := (X[i]-XS[j])*cos-(Y[i]-YS[i])*sin;
> GCY := (X[i]-XS[j])*sin+(Y[i]-YS[i])*cos;
> GCVx := (Vx[i]-VxS[j])*cos-(Vy[i]-VyS[i])*sin;
> GCVy := (Vx[i]-VxS[j])*sin+(Vy[i]-VyS[i])*cos;
> plot([seq([GCX, GCY], i = 0 .. 328)], labels = ['dx', 'dy']);
>plot([seq([GCVx, GCVy], i = 0 .. 327)], labels = ['dVx', 'dVy'])

### do not draw diagrams...

May 08 2015
0 0

Hi,

I want to run this code, but I do not draw diagrams. You can help me?

> dsnumsort := proc (numpr::list, Coor::list)
local i, j, n; global C1, C2, C3, V1, V2, V3;
n := nops(Coor); print("Order of the variables:");
for i from 2 to 2*n+1 do
for j to n do
if [numpr[i]] = select(has, numpr, diff(Coor[j](t), t)) then C[j] := i-1; V[j] := i;
print(Coor[j], C[j], " ", diff(Coor[j](t), t), V[j])
fi;
od;
od;
end:
>dx := diff(x(t), t, t) = -G*Mz*x(t)/(x(t)^2+y(t)^2)^(3/2);
>dy := diff(y(t), t, t) = -G*Mz*y(t)/(x(t)^2+y(t)^2)^(3/2);
>IniC := x(0) = 7*10^6, (D(x))(0) = 1, y(0) = 0, (D(y))(0) = 9*10^3;
>Ns := dsolve({dx, dy, IniC}, {x(t), y(t)}, numeric);
>dsnumsort(Ns(0), [x, y]):
>for i from 0 to 328 do T := 40*i; NsT := Ns(T);
>X[i], Y[i], Vx[i], Vy[i] := (eval([x(t), y(t), diff(x(t), t), diff(y(t), t)], NsT))[]
>od:
>i := 'i'; j := i+1;
>with(plots);
> plot([seq([X[i]-XS[j], Y[i]-YS[j]], i = 0 .. 328)], labels = ['dx', 'dy']);
>plot([seq([Vx[i]-VxS[j], Vy[i]-VyS[j]], i = 0 .. 328)], labels = ['dx', 'dy'])
> R := sqrt(XS[j]^2+YS[j]^2);
>sin := YS[j]/R; cos := X[j]/R;
> GCX := (X[i]-XS[j])*cos-(Y[i]-YS[i])*sin;
> GCY := (X[i]-XS[j])*sin+(Y[i]-YS[i])*cos;
> GCVx := (Vx[i]-VxS[j])*cos-(Vy[i]-VyS[i])*sin;
> GCVy := (Vx[i]-VxS[j])*sin+(Vy[i]-VyS[i])*cos;
> plot([seq([GCX, GCY], i = 0 .. 328)], labels = ['dx', 'dy']);
>plot([seq([GCVx, GCVy], i = 0 .. 327)], labels = ['dVx', 'dVy'])

### do not draw diagrams...

May 08 2015
0 0

Hi,

I want to run this code, but I do not draw diagrams. You can help me?

> dsnumsort := proc (numpr::list, Coor::list)
local i, j, n; global C1, C2, C3, V1, V2, V3;
n := nops(Coor); print("Order of the variables:");
for i from 2 to 2*n+1 do
for j to n do
if [numpr[i]] = select(has, numpr, diff(Coor[j](t), t)) then C[j] := i-1; V[j] := i;
print(Coor[j], C[j], " ", diff(Coor[j](t), t), V[j])
fi;
od;
od;
end:
>dx := diff(x(t), t, t) = -G*Mz*x(t)/(x(t)^2+y(t)^2)^(3/2);
>dy := diff(y(t), t, t) = -G*Mz*y(t)/(x(t)^2+y(t)^2)^(3/2);
>IniC := x(0) = 7*10^6, (D(x))(0) = 1, y(0) = 0, (D(y))(0) = 9*10^3;
>Ns := dsolve({dx, dy, IniC}, {x(t), y(t)}, numeric);
>dsnumsort(Ns(0), [x, y]):
>for i from 0 to 328 do T := 40*i; NsT := Ns(T);
>X[i], Y[i], Vx[i], Vy[i] := (eval([x(t), y(t), diff(x(t), t), diff(y(t), t)], NsT))[]
>od:
>i := 'i'; j := i+1;
>with(plots);
> plot([seq([X[i]-XS[j], Y[i]-YS[j]], i = 0 .. 328)], labels = ['dx', 'dy']);
>plot([seq([Vx[i]-VxS[j], Vy[i]-VyS[j]], i = 0 .. 328)], labels = ['dx', 'dy'])
> R := sqrt(XS[j]^2+YS[j]^2);
>sin := YS[j]/R; cos := X[j]/R;
> GCX := (X[i]-XS[j])*cos-(Y[i]-YS[i])*sin;
> GCY := (X[i]-XS[j])*sin+(Y[i]-YS[i])*cos;
> GCVx := (Vx[i]-VxS[j])*cos-(Vy[i]-VyS[i])*sin;
> GCVy := (Vx[i]-VxS[j])*sin+(Vy[i]-VyS[i])*cos;
> plot([seq([GCX, GCY], i = 0 .. 328)], labels = ['dx', 'dy']);
>plot([seq([GCVx, GCVy], i = 0 .. 327)], labels = ['dVx', 'dVy'])

May 05 2015
0 8

Hi,

> whit*evalf; tx := evalf((t1+t2)*(1/2));
> t1 := 326*40; t2 := 327*40;
> y1, y2 := eval([y1, y2], Ns(t1), Ns(t2));
>while (t1 < tx) and (tx < t2) do:
yx := rhs(Ns(tx)[c2]):
if yx > 0 then
y2 := yx: t2 := tx:
else
y1 := yx: t1 := tx:
fi;
od;
>Tx = evalf(tx);
> Hx := floor((1/3600)*tx):
> Mx := floor((tx-3600*Hx)*(1/60)):
> Sx := tx-3600*Hx-60*Mx:
> Hx, Mx, Sx;
> XS := [seq(X[i], i = 0 .. 328)]: YS := [seq(Y[i], i = 0 .. 328)]:
> VxS := [seq(Vx[i], i = 0 .. 328)]: VyS := [seq(Vy[i], i = 0 .. 328)]:
> save(G,Mz,Xs,VxS,VyS, 'orbit.sav'):

can you help me?

April 11 2015
0 5

hi friends

I encountered a problem and I can not draw the plot of this code

> sol := fsolve({diff(S, x) = 0, diff(S, y) = 0}, {x, y});

> with(VectorCalculus);
> with(linalg);
> s1 := evalf(subs(sol, linalg[grad](S, [x, y])));

> with(VectorCalculus);
> with(LinearAlgebra);
> s2 := evalf(subs(sol, linalg[hessian](S, [x, y]))); pmp0 := [x-subs(sol, x), y-subs(sol, y)]; sapprox := s0+evalm(`&*`(`&*`(transpose(pmp0), s2), pmp0));
> with(Statistics);
>
> with(stats); statevalf[icdf, chisquare[4]](.95);

> with(VectorCalculus);
> with(plottools);
> with(plots);
> with(linalg); ellips := {seq(stats*([statevalf[icdf, chisquare[4]]])(c) = sapprox, c = [.5, .95, .999])};
> plots(ellips(x, y), x = 950 .. 1000, y = 700 .. 750, grid = [50, 50], view = [950 .. 1000, 700 .. 750]);

can you helpe me?Thank you

### Error, invalid input: with expects...

April 07 2015
0 6

hi friends

After this cods i see very error

> restart;

ax := -G*Mz*x/(x^2+y^2)^(3/2);
ay := -G*Mz*y/(x^2+y^2)^(3/2);
i := 'i'; j := i+1;
for k from 0 to 3 do
x := 7*10^6; Vx := 0;
y := 0; Vy := 9000;
dt := evalf(1/2^k);
for i from 0 to 328 do
X[i] := evalf(x); Y[i] := evalf(y);
for n to 40*2^k do
x := evalf((1/2)*ax*dt^2+Vx*dt+x); y := evalf((1/2)*ay*dt^2+Vy*dt+y);
Vx := evalf(ax*dt+Vx); Vy := evalf(ay*dt+Vy)
od;
if i mod 41= 0 then
dX[k, i] := X[i]-XS[j]; dY[k, i] := Y[i]-YS[j]
fi
od;
p[k] := plot([seq([(X[i]-XS[j])*(1/1000), (Y[i]-YS[j])*(1/1000)], i = 0 .. 328)], color = green) end do;
p1 := display({seq(p[k], k = 0 .. 3)}, thickness = 3)
SI := [seq(41*i, i = 0 .. 8)]
p2 := plot({seq([seq([(1/1000)*dX[k, i], (1/1000)*dY[k, i]], k = 0 .. 1), [0, 0]], i = SI)}, color = black)
display({p1, p2}, scaling = constrained, labels = ['dx', 'dy'])
display({p1, p2}, view = [-.1 .. .5, -.4 .. .2], scaling = constrained, labels = ['dx', 'dy'])

Thank you

### invalid input:eval expects...

April 07 2015
0 0

hi friends

After this cods i see very error

> restart;

ax := -G*Mz*x/(x^2+y^2)^(3/2);
ay := -G*Mz*y/(x^2+y^2)^(3/2);
i := 'i'; j := i+1;
for k from 0 to 3 do
x := 7*10^6; Vx := 0;
y := 0; Vy := 9000;
dt := evalf(1/2^k);
for i from 0 to 328 do
X[i] := evalf(x); Y[i] := evalf(y);
for n to 40*2^k do
x := evalf((1/2)*ax*dt^2+Vx*dt+x); y := evalf((1/2)*ay*dt^2+Vy*dt+y);
Vx := evalf(ax*dt+Vx); Vy := evalf(ay*dt+Vy)
od;
if i mod 41= 0 then
dX[k, i] := X[i]-XS[j]; dY[k, i] := Y[i]-YS[j]
fi
od;
p[k] := plot([seq([(X[i]-XS[j])*(1/1000), (Y[i]-YS[j])*(1/1000)], i = 0 .. 328)], color = green) end do;
p1 := display({seq(p[k], k = 0 .. 3)}, thickness = 3)
SI := [seq(41*i, i = 0 .. 8)]
p2 := plot({seq([seq([(1/1000)*dX[k, i], (1/1000)*dY[k, i]], k = 0 .. 1), [0, 0]], i = SI)}, color = black)
display({p1, p2}, scaling = constrained, labels = ['dx', 'dy'])
display({p1, p2}, view = [-.1 .. .5, -.4 .. .2], scaling = constrained, labels = ['dx', 'dy'])

Thank you

### Error, invalid input:...

April 05 2015
0 4

hi friends

i have a problem in maple with an error

dsnumsort:=proc(numpr::list,coor::list)
local i,j,n;
global C1,C2,C3,V1,V2,V3;
n:=nops(coor):
print("Order of the variables:");
for i from 2 to 2*n +1 do
for j from 1 to n do
if[numpr[i]]=
select(has,numpr,diff(coor[j](t),t)) then
C[j]:=i-1;V[j]:=i;
print(coor[j],C[j]," ",diff(coor[j](t),t),V[j]);
fi;
od;
od;
end :

Us:=subs(G=1,m=1,L=1,U):
D2r:=[diff(z(t),t,t),diff(x(t),t,t),diff(y(t),t,t)]:
IniC:=z(0)=0.75,D(z)(0)=0, x(0)=1,D(x)(0)=0,y(0)=0,D(y)(0)=1:

Ns:=dsolve({seq(D2r[i]=g[i],i=1..3),IniC},{z(t),x(t),y(t)},numeric);

dsnumsort(Ns(0),[z,x,y]):

for i from 0 to 1000 do ;
T:=i/25;
NsT:=Ns(T):

X[i]:=rhs(NsT[C1]); Vx[i]:=rhs(NsT[V1]);
Y[i]:=rhs(NsT[C2]); Vy[i]:=rhs(NsT[V2]);
Z[i]:=rhs(NsT[C3]); Vz[i]:=rhs(NsT[V3]);

KepVec[i]:=convert(crossprod([X[i],Y[i], Z[i]],[Vx[i],Vy[i], Vz[i]]),list);
KepAbs[i]:=norm(KepVec[i],2);
od:

but i see this error and I can't draw PLOT:

Error, invalid input: rhs received Ns(0)[C1], which is not valid for its 1st argument, expr

this cods is for draw plot:

spacecurve({[seq([X[i], Y[i], Z[i]], i = 0 .. 1000)], [[-1/2, 0, 0], [1/2, 0, 0]]}, labels = ['x', 'y', 'z']);

spacecurve([seq(KepVec[i], i = 0 .. 1000)], orientation = [0, 90], labels = ['x', 'y', 'z'])

plot([seq([(1/25)*i, KepAbs[i]], i = 0 .. 1000)], labels = ['t', 'MofI'])

can you helpe me?Thank you

### How do I solve this problem?...

April 04 2015
0 9

hi friends

i have a problem in maple with an error

dx := diff(x(t), t, t) = -G*Mz*x(t)/(x(t)^2+y(t)^2)^(3/2):

dy := diff(y(t), t, t) = -G*Mz*y(t)/(x(t)^2+y(t)^2)^(3/2):

G := 6.67*10^(-11); Mz := 6*10^24:
IniC := x(0) = 7*10^6, (D(x))(0) = 0, y(0) = 0, (D(y))(0) = 9*10^3:
Digits := 15:
Ns := dsolve({dx, dy, IniC}, {x(t), y(t)}, numeric):
dsnumsort(Ns(0), [x, y]);

>for i from 0 to 400 do T := 40*i; NsT := Ns(T); X[i] := rhs(NsT[C1]); Vx[i] := rhs(NsT[V1]); Y[i] := rhs(NsT[C2]); Vy[i] := rhs(NsT[V2]); MofI[i] := X[i]*Vy[i]-Y[i]*Vx[i] end do:

> with(plots);
> p1 := polarplot(6378*10^3, phi = 0 .. 2*Pi);
> p2 := plot([seq([X[i], Y[i]], i = 0 .. 327)], thickness = 2);

display({p1, p2}, labels = ['x', 'y'], scaling = constrained);

but i see and I I can't draw PLOT:

Error, invalid input: rhs received [t = HFloat(0.0), x(t) = HFloat(1.0), diff(x(t), t) = HFloat(0.0), y(t) = HFloat(0.0), diff(y(t), t) = HFloat(1.0), z(t) = HFloat(0.75), diff(z(t), t) = HFloat(0.0)][C1], which is not valid for its 1st argument, expr

can you helpe me?

### Solving non-linear ODE...

December 17 2014
2 22

Hi,

I'm trying to solve the following non-linear ODE numerically:

by ececuting

but maple gives me this error-message:

"Error, (in dsolve/numeric/make_proc) Could not convert to an explicit first order system due to 'RootOf'"

I couldnt find any useful information in the manual. What does this error mean? Is there something wrong with my maple code or is there just no solution for this particulare differential equation?

### ODE: Fit parameters to multiple experiments...

December 15 2014
3 6

Hi,

I'm trying to fit some parameters to the data of multiple slightly different experiments.

I've written a function which returns the sums of the error for all experiments.

The function which has to be minimized does the following:

1) Set parameters for the model ODE based on the input parameters

2) calculate the difference (numeric solution of ODE <-> experimentel data)

3) repeat step 1+2 for all experiments

4) return the sum of all differences

The function works as aspected. But when I try to minimize it by calling:

I got an error:

"Error, (in dsolve/numeric/process_parameters) parameter values must evaluate to numeric, got A = A"

For some reason Maple isnt able to set the new parameters of the ODE.

Anyone got an idea how to fix this?

### How we use Gamma function...

October 26 2014
0 0

Hi!

Please find my Maple-worksheet attached below.

How do I solve this problem? I can not drawn it.

I would really appriciate if somebody could help me.

### Isolating Expressions...

October 25 2014
2 7

Hi there,

I'm doing my first steps with Maple and am a little confused with a problem:
I want to solve something like

and expect the result to be z=-m*a. However I get empty brackets as result.
I tried to dig a little and I find that maple has problems isolating x1+x2+x3+x4

Error, (in isolate) x1*a+x2*a+x3*a+x4*a does not contain x1+x2+x3+x4

When I isolate it myself Maple even tells me they wouldn't be the same

false

I even reduced the problem to x1*a+x2*a and Maple still has problems with that. As this is a really simple problem I strongly assume the issue lies with the user. Can anyone help me there?

Thanks

 1 2 3 4 5 6 7 Last Page 1 of 35
﻿