samen

25 Reputation

0 Badges

0 years, 282 days

MaplePrimes Activity


These are questions asked by samen

model.mw

after loop how to pick equations automatically solve system of equations??? 

rk2.mw

 


 

restart; with(LinearAlgebra); with(plots)

M := 3:

for i while i <= 3 do t[i] := cos((2*i+1)*evalf(Pi)/(2^k*M)) end do;

-0.2051033808e-9

 

-.8660254038

 

-.8660254034

(1)

``

``

printlevel := 2:

-0.2051033808e-9

 

-1.000000000

 

-.8660254038

 

-2.732050808

 

-.8660254034

 

-2.732050807

 

-0.3076550712e-9*p[1](-0.2051033808e-9)-1/2

 

-1.732050808*p[1](-0.2051033808e-9)

 

-1.299038106*p[1](-.8660254038)-1/2

 

-4.732050809*p[1](-.8660254038)

 

-1.299038105*p[1](-.8660254034)-1/2

 

-4.732050808*p[1](-.8660254034)

 

-0.3418389680e-9*p[2](-0.2051033808e-9)-(2/3)*p[1](-0.2051033808e-9)

 

-2.236067977*p[2](-0.2051033808e-9)

 

-1.443375673*p[2](-.8660254038)-(2/3)*p[1](-.8660254038)

 

-6.109051323*p[2](-.8660254038)

 

-1.443375672*p[2](-.8660254034)-(2/3)*p[1](-.8660254034)

 

-6.109051321*p[2](-.8660254034)

 

-0.3589309164e-9*p[3](-0.2051033808e-9)-(3/4)*p[2](-0.2051033808e-9)

 

-2.645751310*p[3](-0.2051033808e-9)

 

-1.515544457*p[3](-.8660254038)-(3/4)*p[2](-.8660254038)

 

-7.228327004*p[3](-.8660254038)

 

-1.515544456*p[3](-.8660254034)-(3/4)*p[2](-.8660254034)

 

-7.228327002*p[3](-.8660254034)

(2)

y(t) := -1.204*phi[1, 0]+.754*phi[1, 1]+.647*phi[1, 2];

3.289389172-3.567966309*p[1](-.8660254034)-3.952556205*p[2](-.8660254034)

(3)

 

``

plot(y(t))

 plot called with arguments: 3.289389172-3.567966309*p[1](-.8660254034)-3.952556205*p[2](-.8660254034), axiscoordinates = (), coords = (), ispolarplot = false
 #(plot,7): error

Error, (in plot) cannot determine plotting variable

 

 locals defined as: cname = cname

 

``

``


 

Download us3.mw

for small value of k no change show in plot... the resulted value is so small and the system consider it zero and show no change in plot.. then how to get the change in plot to change in k... ??? plz suggest 


 

restart; Digits := 5; with(plots); with(LinearAlgebra)

a := 0:

0.11976e-3*k

(1)

for i from 0 while i <= N do u[i, 0] := h*i+1 end do:

for j from 0 while j <= N+1 do u[0, j] := .1; u[N+1, j] := .5 end do:

printlevel := 2:

NULL

NULL

sys := ([seq])(seq(eq[i, j], j = 0 .. N), i = 1 .. N):

nops(sys);

vars:=indets(sys) minus {k}:

nn := Matrix(N+1, N+1,(i, j)-> u[i-1, j-1]):

##

p:=proc(kk) local u_res,A;

  u_res:=solve(eval(sys,k=kk),vars);

  A:=eval(nn,u_res);

  plots:-matrixplot(A)

end proc;

## Testing p for k=0.001:

p(0.001);

## Animating the plot for k=0.0001..0.001:

plots:-animate(p,[k],k=0.0001..0.001);

 

90

 

proc (kk) local u_res, A; u_res := solve(eval(sys, k = kk), vars); A := eval(nn, u_res); plots:-matrixplot(A) end proc

 

 

 

 

``


 

Download Crank_scheme_4.mw
 

restart; Digits := 5; with(plots); with(LinearAlgebra)

a := 0:

0.11976e-3*k

(1)

for i from 0 while i <= N do u[i, 0] := h*i+1 end do:

for j from 0 while j <= N+1 do u[0, j] := .1; u[N+1, j] := .5 end do:

printlevel := 2:

NULL

NULL

sys := ([seq])(seq(eq[i, j], j = 0 .. N), i = 1 .. N):

nops(sys);

vars:=indets(sys) minus {k}:

nn := Matrix(N+1, N+1,(i, j)-> u[i-1, j-1]):

##

p:=proc(kk) local u_res,A;

  u_res:=solve(eval(sys,k=kk),vars);

  A:=eval(nn,u_res);

  plots:-matrixplot(A)

end proc;

## Testing p for k=0.001:

p(0.001);

## Animating the plot for k=0.0001..0.001:

plots:-animate(p,[k],k=0.0001..0.001);

 

90

 

proc (kk) local u_res, A; u_res := solve(eval(sys, k = kk), vars); A := eval(nn, u_res); plots:-matrixplot(A) end proc

 

 

 

 

``


 

Download Crank_scheme_4.mw

 

1 2 Page 1 of 2