Maple 2018 Questions and Posts

These are Posts and Questions associated with the product, Maple 2018

Hello,

I am trying the following command:

restart; with(IntegrationTools):
simplify(int(f(x), x = 0 .. L*Ts)-Split(int(f(x), x = 0 .. L*Ts), [i*Ts, i = 0 .. L]))

Clearly the output should be 0. However, maple is not able to output the correct result. Any ideas?

 

Executing the entire worksheet several times I obtain random results for Threads:-Seq

restart;

N:=10^3;
f:= (a,b) -> add(evalf(j), j=a..b);

1000

 

proc (a, b) options operator, arrow; add(evalf(j), j = a .. b) end proc

(1)

seq(f(k*N/4+1,(k+1)*N/4), k=0..3);

31375., 93875., 156375., 218875.

(2)

Threads:-Seq(f(k*N/4+1,(k+1)*N/4), k=0..3);

31218.+j, 93875., 156375., 218875.

(3)

Threads:-Seq(f(k*N/4+1,(k+1)*N/4), k=0..3);

31375., 93875., 156375., 218875.

(4)

Threads:-Seq(f(k*N/4+1,(k+1)*N/4), k=0..3);

31900., 94170., 156375., 218875.

(5)

 


Download threads!.mw

Hi,

I would like to ask you a question on the following program. Where does the error come from?

Thank you for your help in advance.

 

som:=0:

for b1 from 10 to 20 by 1 do
for b2 from 1 to 10 by 0.1 do
for alpha from 0.5 to 0.9 by 0.1 do
for beta from 0.1 to 0.4 by 0.1 do
for c from 1 to 1 by 1 do
for f from 1 to 10 by 1 do
for g from 8 to 470 by 1 do
for lambdai from 0.2 to 0.2 by 0.1 do
for lambdaj from 0.2 to 0.2 by 0.1 do
for gammai from 0.4 to 0.4 by 0.1 do
for gammaj from 0.4 to 0.4 by 0.1 do

aiSQ:=(alpha*b1)/(alpha*b2+beta*b2+c);
ajSQ:=(beta*b1)/(alpha*b2+beta*b2+c);
UiSQ:=(1/2)*alpha*b1^2*(alpha^2*b2+2*alpha*beta*b2+c*alpha+beta^2*b2+2*beta*c)/(alpha*b2+beta*b2+c)^2;
UjSQ:=(1/2)*beta*b1^2*(alpha^2*b2+2*alpha*beta*b2+2*c*alpha+beta^2*b2+beta*c)/(alpha*b2+beta*b2+c)^2;
USQ:=(1/2)*b1^2*(alpha+beta)*(alpha*b2+beta*b2+2*c)/(alpha*b2+beta*b2+c)^2;

ai:=(c*b1*alpha+c*p*f+p*f*beta*b2-alpha*b2*p*f)/(c*(alpha*b2+beta*b2+c));
aj:=(-p*f*beta*b2+alpha*b2*p*f+c*beta*b1+c*p*f)/(c*(alpha*b2+beta*b2+c));
aineg:=(-p*f*lambdai*b2*beta+c*b1-c*b1*lambdai+b2*p*f*lambdaj+b2*alpha*p*f*lambdaj-p*f*lambdai*b2+c*b1*alpha-c*p*f*lambdai)/(c*(b2*alpha-b2*lambdai+b2*beta-b2*lambdaj+c+2*b2));
ajneg:=-(b2*alpha*p*f*lambdaj-p*f*lambdai*b2-p*f*lambdai*b2*beta+b2*p*f*lambdaj+c*p*f*lambdaj-c*b1-c*beta*b1+c*lambdaj*b1)/(c*(b2*alpha-b2*lambdai+b2*beta-b2*lambdaj+c+2*b2));
ui:=alpha*(b1*(aineg+ajneg)-(b2/2)*(aineg+ajneg)^2)-(c/2)*aineg^2-p*f*(aineg-ai);
uj:=beta*(b1*(aineg+ajneg)-(b2/2)*(aineg+ajneg)^2)-(c/2)*ajneg^2-p*f*(ajneg-aj);
u:=(b1*(aineg+ajneg)-(b2/2)*(aineg+ajneg)^2)+p*f*(aineg-ai)+p*f*(ajneg-aj);
eqti:=gammai*(u-tj-USQ)-((1-gammai)/(1-lambdai))*(ui-UiSQ);
eqtj:=gammaj*(u-ti-USQ)-((1-gammaj)/(1-lambdaj))*(uj-UjSQ);
solt:=solve({eqti, eqtj}, {ti, tj});
ti:=subs(solt,ti);
tj:=subs(solt,tj);
dai:=diff(ai,p);
daj:=diff(aj,p);
daineg:=diff(aineg,p);
dajneg:=diff(ajneg,p);
dti:=diff(ti,p);
dtj:=diff(tj,p);
eqp:=(b1-b2*(ai+aj))*(dai+daj)-dti-dtj+f*(aineg-ai)+p*f(daineg-dai)+f*(ajneg-aj)+p*f(dajneg-daj)-g*p=0;
p:=solve(eqp,p);

Uip:=alpha*(b1*(ai+aj)-(b2/2)*(ai+aj)^2)-(c/2)*ai^2-p*f*(aineg-ai)+(1-lambdai)*ti;
Ujp:=beta*(b1*(ai+aj)-(b2/2)*(ai+aj)^2)-(c/2)*aj^2-p*f*(ajneg-aj)+(1-lambdaj)*tj;
Up:=(b1*(ai+aj)-(b2/2)*(ai+aj)^2)+p*f*(aineg-ai)+p*f*(ajneg-aj)-((g^2)/2)*p-ti-tj;

CSQ:=b1-b2*(aiSQ+ajSQ);
Cabat:=b1-b2*(ai+aj);
Cneg:=b1-b2*(aineg+ajneg);

if (CSQ>0 and Cabat>0  and Cneg>0 and beta<alpha and p>0 and p<1)
then
print(b1,b2,alpha,beta,c,f,g,lambdai,lambdaj,`aiSQ=`,aiSQ,`ajSQ=`,ajSQ,`UiSQ=`,UiSQ,`UjSQ=`,UjSQ,`USQ=`,USQ,`ai=`,ai,`aj=`,aj,`aineg=`,aineg,`ajneg=`,ajneg,`ti=`,ti,`tj=`,tj,`p=`,p,`Uip=`,Uip,`Ujp=`,Ujp,`Up=`,Up);
som:=som+1;
fi;
od;od;od;od;od;od;od;od;od;od;od;
som;

10, 1, 0.5, 0.1, 1, 1, 8, 0.2, 0.2, aiSQ=, 3.12500000000000, ajSQ=, 

  0.625000000000000, UiSQ=, 10.3515625000000, UjSQ=, 2.85156250000000, USQ=, 

  30.4687500000000, ai=, 3.14314584993738, aj=, 0.667340316520551, aineg=, 

  4.06068541500626, ajneg=, 2.80826596834794, ti=, 19.2559726892491, tj=, 

  7.44890809994178, p=, 0.0483889331663441, Uip=, 25.8431760998162, Ujp=, 

  8.71735374786572, Up=, 2.73962847065372
Error, (in solve) a constant is invalid as a variable, 7.44890809994178, 19.2559726892491
                                      1

is possible to solve this pde via maple?

m1.mwm1.mw
 

restart

sys := [-(-r^2+1)*(diff(theta(r, z), z))+(diff(theta(r, z), r)+r*(diff(theta(r, z), r, r)))/r+diff(theta(r, z), z, z)+(diff(theta(r, z), r))*(diff(sigma(r, z), r))+(diff(sigma(r, z), z))*(diff(theta(r, z), z))+(diff(theta(r, z), r))^2+(diff(theta(r, z), z))^2 = 0, -(-r^2+1)*(diff(sigma(r, z), z))+(diff(sigma(r, z), r)+r*(diff(sigma(r, z), r, r)))/r+diff(sigma(r, z), z, z)+(diff(theta(r, z), r)+r*(diff(theta(r, z), r, r)))/r+diff(theta(r, z), z, z) = 0]; IBCs := {sigma(1, z) = 1, sigma(r, 0) = 1, theta(1, z) = 1, theta(r, 0) = 1, (D[1](sigma))(0, z) = 0, (D[1](theta))(0, z) = 0, (D[2](sigma))(r, 1) = 0, (D[2](theta))(r, 1) = 0}

[-(-r^2+1)*(diff(theta(r, z), z))+(diff(theta(r, z), r)+r*(diff(diff(theta(r, z), r), r)))/r+diff(diff(theta(r, z), z), z)+(diff(theta(r, z), r))*(diff(sigma(r, z), r))+(diff(sigma(r, z), z))*(diff(theta(r, z), z))+(diff(theta(r, z), r))^2+(diff(theta(r, z), z))^2 = 0, -(-r^2+1)*(diff(sigma(r, z), z))+(diff(sigma(r, z), r)+r*(diff(diff(sigma(r, z), r), r)))/r+diff(diff(sigma(r, z), z), z)+(diff(theta(r, z), r)+r*(diff(diff(theta(r, z), r), r)))/r+diff(diff(theta(r, z), z), z) = 0]

 

{sigma(1, z) = 1, sigma(r, 0) = 1, theta(1, z) = 1, theta(r, 0) = 1, (D[1](sigma))(0, z) = 0, (D[1](theta))(0, z) = 0, (D[2](sigma))(r, 1) = 0, (D[2](theta))(r, 1) = 0}

(1)

NULL


 

Download m1.mw

 

 

This is a Wave PDE inside disk. with fixed edge of disk,  and no theta dependency. initial position and velocity  given.

When using "c^2" for the  wave propagation speed, Maple only gives solution when also using assumptions to tell that c is positive.

restart; 
Physics:-Version()[2]; 
`2018, November 28, 1:35 hours, version in the MapleCloud: 224, version installed in this computer: 224`

And the PDE is 

pde := diff(u(r, t), t$2) = c^2*( diff(u(r,t), r$2)  + (1/r)* diff(u(r,t),r)  ) ; 
ic:=u(r,0)=1, eval( diff(u(r,t),t),t=0)=r/3; 
bc:=u(1,t)=0; 
sol:=pdsolve([pde, ic,bc], u(r, t)) assuming t>0;

sol:=()

Now adding assuming c>0, or "c::positive", or "c>=0", it solves it 

restart;
pde := diff(u(r, t), t$2) = c^2*( diff(u(r,t), r$2)  + (1/r)* diff(u(r,t),r)  ) ; 
ic:=u(r,0)=1, eval( diff(u(r,t),t),t=0)=r/3; 
bc:=u(1,t)=0; 
sol:=pdsolve([pde, ic,bc], u(r, t)) assuming t>0,c>=0;

Any idea why the assumption "c>0"  is needed when the speed is given as "c^2" ? I also tried assumption "c::real", but it still did not solve it.   It seems related to Maple using Laplace transform to solve it.

It seems to me the assumption c>0 should not needed here. But if it is, I'd like to learn why.

Maple 2018.2, windows 10

Update

Thanks to comment below

   " so u(r, 0)=1 (for all r), and u(1, t)=0 (for all t). So what is u(1,0)??? "

I should have added "r>0,r<1".  The reason I did not, is that I copied the code to solve this from Mathematica. In Mathematica, it did not need this assumption to solve it. It seems to depend on the method of solution used by Mathematica vs. Maple to cause this difference.

But now I see it helps to have it there. With the above assumption, now, there is no need to do any assumption on "c" at all and it gives solution. adding c>0 or t>0 or c>=0, makes no change now.

restart;
pde := diff(u(r, t), t$2) = c^2*( diff(u(r,t), r$2)  + (1/r)* diff(u(r,t),r)  ) ; 
ic:=u(r,0)=1, eval( diff(u(r,t),t),t=0)=r/3; 
bc:=u(1,t)=0; 
sol:=pdsolve([pde, ic,bc], u(r, t)) assuming t>0,r>0,r<1;

 

 

Hi

https://www.energymatters.com.au/solar-calculators/solar-battery-calculator.php?utm_source=NewsletterMailingList&utm_medium=email&utm_campaign=EM171101CN

I am trying to find how it calculates how much solar will be exported back to the grid. I thought this could only be estimated  empirically, but apparently not.

Anyway, it depends on three factors, power consumption, power installed, and average hours of sun per day, or hours per day as a function of time of year. For C=4.5kWh/day and S=5kW and H=4 sun hrs per day, means 90% will be exported back to the grid Y. So Y(C,S,H)= a closed form expression.

How to guess the fuction? I tried array interpolation for a numeric solution, but it complains: independent coordinates must be sorted in increasing order

law.mw

I have the following inequality system : 

              [ U1,2 + U1,3 -1 = 0,

U2,3 - U1,2 = 0, 

-U1,3 -U2,3+1 = 0,

0 <=U1,2,

0 <= U1,3,

0 <= U2,3]

I want to solve it using LinearMultivariateSystem, namely I excuted a command : 

Then the following is return : 

Error, (in Utilities:-SimpleAnd) invalid input: a string/name list is expected for sort method `lexorder`

 I tried that

My question is that how do you use LinearMultivariateSystem for varibles indexed by two params.

Thank you.

 

Hiya

from this

>with(combinat):
>A:=choose([CPC__h, SIZE__h,CPC__m, SIZE__m,CPC__l, SIZE__l],2): 

where h denotes high, m=medium, l=low

I want to select CPC and SIZE all the combinations w.r.t h, m and l

[[CPC__h, SIZE__h], [CPC__h, SIZE__l], [CPC__h, SIZE__m], [CPC__l, SIZE__h], [CPC__l, SIZE__l], [CPC__l, SIZE__m], [CPC__m, SIZE__h], [CPC__m, SIZE__l], [CPC__m, SIZE__m]]

>nops(A)-3

9

I want to apply the methodology to 
choose([CPC__h, SIZE__h, SH__h,CPC__m, SIZE__m, SH__m,CPC__l, SIZE__l, SH__l],3)
 

convert(...,Int) in Maple 2018.2 works for fourier, invfourier, laplace, but does not work for invlaplace.  

Why is that? Is there a workaround?

expr:=fourier(f(x), x, w):
convert(expr,Int);

expr:=invfourier(f(w), w, x):
convert(expr,Int);

expr:=laplace(f(s),s,t):
convert(expr,Int)

expr:=invlaplace(f(s),s,t):
convert(expr,Int)

Was expecting to see the Mellin's inverse formula.

Maple 2018.2 on windows 10

 

Hi I am trying to solve the following system of equation. I could solve it for approximate value of s(0)=0.9999 using middefer method of bvp, but as soon as I give the b.c. as s(0)=1, Maple gives me an error that there is an numeric exception. Can someone explain it what is going wrong with s(0)=1? Any sugesstion to solve the equation?
error.mw

b := 1;
r := .1;
l := 3;
a := 10; p := 1.5; ds := 100; dk := 1;

sol3 := dsolve({ds*(diff(i(x), x)) = exp(eta(x)), s(x)^3*i(x)*b*r+(1-s(x))^3*a*l*(diff(s(x), x))/s(x)^1.5 = (1-s(x))^3, diff(eta(x), x) = dk*(i(x)-1)/s(x)^p, i(0) = 0, i(1) = 1, s(0) = 1}, {eta(x), i(x), s(x)}, approxsoln = [eta(x) = .5, i(x) = .5, s(x) = 1], initmesh = 100000, type = numeric, maxmesh = 100000, range = 0 .. 1, output = listprocedure, method = bvp[middefer], abserr = 0.1e-3, adaptive = true);

Error, (in dsolve/numeric/bvp) numeric exception: division by zero


plots[odeplot](sol3, [[x, s(x)]], 0 .. 1, color = ["Green"]);

Thanks and regards,
 

Using Latest Physics updates (I am not sure when this started), pdsolve gives Error, (in PDEtools/eval/2) numeric exception: division by zero on the following problem from a HW from text book.

restart;
PackageTools:-IsPackageInstalled("Physics Updates");
                             "220"


pde:=diff(w(x,t),t)+3*t*diff(w(x,t),x)=w(x,t);
ic:=w(x,0)=f(x);
sol:=pdsolve([pde,ic],w(x,t));

Error, (in PDEtools/eval/2) numeric exception: division by zero
 

Mathematica answer btw is 

pde = D[w[x, t], t] + 3 t D[w[x, t], x] == w[x, t];
ic = w[x, 0] == f[x];
sol = Simplify[DSolve[{pde, ic}, w[x, t], {x, t}]]

 

This is on Maple 2018.2 on windows 10 64 bit.

Any idea what is causing this and any workaround? Do others get the same exception?

 

For some reason the Maple software is not evaluating the last bounds for a triple integral.

But the evalf command works.

I have Maple through the school where I teach math, and the IT-guy gave us Maple 2018.1 to install. 

But after a while even though I have Maple 2018.1 installed on my computer Windows 10 pc, then Maple 2018.1 surgests that I upgrade to 2018.1?? Any idea why? 

  

 

Trying Maple on a textbook problem to verify my hand solution. 

But Maple pdsolve hangs with the mserver.exe tallomg almost 100% CPU and over 10 GB of RAM!

I waited for almost 20 minutes. Tried another time, same thing.

It is no problem if Maple can't solve this, but Maple seems to suffer from too many hangs when it is not able to solve a problem. I've had similar problems with dsolve also.

This is on windows 10, 64 bit with Maple 2018.2 With Physics updates version 218

restart;
PackageTools:-IsPackageInstalled("Physics Updates");

218

interface(showassumed=0);
infolevel[pdsolve]:=2;
pde :=  diff(u(x,t),t)=k*diff(u(x,t),x$2)+Q(x,t);
ic  :=  u(x,0)=f(x);
bc  :=  eval(diff(u(x,t),x),x=0)=A(t),eval(diff(u(x,t),x),x=1)=B(t);
sol:=pdsolve({pde,ic,bc},u(x,t)) assuming t>0,k>0;

then


* trying method "_Fn" for 2nd order PDEs
   -> trying "linear_in_xt"
   -> trying "BC_equal_0"
* trying method "_Cn_cn" for 2nd order PDEs
Trying travelling wave solutions as power series in tanh ...
Trying travelling wave solutions as power series in ln ...
Trying travelling wave solutions as power series in tanh ...
Trying travelling wave solutions as power series in ln ...
* trying method "Wave" for 2nd order PDEs
   -> trying "Cauchy"
   -> trying "SemiInfiniteDomain"
   -> trying "WithSourceTerm"
* trying method "Heat" for 2nd order PDEs
   -> trying "SemiInfiniteDomain"
   -> trying "WithSourceTerm"
* trying method "Series" for 2nd order PDEs
   -> trying "ThreeBCsincos"
   -> trying "FourBC"
   -> trying "ThreeBC"
   -> trying "ThreeBCPeriodic"
   -> trying "WithSourceTerm"
      * trying method "_Fn" for 2nd order PDEs
         -> trying "linear_in_xt"
         -> trying "BC_equal_0"
      * trying method "_Cn_cn" for 2nd order PDEs

And here is hangs. Notice that because both ends are Neumann, there is no unique solution to this problem.  So the solution will contain arbitrary constant. May be this is what made pdsolve hang? 

No it is not. Trying with only one end nonhomogeneous  Neumann, and the other end Dirichlet, it still hangs. The problem seems to be with one end is nonhomogeneous  Neumann, which is a function of time. So this hangs also (same place)

restart;
interface(showassumed=0);
infolevel[pdsolve]:=2;
pde :=  diff(u(x,t),t)=k*diff(u(x,t),x$2)+Q(x,t);
ic  :=  u(x,0)=f(x);
bc  :=  eval(diff(u(x,t),x),x=0)=A(t),eval(diff(u(x,t),x),x=1)=0;
sol:=pdsolve({pde,ic,bc},u(x,t)) assuming t>0,k>0;

And this also

restart;
interface(showassumed=0);
infolevel[pdsolve]:=2;
pde :=  diff(u(x,t),t)=k*diff(u(x,t),x$2)+Q(x,t);
ic  :=  u(x,0)=f(x);
bc  :=  eval(diff(u(x,t),x),x=0)=sin(t),eval(diff(u(x,t),x),x=1)=0;
sol:=pdsolve({pde,ic,bc},u(x,t)) assuming t>0,k>0;

But this does not hang

interface(showassumed=0);
infolevel[pdsolve]:=2;
pde :=  diff(u(x,t),t)=k*diff(u(x,t),x$2)+Q(x,t);
ic  :=  u(x,0)=f(x);
bc  :=  eval(diff(u(x,t),x),x=0)=1,eval(u(x,t),x=1)=0;
sol:=pdsolve({pde,ic,bc},u(x,t)) assuming t>0,k>0;

The issue seems to be when one end is nonhomogeneous  Neumann which is function of time. 

Is there a workaround so it does not hang? The complaint is that Maple hangs, and not that Maple unable to solve the PDE.

 

Why  

eval(diff(u(x,t),x),x=0)=A(t)

gives

But

eval(diff(u(x,t),x),x=L)=A(t)

gives

I was expecting the same syntax in both cases. It seems for numbers Maple uses the first syntax and for symbols it uses the second syntax.

Does one need to worry about this difference?

 

First 11 12 13 14 15 16 17 Last Page 13 of 35