mehdibgh

235 Reputation

6 Badges

7 years, 98 days

MaplePrimes Activity


These are questions asked by mehdibgh

In a for loop how is it possible to see online value of the specific parameter during the loop running?

For example I want to see the online value of the parameter t only not j and k, but it seems maple gives out all parameters.

``

restart

t := 0:

for i to 11 do j := i^2+i; k := j+t; t := j/k end do;

2

 

2

 

1

 

6

 

7

 

6/7

 

12

 

90/7

 

14/15

 

20

 

314/15

 

150/157

 

30

 

4860/157

 

157/162

 

42

 

6961/162

 

6804/6961

 

56

 

396620/6961

 

13922/14165

 

72

 

1033802/14165

 

509940/516901

 

90

 

47031030/516901

 

516901/522567

 

110

 

57999271/522567

 

5225670/5272661

 

132

 

701216922/5272661

 

115998542/116869487

(1)

``

``

``


In Matlab it is easily done by ignoring the end ; at the specified pararmeter computation as

for i=1:11
j= i^2+i;
k = j+t;
t = j/k
end

                             

Download porsesh.mw

How is it possible?

Why I could not unaasign U_hat in my following program?


 

``

restart

II := 1:

qq := 2:

M := 2:

seq(seq(seq(assign(U[i, j, m], h*`#mover(mi("U"),mo("&uminus0;"))`[i, j, m]), i = 0 .. qq), j = 0 .. qq), m = 1 .. 22)

`#mover(mi("U"),mo("&uminus0;"))` := Array(0 .. II, 0 .. JJ, 1 .. M):

Um[1, 1] := Matrix(2, 2, {(1, 1) = 1, (1, 2) = 2, (2, 1) = 3, (2, 2) = 4}); Um[1, 2] := Matrix(2, 2, {(1, 1) = 5, (1, 2) = 6, (2, 1) = 7, (2, 2) = 8})

``

for m to M do `#mover(mi("U"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, m] := ArrayTools:-Alias(Um[1, m], [0 .. II, 0 .. JJ]) end do:

``

for i from 0 to qq do for j from 0 to qq do for m to 22 do `#mover(mi("U"),mo("&uminus0;"))`[i, j, m] := unassign('`#mover(mi("U"),mo("&uminus0;"))`[i, j, m]') end do end do end do

Error, (in unassign/indexed) arguments of type `indexed' must refer to tables or arrays

 

``


 

Download moshkel.mw

I have 2 same integrals, but there is difference between  them at the end.WHy?


 

``

restart

N := 8:

I__1 := add(int(zt*ro[i], zt = Z[i] .. Z[i+1]), i = 1 .. N)

(1/2)*ro[1]*(-Z[1]^2+Z[2]^2)+(1/2)*ro[2]*(-Z[2]^2+Z[3]^2)+(1/2)*ro[3]*(-Z[3]^2+Z[4]^2)+(1/2)*ro[4]*(-Z[4]^2+Z[5]^2)+(1/2)*ro[5]*(-Z[5]^2+Z[6]^2)+(1/2)*ro[6]*(-Z[6]^2+Z[7]^2)+(1/2)*ro[7]*(-Z[7]^2+Z[8]^2)+(1/2)*ro[8]*(-Z[8]^2+Z[9]^2)

(1)

ro := Vector(8, {(1) = 2051.904, (2) = 2051.904, (3) = 2051.904, (4) = 2051.904, (5) = 2051.904, (6) = 2051.904, (7) = 2051.904, (8) = 2051.904})

Z := Vector(9, {(1) = -0.4998720000e-6, (2) = -0.3749040000e-6, (3) = -0.2499360000e-6, (4) = -0.1249680000e-6, (5) = 0, (6) = 0.1249680000e-6, (7) = 0.2499360000e-6, (8) = 0.3749040000e-6, (9) = 0.4998720000e-6})

I__2 := add(int(zt*ro[i], zt = Z[i] .. Z[i+1]), i = 1 .. N)

0.1e-19

(2)

I__1-I__2

-0.1e-19

(3)

``

``

``

``

``

``

``


 

Download Ajib.mw

I have a matrix 50*500000 was computed through a loop. when I double click on it I faced with the following error.

Rtable browser error

unable to display structured data

 

What the problem is?

Why seq command dont arrange sequently?
 

``

Qnon[1] := 5.4763071242*10^(-13)*tau[1](t)-.20506349752*tau[4](t)+7.3355613350*10^(-13)*mu*(diff(tau[4](t), t))-1.5518674346*10^(-12)*mu*(diff(tau[3](t), t))-5.4168963155*10^(-11)*mu*(diff(tau[2](t), t))-8.9983661295*10^(-8)*mu*(diff(tau[1](t), t))+0.38286171190e-3*tau[3](t)-.50952212298*tau[2](t):

Qnon[2] := .50952212392*tau[1](t)-0.10721294912e-3*tau[4](t)+1.8909112516*10^(-10)*mu*(diff(tau[4](t), t))+4.7780699202*10^(-11)*mu*(diff(tau[3](t), t))-8.7982781415*10^(-8)*mu*(diff(tau[2](t), t))-5.4168963155*10^(-11)*mu*(diff(tau[1](t), t))-.92166949920*tau[3](t)-2.1814462038*10^(-9)*tau[2](t):

Qnon[3] := -0.38286183048e-3*tau[1](t)-1.3167782709*tau[4](t)+1.4850896418*10^(-11)*mu*(diff(tau[4](t), t))-8.9970916042*10^(-8)*mu*(diff(tau[3](t), t))+4.7780699202*10^(-11)*mu*(diff(tau[2](t), t))-1.5518674346*10^(-12)*mu*(diff(tau[1](t), t))+6.4450739945*10^(-11)*tau[3](t)+.92166950002*tau[2](t):

Qnon[4] := .20506350370*tau[1](t)+1.5790484882*10^(-8)*tau[4](t)-8.8717209465*10^(-8)*mu*(diff(tau[4](t), t))+1.4850896418*10^(-11)*mu*(diff(tau[3](t), t))+1.8909112516*10^(-10)*mu*(diff(tau[2](t), t))+7.3355613350*10^(-13)*mu*(diff(tau[1](t), t))+1.3167782342*tau[3](t)+0.10721719888e-3*tau[2](t):

EqMR := {seq(Qnon[i], i = 1 .. 4)}[4]

.50952212392*tau[1](t)-0.10721294912e-3*tau[4](t)+0.18909112516e-9*mu*(diff(tau[4](t), t))+0.47780699202e-10*mu*(diff(tau[3](t), t))-0.87982781415e-7*mu*(diff(tau[2](t), t))-0.54168963155e-10*mu*(diff(tau[1](t), t))-.92166949920*tau[3](t)-0.21814462038e-8*tau[2](t)

(1)

``

``

``

``


 

Download seq.mw

5 6 7 8 9 10 11 Last Page 7 of 18