Hello All,
I am trying to use "Integrate" but Maxima when I run my code the terminal
asks me dozens of times if values are zero or non zero. Here is from the
Xmaxima console "Is 1554208430 phi + 1459173 %pi zero or non zero?".
phi is a variable I plot over with values from 0 to 0.0015. x is my
variable of integration. everything else (eigenfunctionsort, hbar1, c1, dp
etc...) has a numerical value.
*for n:1 thru 11 do for j:1 thru 21 do
v[n,j]:1/sqrt(dp)*(sum(eigenfunctionsort[n,j][m+11]*exp(%i*2*%pi*m*x/dp),m,-10,10));
*
*
*
*define(P(a,b),integrate( v[6,1]*exp((-%i)*(10)*phi/(hbar1*c1)*x),x,a,b));*
*plot2d((((1/sqrt(dp))*P(-dp/2,dp/2))^2),[phi,0,0.0015]);*
*
*
Please don't put decorations like that above to demarcate maxima
code. It makes it harder, not easier, to read.
Btw, why don't you do something like
I : integrate(w*exp(c*x),x,a,b);
define(P(a,b), subst([w=..., c=...],I));
>From my viewpoint, it is easier to what is really going on when you
separate the integration from the definition of P.
I am eventually asked if phi is zero or non zero and I am not sure what to
put as it will have a range of values starting at zero. How can I get
maxima to integrate with this variable phi without getting tripped up and
asking if dozens of values containing phi are is zero or non zero?
Best,
Ben
Try,
assume(not(equal(phi,0)));
E.g.
(%i1) assume(not(equal(a,0)));
(%o1) [notequal(a, 0)]
(%i2) is(a=0);
(%o2) false
(%i3) is(a>0);
(%o3) unknown
Leo