## How do I solve a system of PDE in different interv...

I would like to solve this system of PDEs along the x-interval [0,1] in three different subintervals: from 0 to 0.35, from 0.35 to 0.6, and from 0.6 to 1. I tried to solve the system by setting these same subintervals as you might see in my script, however it is now what I need. Any help would be very appreciated.

restart;
d1 := 0.05;
d2 := 0.3;
AA := 0.2;
BB := 0.1;
PDE1 := diff(u(x, t), t) = d1*diff(u(x, t), x, x) + w(x, t)*exp(AA*u(x, t) - BB*v(x, t));
PDE2 := diff(v(x, t), t) = d2*diff(v(x, t), x, x) - w(x, t)*exp(AA*u(x, t) - BB*v(x, t));
PDE3 := 0.0001*diff(w(x, t), t) = diff(w(x, t), x) - 0.8*x + 3.3;
IBC1 := u(0, t) = 1, u(1, t) = 0, u(x, 0) = piecewise(x < 0.35, -(4*x)*x + 1, 0.35 < x and x < 0.65, 1.32958 - 1.29167*x, 0.65 < x, 4*(x - 1)^2);
IBC2 := v(0, t) = 0, v(1, t) = 1, v(x, 0) = piecewise(x < 0.35, (4*x)*x + 1, 0.35 < x and x < 0.65, 1.32958 - 1.29167*x, 0.65 < x, -4*(x - 1)^2);
IBC3 := w(0, t) = 0.5, w(x, 0) = 1 - (0.3*x)*x;
pds := pdsolve([PDE1, PDE2, PDE3], [IBC1, IBC2, IBC3], numeric, time = t, range = 0 .. 1);
p1 := pds:-plot(t = 0, numpoints = 50);
p2 := pds:-plot(t = 1/8, numpoints = 50, color = blue);
p3 := pds:-plot(t = 1/4, numpoints = 50, color = green);

## Combinations of RootOf?...

[I split this off from here into a separate question. dharr]

@dharr Thanks. For the second one, an output is . Is it possible to compel Maple to attempt to simplify the second algebraic number to a less complicated expression automatically?
Its minimal polynomial can be computed. However, this is not so convenient for the specific purpose. Actually, I want something like this:

evalA(-4*RootOf(_Z^3 - 3*_Z^2 - 10*_Z - 1)^2 + 19*RootOf(_Z^3 - 3*_Z^2 - 10*_Z - 1) + 3);
=
/  3        2           \
5 RootOf\_Z  + 10 _Z  + 3 _Z - 1/



Mathematica has an additional function RootReduce to do so directly, but I cannot find such functionality in Maple.

Remark. A fairly complicated one:

evalA(-45658*RootOf(37*_Z^6 - 382*_Z^5 + 1388*_Z^4 - 2188*_Z^3 + 1475*_Z^2 - 406*_Z + 37, index = 6)^5 + 417257*RootOf(37*_Z^6 - 382*_Z^5 + 1388*_Z^4 - 2188*_Z^3 + 1475*_Z^2 - 406*_Z + 37, index = 6)^4 - 1252087*RootOf(37*_Z^6 - 382*_Z^5 + 1388*_Z^4 - 2188*_Z^3 + 1475*_Z^2 - 406*_Z + 37, index = 6)^3 + 1463384*RootOf(37*_Z^6 - 382*_Z^5 + 1388*_Z^4 - 2188*_Z^3 + 1475*_Z^2 - 406*_Z + 37, index = 6)^2 - 558475*RootOf(37*_Z^6 - 382*_Z^5 + 1388*_Z^4 - 2188*_Z^3 + 1475*_Z^2 - 406*_Z + 37, index = 6) + 69230);
=
/
17991 RootOf\

6         5          4          3          2
37 _Z  - 406 _Z  + 1475 _Z  - 2188 _Z  + 1388 _Z  - 382 _Z + 37,

\
index = 4/



## Convert table to matrix in a particular form...

Convert a table in a form

output≔table([(2,4)=["O-H",0.97234632],(1,2)=["O-O",1.44940000],(1,3)=["O-H",0.97232285]])

Table can have more elements in a similar form at (1,2) and (2,1) position

In the new matrix converted

We should get a square matrix

With at (2,4) and (4,2) position

0.97234632

Similarly at (1,2) and (2,1) position 1.44940000

And so on

Remember a square matrix and it is symmetric

## Why no warning is returned with 2D input?...

(Deleted because not reproducible on a different PC)

With 1D

 > int(1/(sqrt(x__0 - x)*sqrt(-x^2 + 1)), x = 0 .. x__0)
 (1)
 >

With 2D

 (1)

The root cause might be the same as for this open question.

int_warning_2D.mw

int_warning_1D.mw

## zoom Plot output image size in prior in code...

Fix a plot output image size to a certain big size instead of going to each plot and then trying to maginify it where output runs through pages.

## How to insert pagebreak using code as i a run prog...

How to insert pagebreak using code itself where I want as i run code

As if I get more lines of output difficut to run through output give ctrl+Enter each place later

Kind help

## Find index of list within a list based on conditio...

Considered a list of this type

L:=[["O",3.85090000,0.45160000,0.00120000],
["O",−2.59990000,1.40410000,−0.00180000],
["N",−1.57050000,−0.71710000,0.00010000],
["C",−0.20660000,−0.42310000,−0.00020000],
["C",0.22050000,0.90470000,0.00040000],
["C",0.72980000,−1.45700000,−0.00070000],
["C",1.58410000,1.19860000,0.00020000],
["C",2.09330000,−1.16290000,−0.00070000],
["C",2.52040000,0.16480000,−0.00030000],
["C",−2.64850000,0.17820000,0.00090000],
["C",−3.97350000,−0.54200000,0.00100000],
["H",−0.44360000,1.75770000,0.00120000],
["H",0.41130000,−2.49630000,−0.00100000],
["H",−1.80100000,−1.70860000,0.00010000],
["H",1.90530000,2.23700000,0.00090000],
["H",2.81800000,−1.97260000,−0.00080000],
["H",−4.06550000,−1.14630000,−0.90580000],
["H",−4.79040000,0.18440000,0.02880000],
["H",−4.04450000,−1.18860000,0.88020000],
["H",3.96500000,1.41760000,0.00170000]];

Find out the indexs of the list within the list where "H" is their and to store is set S.

Here we can say 12th list have "H"

Similarly 13th list has "H" and so on

So it will output a set

{11,12,13,...}

A function which takes a list like above as input and outputs the set which give index positions of lists containing "H"

## Make the molecule hydrogen explicit using code...

Is their anyway in by which given a molecule I can code to get the hydrogen depleted form of the molecule using Maplesoft quantum chemistry toolbox

After hydrogen depleted get the BondDistances table of that depleted molecule structure

## sign of roots of polynomial function...

Dear all

I have a third order equations, I would like to know the sign of its roots, not necessary to find the roots since the equations contains some parameters. All parameters used are positives.

roots.mw

thank you

## How do i create point structures in maple?...

Here is the full code with output and errors.

restart; with(plots): with(plottools):
w:=-Ps/2*(Hk*cos(theta)^2+2*H*cos(theta-psi));
1    /             2                        \
w := - - Ps \Hk cos(theta)  + 2 H cos(-theta + psi)/
2

dw:=diff(w,theta);
1
dw := - - Ps (-2 Hk cos(theta) sin(theta) + 2 H sin(-theta + psi))
2

equ:=dw=0;
1
equ := - - Ps (-2 Hk cos(theta) sin(theta)
2

+ 2 H sin(-theta + psi)) = 0

Hg:=(sin(psi)^(2/3)+cos(psi)^(2/3))^(-3/2);
1
Hg := ------------------------------------
(3/2)
/        (2/3)           (2/3)\
\sin(psi)      + cos(psi)     /

psi:=35.0*Pi/180;H:=0.1;Ps:=1.0;Hk:=1.0;
psi := 0.6108652383

H := 0.1

Ps := 1.0

Hk := 1.0

Hc:=evalf(Hk*Hg); theta:='theta';
Hc := 0.5103773339

theta := theta

theta_s:=evalf(Pi-arctan(tan(psi)^1/3));
theta_s := 2.912295114

H:='H';np:=100;H_max:=1.0;
H := H

np := 100

H_max := 1.0

h_p:=array(1..np):
h_n:=array(1..np):
m_p:=array(1..np):
m_n:=array(1..np):
h_p[1]:=0.0;m_p[1]:=cos(psi);
h_p[1] := 0.

m_p[1] := 0.8191520442

for i from 2 to np do
h_p[i]:=(i-1)*H_max/(np-1):
H:=h_p[i]:
theta_plus:=fsolve(equ,theta,0..Pi/2):
m_p[i]:=evalf(cos(theta_plus-psi)):
end do:

h_n[1]:=0.0; m_n[1]:=evalf(cos(Pi-psi));
h_n[1] := 0.

m_n[1] := -0.8191520446

for i from 2 to np-1 do
h_n[i]:=(i-1)*Hc/(np-1):
H:=h_n[i]:
theta_minus:=fsolve(equ,theta,theta_s..Pi);
m_n[i]:=evalf(cos(theta_minus-psi)):
end do:

h_n[np]:=Hc; m_n[np]:=evalf(cos(theta_minus-psi));
h_n[100] := 0.5103773339

m_n[100] := cos(fsolve(1.000000000 cos(theta) sin(theta)

+ 0.5052220075 sin(theta - 0.6108652383) = 0, theta,

2.912295114 .. Pi) - 0.6108652383)

pl_pp:=array(1..np):
pl_pn:=array(1..np):
pl_np:=array(1..np):
pl_nn:=array(1..np):
i:='i';
i := i

NULL;

NULL;
NULL;
NULL;
for i from 1 to np do
pl_pp[i]:=point([h_p[i],m_p[i]],color=red):
pl_np[i]:=point([h_n[i],m_n[i]],color=blue):
pl_pn[i]:=point([-h_n[i],-m_n[i]],color=red):
pl_nn[i]:=point([-h_p[i],-m_p[i]],color=blue):
end do:
Error, (in plottools:-point) incorrect arguments for creating points structure, try providing the dimension option

display([seq(pl_pp[i],i=1..np),seq(pl_np[i],i=1..np),seq(pl_pn[i],i=1..np),seq(pl_nn[i],i=1..np)]);

Error, (in plots:-display) expecting plot structures but received: [pl_pp[60], pl_pp[61], pl_pp[62], pl_pp[63], pl_pp[64], pl_pp[65], pl_pp[66], pl_pp[67], pl_pp[68], pl_pp[69], pl_pp[70], pl_pp[71], pl_pp[72], pl_pp[73], pl_pp[74], pl_pp[75], pl_pp[76], pl_pp[77], pl_pp[78], pl_pp[79], pl_pp[80], pl_pp[81], pl_pp[82], pl_pp[83], pl_pp[84], pl_pp[85], pl_pp[86], pl_pp[87], pl_pp[88], pl_pp[89], pl_pp[90], pl_pp[91], pl_pp[92], pl_pp[93], pl_pp[94], pl_pp[95], pl_pp[96], pl_pp[97], pl_pp[98], pl_pp[99], pl_pp[100], pl_np[59], pl_np[60], pl_np[61], pl_np[62], pl_np[63], pl_np[64], pl_np[65], pl_np[66], pl_np[67], pl_np[68], pl_np[69], pl_np[70], pl_np[71], pl_np[72], pl_np[73], pl_np[74], pl_np[75], pl_np[76], pl_np[77], pl_np[78], pl_np[79], pl_np[80], pl_np[81], pl_np[82], pl_np[83], pl_np[84], pl_np[85], pl_np[86], pl_np[87], pl_np[88], pl_np[89], pl_np[90], pl_np[91], pl_np[92], pl_np[93], pl_np[94], pl_np[95], pl_np[96], pl_np[97], pl_np[98], pl_np[99], pl_np[100], pl_pn[59], pl_pn[60], pl_pn[61], pl_pn[62], pl_pn[63], pl_pn[64], pl_pn[65], pl_pn[66], pl_pn[67], pl_pn[68], pl_pn[69], pl_pn[70], pl_pn[71], pl_pn[72], pl_pn[73], pl_pn[74], pl_pn[75], pl_pn[76], pl_pn[77], pl_pn[78], pl_pn[79], pl_pn[80], pl_pn[81], pl_pn[82], pl_pn[83], pl_pn[84], pl_pn[85], pl_pn[86], pl_pn[87], pl_pn[88], pl_pn[89], pl_pn[90], pl_pn[91], pl_pn[92], pl_pn[93], pl_pn[94], pl_pn[95], pl_pn[96], pl_pn[97], pl_pn[98], pl_pn[99], pl_pn[100], pl_nn[59], pl_nn[60], pl_nn[61], pl_nn[62], pl_nn[63], pl_nn[64], pl_nn[65], pl_nn[66], pl_nn[67], pl_nn[68], pl_nn[69], pl_nn[70], pl_nn[71], pl_nn[72], pl_nn[73], pl_nn[74], pl_nn[75], pl_nn[76], pl_nn[77], pl_nn[78], pl_nn[79], pl_nn[80], pl_nn[81], pl_nn[82], pl_nn[83], pl_nn[84], pl_nn[85], pl_nn[86], pl_nn[87], pl_nn[88], pl_nn[89], pl_nn[90], pl_nn[91], pl_nn[92], pl_nn[93], pl_nn[94], pl_nn[95], pl_nn[96], pl_nn[97], pl_nn[98], pl_nn[99], pl_nn[100]]

NULL;

NULL;

## issue with PlotMolecule...

I just purchased the quantum chemistry package

The plotmolecule is not giving the correct structure of the attached xyz file can you please confirm and help

I am attaching

A.xyz    as     A.txt
Please rename it .xyz as maple is not allowing to attach a xyz file.

XYZ  file :       A.txt     Rename as xyz

Image file of the molecule which is expected:

Image coming from maple code:

It can be observed that the bond between yellow (Sulfur ) and carbon missing

Code given below I typed

restart;
with(QuantumChemistry);
print(PlotMolecule(molecule));

## Using Assumptions & Missed Solutions in calling so...

The help page solve/details claims that solve(x^2-1,{x}, useassumptions) assuming x>0; is equivalent to solve({x^2-1, x>0},{x});. But the following example perplexes me again.

Considering a multi-variable polynomial:

expr := 36*a^3*b^3+8*a^2*b^2*(9*(a+b+1)^2+4*(a*b+a+b))*(a+b+1)+((a-b)^2-2*(a+b)+1)^2*(a+b+1)^5+a*b*((a-b)^2-2*(a+b)+1)*(17*(a+b+1)^2+4*(a*b+a+b))*(a+b+1)^2: # assuming nonnegative

I intend to find the nonnegative real roots of it.

solve({expr = 0, (a, b) >= ~ 0}, [a, b], allsolutions);
solve(expr = 0., [a, b], useassumptions, allsolutions) assuming (a, b) >= ~ 0;
solve({expr = 0., (a, b) >= ~ 0}, [a, b], allsolutions);


all return six solutions, but curiously,

solve(expr = 0, [a, b], useassumptions, allsolutions) assuming (a, b) >= ~ 0;

only returns four solutions. Why???

In addition, as you can see, the first output (i.e., sol1) is thoroughly less meaningful. Can't it be more readable??

 > restart;

=

=

=

=

 > _SolutionsMayBeLost;
 (1)

=

Why did't  return ?

map2(evala@eval, expr, sol5);

 (2)

Error, (in type/algext) too many levels of recursion

## variation tab of a fonction ...

Hello,

Can you tell me how I can create the variation tab of a function with Maple 2022?

Thanking you,

,DAVID CRESPIL

## why solve gives solution with big O in it? What do...

I have only seen big O show up in series solutions, as in

series(sin(x),x)

I've never seen it before show up in result of solve

restart;
eq:=x=p*(a*ln(p+sqrt(p^2-2))+2*_C1)/(2*sqrt(p^2-2));
sol:=solve(eq,p);


What does it actually mean when the solution has  O(RootOf(....))?

Should not result of solve be exact? isn't having big O means an approximation?

Maple 2022.2 on windows 10

## Some questions about suppression of warnings...

Q1: Is it possible to find out where a warning was generated (i.e. which procedure issued the warning)?

Q2: Is a command specific warning suppression possible? Something like that for example: infolevel[int] := 0

Q3: Can warnings be removed form a document before printing it?

Typical warnings I want to suppress are attached