MaplePrimes Questions

Hi there!

Essentially, sum(sqrt(-2),x=2..1) is, as it should be, 0. My issue is, that e.g. sum(sqrt(-2),x=2..0) or sum(sqrt(-2),x=2..-1)  are declared by Maple as -I*sqrt(2) and -(2*I)*sqrt(2), which, to my knowledge, is not true, and should be 0 as well. I need those results for a rather complicated algorithm to be 0, otherwise it doesn't work.

NEUZMinus:= proc(Unten, Oben, f,G,Liste,n)::real;
  #Unten:= Untere Intervallgrenze; Oben:= Obere Intervallgrenze; g:= zu integrierende Funktion;
  #G:= Gewicht; n:= Hinzuzufügende Knoten;
 
  Basenwechsel:=proc(Dividend, m);
 
  print(Anfang,Dividend,p[m]);
  Koeffizient:=quo(Dividend, p[m],x);

  Rest:=rem(Dividend, p[m],x);
 
  if m=0 then
    Basenwechsel:=[Koeffizient];
  else

    Basenwechsel:=[Koeffizient,op(Basenwechsel(Rest,m-1))];
   
  end if;
 
  end proc;
p[-1]:=0;
p[0]:=1;
for i from 1 to max(n,numelems(Liste)) do
  p[i]:=x^i-add(int(x^i*p[j]*diff(G,x),x=Unten..Oben)*p[j]/int(p[j]^2*diff(G,x),x=Unten..Oben),j=0..i-1);
  print(p[i]);
c[i-1]:=lcoeff(p[i],x)/lcoeff(p[i-1],x);
d[i-1]:=coeff(p[i],x,(i-1))/coeff(p[i-1],x,(i-1));
if i <> 1 then
  e[i-1]:=coeff(p[i]-(c[i-1]*x+d[i-1])*p[i-1],x,i-2)/coeff(p[i-2],x,i-2);
else
  e[i-1]:=1;
end if;
end do;
print(Liste[1],numelems(Liste));
Hn:=mul(x-Liste[i],i=1..numelems(Liste));
print(Hn);
 Koeffizienten:=Basenwechsel(Hn,numelems(Liste));
print(Koeffizienten);
for j from 0 to numelems(Liste)-1 do
  a[s][j][j]:=1;
end do;
for s from 1 to numelems(Liste)-1 do
  a[s][0]:=[1];
  a[s][1]:=[-e[s]*c[0]/c[s],d[0]-d[s]*c[0]/c[s],c[0]/c[s]];
  for j from 2 to numelems(Liste)-1 do
    print(1);
    a[s][j][abs(s-j)]:=sum(-c[j-1]*e[i+1]*a[s][j-1][i+1]/c[i+1],i=abs(s-j)..min(abs(s-j),s+j-2));
    print(2);
    a[s][j][abs(s-j)+1]:=sum(d[j-1]-c[j-1]*d[i]/c[i])*a[s][j-1][i],i=abs(s-j)+1..min(abs(s-j)+1,s+j-1)+sum(-c[j-1]*e[i+1]*a[s][j-1][i+1]/c[i+1],         i=abs(s-j)+1..min(abs(s-j)+1,s+j-2));
    print(3);
    for i from abs(s-j)+2 to s+j-2 do
      a[s][j][i]:=c[j-1]*a[s][j-1][i-1]/c[i-1]+(d[j-1]-c[j-1]*d[i]/c[i])*a[s][j-1][i]-c[j-1]*e[i+1]*a[s][j-1][i+1]/c[i+1]+e[j-1]*a[s][j-2][i];

      print(4);
    end do;
    a[s][j][s+j-1]:=sum(c[j-1]*a[s][j-1][i-1]/c[i-1],i=max(s-j+2,s+j-1)..s+j-1)+sum((d[j-1]-c[j-1]*d[i]/c[i])*a[s][j-1][i],i=max(s-j+1,s+j-1));
    print(5);
    a[s][j][s+j]:=sum(c[j-1]*a[s][j-1][i-1]/c[i-1],i=max(s-j+2,s+j)..s+j);
    print(6);
  end do;
end do
 

end proc

 

In the case of

a[s][j][abs(s-j)+1]:=sum(d[j-1]-c[j-1]*d[i]/c[i])*a[s][j-1][i],i=abs(s-j)+1..min(abs(s-j)+1,s+j-1)+sum(-c[j-1]*e[i+1]*a[s][j-1][i+1]/c[i+1],         i=abs(s-j)+1..min(abs(s-j)+1,s+j-2));

 
 
for example, the
i=abs(s-j)+1..min(abs(s-j)+1,s+j-2) clause in the end checks, wether the term should be added or not. I basically just need a way to tell Maple wether to add a term or not, depending on wether abs(s-j)+1 is not greater than s+j-2 in this case, without using if-clauses if possible. The problem here is, that min(abs(s-j)+1,s+j-2) can become 0, Maple then tries to calculate something instead of returning 0, and then complains when something inside the term is not properly defined (c[j-1] can become c[-1] for example when j=0) and aborts the entire procedure. How can I tell it to just assign 0?
 
 
 
 
 

I'm having problems with Multiplying Complex Numbers in Maple 2019.

Thanks in Advance.

Example 2: Multiplying Complex Numbers

 

(2-i)(4+3*i)

(3+2*i)(3-2*i)

4*i(-1+5*i)

(3+2*i)^2

2-i(4+3*i)

 

3+2*i(3-2*i)

 

4*i(-1+5*i)

 

(3+2*i)^2

(1.1)

``


 

Download Multiplying_Complex_num.mw

How I can plot the answers obtained from solving two differential equations?

Thanks

SAL.mw
 

restart

e := 0.62e-2

0.62e-2

(1)

r := 0.15e-1

0.15e-1

(2)

DDo2 := .17*3600

612.00

(3)

DDco2 := .12*3600

432.00

(4)

NULL

N := 20

20

(5)

P1o2 := 3600*(1000*(27*10^(-13)*24.45)*100)/(10000*0.986923267e-2)

0.2408029155e-3

(6)

P1co2 := 3600*(1000*(99*10^(-13)*24.45)*100)/(10000*0.986923267e-2)

0.8829440235e-3

(7)

P2o2 := Pi*r^2*DDo2*N/(e+r)

408.1106684

(8)

P2co2 := Pi*r^2*DDco2*N/(e+r)

288.0781188

(9)

diff(y[o2](t), t) = ((P1o2+P2o2)*(21-y[o2](t))-100*(167*y[o2](t)/(1.6+y[o2](t))*.25))*(1/1300)

diff(y[o2](t), t) = 6.592560841-.3139314686*y[o2](t)-3.211538462*y[o2](t)/(1.6+y[o2](t))

(10)

diff(y[co2](t), t) = ((P1co2+P2co2)*(0.4e-1-y*y[co2](t))+.25*(.8*(167*y*y[co2](t)/(1.6+y*y[co2](t))))*100)*(1/1300)

diff(y[co2](t), t) = 0.8863969285e-2-.2215992321*y*y[co2](t)+2.569230769*y*y[co2](t)/(1.6+y*y[co2](t))

(11)

                 initial*conditional     @t=0     yO2=21 , yco2=0.04


 

Download SAL.mw

 

I am writing a question in Mobius that requires students to enter the union and infinity symbols. I am using a Maple graded answer, and I am able to get it to grade infinity properly by typing the word "infinity" in the answer and using Maple syntax with symbolic entry, so that they have access to the infinity symbol in the equation editor. There is a union symbol in the equation editor, but I am not sure how to code the answer to make it accept the union symbol as correct.

Thanks

Dear, could you please help me with the following doubt?

If I have 2 procedures, 

P1:= proc() 

......

end proc;

P2:= proc()

.....

P1();

end proc;

and within P2 I invoke and run P1, do I have to declare P1 as a local/global variable when declaring variables in P2, or it is not necessary? 

Many thanks for your help. 

 

How can I see 8 1/2 x 11" page margins to write a simple letter size report?

Hello everyone,

first, I'd like to mention that I am relatively new to Maple and am therefore thankful for any advice you might have!

I am trying to integrate the term (k_1^2 * r) from a to infinity, see the picture below as well as the attached file. Maple seems to have some issues with that. However, if I break the integral down into more manageable parts it suddenly works! Why is that? How can I get Maple to solve this immeadiately?  I suspect the culprit lies in the term that contains (-Ei(-B*r)*r^(-1)) where Ei is the exponential integral as defined in Maple. The resulting  hypergeometric function seems suspicious.

The problem is that I have to evaluate 21 integrals of this type (k_x*k_y*r) and breaking them down manually becomes pretty cumbersome, especially as the number of terms in the expanded expressions increases. Is there a way to automate this procedure? I guess I would need to extract individual terms and automatically plug them into the integral expression. That should the last resort, however.

The specific problem (everything included for context, weird stuff happens after equation 15):

Maple_Problem.mw

As for the variables: E, t, and R are real positive numbers. a and B are already assumed as real and positive. A_0, C_0, A_2, and C_2 are real numbers (could be negative, I do not know yet since they must be determined later on). a_0 is definitely real, but it may be negative. r is the polar coordinate, so it is also real and positive, but adding this assumption did not yield a better result.

 

Thank you for your help!

 

How to use random variables for different parameters in Maple to find min and max value, like i have R1 min, nom and max value,

I have ratio of R1/R2, temperature coefficient for R1 for min and max value?

I've trying to compose operators in Maple and I've hit a snag. Here's a simplified example:

dx := f -> diff(f, x);
dy := f -> diff(f, y);
eq1 := x * dy
eq2 := y * dx

eq1(eq2)

The output of the final statement is x(y*dx)dx. It took me a while to figure out that Maple is treating it like so:

(x * dy)(y * dx)
(x(y * dx)) * (dy(y * dx))
(x(y * dx)) * (dx)
x(y * dx) * dx

The problem is I don't want it applying anything to x, the expression should reduce to x * dx. Same as if x was replaced by a constant, for example:

(4 * dy)(y * dx) = 4 * dx

In the context of my full code, Maple already knows x is not "appliable" e.g. is(x::appliable) returns false. How do I tell Maple to treat x as not-a-function?

Hello everyone,

How would I do something like this in Maple:

i.e. do the product (or sum) from k=1 to n, skipping the value i. This one has me really scratching my head...

Thanks for your help!


 

``

lambda := .3:

omega := lambda+mu+xi:

alpha := 2*sqrt(lambda*mu)

.9165151390

(1)

``

B[1] := BesselI(k-1, alpha*(u-y))

BesselI(k-1, .9165151390-.9165151390*y)

(2)

B[2] := BesselI(k+1, alpha*(u-y))

BesselI(k+1, .9165151390-.9165151390*y)

(3)

``

F := evalf(Int(sum((B[1]-B[2])*exp(-omega*(u-y)), k = 1 .. infinity), y = 0 .. u))

Int(sum((BesselI(k-1., .9165151390-.9165151390*y)-1.*BesselI(k+1., .9165151390-.9165151390*y))*exp(-1.200000000+1.200000000*y), k = 1 .. infinity), y = 0. .. 1.)

(4)

``

``

``


 

Download int.mw

when i write :

I want answer me   '2'

but it answer on this way:

what i should do for it answer just '2' and ynderstand dont need conjugate 'x and lambda'

Could be helpful to see again those worksheets about programming in Maple.

It was back in 2000-2004 that have seen these workssheets on the Maple website

 I looked at Maple website, but nothing to find anymore for those programming worksheets?

conj := conjugate; d := a*x+b*y-c = 0; z := x+I*y; evalc(z+conj(z)); evalc(z-conj(z)); d := expand((1/2)*a*(z+conj(z))+b*(z-conj(z))/(2*I))-c; is(d = z(a-I*b)+conj(z)*(a+I*b)-2*c); varpi = a+I*b; is(d = z*conj(varpi)+conj(z)*varpi-2*c); How to perform calculations correctly ? Thank you.

Unfortunately, I can't solve the problem in MAPLE that appears in the last line of the picture (0=1 instead of a0=1) unless I write a0 seperately and add the partial sum starting from k=1 to it.

I assume the problem is with 00 in the power series but since MAPLE defines 00:=1 I'm not sure about it. Anyone knows a better solution or can tell me if I made a mistake somewhere?


 

First 430 431 432 433 434 435 436 Last Page 432 of 2308