Hummingbird

10 Reputation

One Badge

11 years, 99 days

MaplePrimes Activity


These are replies submitted by Hummingbird

@Carl Love Hey I solved it by defining my phi46N as a global variable right from the beginning! Now it works!

 

 The hint  "escaped local variable" was great! Thank you very much!

@Carl Love

yes these eq[i] were created in that for-loop:

for i from 1 to 6 do
eq[i] := phi4N[i] = phiN[i];
od;#i
                      phi41N = HFloat(0.0)
        phi42N = HFloat(0.08048639625265154)

                                                   5    
           + HFloat(0.004467654374123338) phi46N - -- Pi
                                                   18   
         phi43N = HFloat(0.04274772438032842)

                                                   2   
            - HFloat(0.04666629310570382) phi46N + - Pi
                                                   9   
                      phi44N = HFloat(0.0)
                      phi45N = HFloat(0.0)
            phi46N = HFloat(0.04985752347026316)

               + HFloat(0.04219863826987356) phi46N
sol := solve({seq(eq[i], i= 1..6)}, convert(phi4N, set));
 {phi41N = 0., phi42N = -0.7921782297 + 0.004467654374 phi46N,

   phi43N = 0.7408794252 - 0.04666629311 phi46N, phi44N = 0.,

   phi45N = 0., phi46N = 0.04985752347 + 0.04219863827 phi46N}

 Maybe I didn't get exactly what you meant

@Carl Love 

That makes sense! But

solve({seq(eq[i], i= 1..6)}, convert(phi4N, set));
 {phi41N = 0., phi42N = -0.7921782297 + 0.004467654374 phi46N,

   phi43N = 0.7408794252 - 0.04666629311 phi46N, phi44N = 0.,

   phi45N = 0., phi46N = 0.04985752347 + 0.04219863827 phi46N}
 

and

 solve({seq(eq[i], i= 1..6)}, convert(phi46N, set));

gives me an empty solucion.

by the way:

the variable phi46N in the matrix phiN is there because a function creates a matrix like this

and phi46N is defined al a local variable in this function. Could this be a hint?

@Kitonum 

Thanks for your answer!

s := solve({seq(eq[i], i=1..nops(phiN))}, {op(phi4N)});
 {phi41N = 0., phi42N = -0.7921782297 + 0.004467654374 phi46N,

   phi43N = 0.7408794252 - 0.04666629311 phi46N, phi44N = 0.,

   phi45N = 0., phi46N = 0.04985752347 + 0.04219863827 phi46N}

gives me the same result as above.

@Carl Love 

 

typed in manually:

eq1 := phi41N = 0;
eq2 := phi42N = -(5/18)*Pi+0.80e-1+0.4e-2*phi46N;
eq3 := phi43N = (2/9)*Pi+0.43e-1-0.47e-1*phi46N;
eq4 := phi44N = 0;
eq5 := phi45N = 0;
eq6 := phi46N = 0.50e-1+0.42e-1*phi46N;

sol := solve({eq1,eq2,eq3,eq4,eq5,eq6});
 {phi41N = 0., phi42N = -0.7924558577, phi43N = 0.7386786737,  phi44N = 0., phi45N = 0., phi46N = 0.05219206681}

works fine !

 

with for - structure:

(copying the blue results of Maple into this webpage gives me the strange form like HFloat()...). In Maple it looks likethe equations above which I typed in manually.

 

phi4N := convert(phi4N,list);       # Convert into list to "delete" the brackets which otherwise would occure in the results of the for-structure
phiN := convert(phiN,list);
        [phi41N, phi42N, phi43N, phi44N, phi45N, phi46N]
[                                        
[HFloat(0.0), HFloat(0.08048639625265154)
[                                        

                                           5                     
   + HFloat(0.004467654374123338) phi46N - -- Pi, HFloat(0.04274\
                                           18                    

                                                       2     
  772438032842) - HFloat(0.04666629310570382) phi46N + - Pi,
                                                       9     

  HFloat(0.0), HFloat(0.0),

  HFloat(0.04985752347026316) + HFloat(0.04219863826987356) phi46N

  ]
  ]
  ]


for i from 1 to 6 do
eq[i] := phi4N[i] = phiN[i];
od;#i
                      phi41N = HFloat(0.0)
        phi42N = HFloat(0.08048639625265154)

                                                   5    
           + HFloat(0.004467654374123338) phi46N - -- Pi
                                                   18   
         phi43N = HFloat(0.04274772438032842)

                                                   2   
            - HFloat(0.04666629310570382) phi46N + - Pi
                                                   9   
                      phi44N = HFloat(0.0)
                      phi45N = HFloat(0.0)
            phi46N = HFloat(0.04985752347026316)

               + HFloat(0.04219863826987356) phi46N


sol := solve({eq[6]},{phi46N});
        {phi46N = 0.04985752347 + 0.04219863827 phi46N}

In the last line you can see that it doesn't work neither if I try to solve only the last equation.

sol := solve({eq[1],eq[2],eq[3],eq[4],eq[5],eq[6]},{phi41N,phi42N,phi43N,phi44N,phi45N,phi46N});

 

Actually it's not an empty soluction but this morning after typing and typing once it ocurred.

Thanks for helping me!

 

Page 1 of 1