bfathi

10 Reputation

2 Badges

9 years, 203 days

MaplePrimes Activity


These are replies submitted by bfathi

@acer You can help me? Please

@acer 

This is a university project. The project is for book "Solving Problems in Scientific Computing Using Maple and MATLAB"

Below is my code file to continue.but have many error . Please help me.

Thank you very much.

maple.txt

 

@tomleslie 

yes, Now I will send for you my Worksheet:

maybe you can help me

I wrote the code but i see very  errors

Thank you.

maple11_MAS94.mw

@brian bovril 

yes. But i don't what do I?

@Mac Dude This code is for orbit.sav

Ns := dsolve({dx, dy, IniC}, {x(t), y(t)}, numeric):

tx := evalf((t1+t2)*(1/2)):
t1 := 326*40: t2 := 327*40:
y1 := rhs(Ns(t1)[c1]): y1 := rhs(Ns(t2)[c2]):
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;
 

But after this code i see this error:

Error, invalid input: rhs received Ns(13040)[c1], which is not valid for its 1st argument, expr
Error, invalid input: rhs received Ns(13080)[c2], which is not valid for its 1st argument, expr

@Mac Dude  I've changed the code below

> restart; read "orbit.sav ": with(plots):
> ax := -G*Mz*x/(x^2+y^2)^(3/2): ay := -G*Mz*y/(x^2+y^2)^(3/2): 
j:=ix -> ix + 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) end do:

if `mod`(i, 41) = 0 then

dX[k, i] := X[i]-XS[j]; dY[k, i] := Y[i]-YS[j] end if end do;

p[k] := plot([seq([(X[i]-XS[j])*(1/1000), (Y[i]-YS[j])*(1/1000)], i = 0 .. 328)], color = green) end do;

> C1 := display({seq(p[k], k = 0 .. 3)}, thickness = 3):

SI := [seq(41*i, i = 0 .. 8)]:

C2 := plot({seq([seq([(1/1000)*dX[k, i], (1/1000)*dY[k, i]], k = 0 .. 1), [0, 0]], i = SI)}, color = black):

display({C1, C2}, scaling = constrained, labels = ['dx', 'dy']);

display({C1, C2}, view = [-.1 .. .5, -.4 .. .2], scaling = constrained, labels = ['dx', 'dy']);

But i see this errors:

1)display({display({p[0], p[1], p[2], p[3]}, thickness = 3),

INTERFACE_PLOT(CURVES([[0., 0.]]), CURVES([[0., 0.]]),

CURVES([[0., 0.]]), CURVES([[0., 0.]]), CURVES([[0., 0.]]),

CURVES([[0., 0.]]), CURVES([[0., 0.]]), CURVES([[0., 0.]]),

CURVES([[0., 0.]]), COLOUR(RGB, 0., 0., 0.),

AXESLABELS("", ""), VIEW(DEFAULT, DEFAULT))},

scaling = constrained, labels = [dx, dy])

2)display({display({p[0], p[1], p[2], p[3]}, thickness = 3),

INTERFACE_PLOT(CURVES([[0., 0.]]), CURVES([[0., 0.]]),

CURVES([[0., 0.]]), CURVES([[0., 0.]]), CURVES([[0., 0.]]),

CURVES([[0., 0.]]), CURVES([[0., 0.]]), CURVES([[0., 0.]]),

CURVES([[0., 0.]]), COLOUR(RGB, 0., 0., 0.),

AXESLABELS("", ""), VIEW(DEFAULT, DEFAULT))},

view = [-0.1 .. 0.5, -0.4 .. 0.2], scaling = constrained,

labels = [dx, dy])

 

  

@Carl Love 

Excuse me

you can help me About this my The problem?

Thank you

@Preben Alsholm picuter1.jpg is the result we want and show in book 

but pictuer2.png is the plot that we see with your algurithm 

this code is in maple 14 

@Preben Alsholm OK. Unfortunately your  algorithm did not draw my plots.

@Rouben Rostamian  

This algorithm is Before this codes:

> restart;
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 :

@Preben Alsholm This algorithm is Before this codes:

> restart;
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 :

@Carl Love Can you help me please?

 

@Carl Love hi friend

i have another error in solving problem in that section .... as you can see in picture i attach ... in "Ns proc" my answer is inverses from book .... after this in reading "dsnumsort" proc that variables are moved to the book  ... can you help me in this problem ?

 

 

@Carl Love thanks alot for your time and support :)

1 2 Page 1 of 2