## Problems combining simple integrals...

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?

## Random results using Threads...

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);
 (1)
 > seq(f(k*N/4+1,(k+1)*N/4), k=0..3);
 (2)
 (3)
 (4)
 (5)
 >

## Error, (in solve) a constant is invalid as a varia...

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?...

is possible to solve this pde via maple?

 >
 >
 (1)
 >

## why pdsolve only solves this wave PDE when telling...

This is a Wave PDE inside disk. with ﬁxed 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;
```

## Pls help me find the law...

Hi

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

## Solve inequality system whose variable is indexed ...

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.

## Select elements of list wrt criteria...

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)

## why convert(..,Int) does not work for invlaplace?...

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

## Error, (in dsolve/numeric/bvp) numeric exception: ...

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,

## pdsolve gives PDEtools/eval/2) numeric exception:...

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;
"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?

## Why is this triple integral not evaluating....

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

But the evalf command works.

## Why does Maple 2018.1 want me to upgrade to Maple ...

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?

## Maple hangs in pdsolve on a standard PDE...

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;
```

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.

## on the syntax of eval(diff(u(x,t),x=0)..... ...

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.

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