Peter_Parker

48 Reputation

6 Badges

14 years, 217 days

MaplePrimes Activity


These are questions asked by Peter_Parker

I use a simple for loop below to illustrate. For each loop through the index value I want to add the result of that loop to a list h. This is how I tried to do it but I can't quite get it because the value in h1 gets updated for each step through the for loop.

 

for i from 1 to 10 do

u[i]:=2*i;

h:=[]; h1:=[u[i],op(h)]

end do;

So after the for loop is terminated I want to be left with a list h:= ...

 

> Hello Guys,

 

Please help me with this problem.

 

 

 

I generate the solutions to an equation and then I place them in a list as for example

 

> t1 := [((-4*Pi^2-beta^2+4*beta^2*Q^2*Pi^2+8*I*Pi^2*beta*Q)/(4*Pi^2+beta^2-4*beta^2*Q*Pi+4*beta^2*Q^2*Pi^2))^(1/2), -((-4*Pi^2-beta^2+4*beta^2*Q^2*Pi^2+8*I*Pi^2*beta*Q...

I use a for loop to step through the operands of an expression and do a calculation on each operand. I am then unable to add up or otherwise access for manipulation the result of the for loop and wondered how this could be done. What I mean is as follows. I have the expression w

w := 2*(1/2/Pi+Q*cos(k*phi))*Q*cos(k*phi)*(exp(-1/2*sigma^2*k^2)-1)*t*(1/2/Pi+Q*cos(k*psi))/(beta^2*(1+beta^2*(1/2/Pi+Q*cos(k*phi))^2))+(1/2/Pi+Q*cos(k*phi))^2*Q*cos(k*psi)*(exp(-1/2*sigma^2*k^2...

When I solve a certain equation I get a list of solutions t as below. I want to select some of the solutions and assign them to variables. In the program I am writing the number of items in the list of solutions will vary and so I cannot really select the list item by using t[3].t[4] etc. for example. 

I want to be able to select only the list items with say a square root sign or another term such as Pi, beta etc that appears in the list of solutions. So...

If I extract the denominator of the following expression

 

> s:=(1/2/Pi+Q*(1-u^2)/(1+u^2))^2/((1+beta^2*(1/2/Pi+Q*(1-u^2)/(1+u^2))^2)*(1+u^2));

maple expands it automatically

s2:=denom(s);

but the result of solving the expanded denominator

solve(s2=0,u);

 

is different to the result of solving the non-expanded expression

3 4 5 6 7 Page 5 of 7