## A problem in selecting elements from set...

I get a problem while selecting elements from sets.

I have a list of two sets apparently ordered in the same order.
When I pick this, for instance, first set from each of these two samples I get the first one from the first set, and the second one from the second set.

 > restart:
 > DF := [ {diff(Theta(x), x), diff(Theta(x), x, x)}, {diff(g(x), x), diff(g(x), x, x)} ]
 (1)
 > # Why are the elements of DF[2] not returned in their correct order? i := 1; DF[i], DF[i][1], DF[i][2]; print(): i := 2; DF[i], DF[i][1], DF[i][2];
 (2)
 > # I suppose we must not trust what is displayed and that lprint is more # trustworthy? lprint(DF)
 [{diff(Theta(x), x), diff(diff(Theta(x), x), x)}, {diff(diff(g(x), x), x), diff(g(x), x)}]
 > # I expected that converting each element of DF into a list would fix this # problem. but anothr does appear: # "Why does the conversion into list change the order of the elements?" # I had never seen that before LDF := convert~(DF, list)
 (3)
 >

Running this command

`map(sort, LDF)`

displays LDF, which suggests that LDF is already sorted according to some order.
What is this order which makes diff(Theta(x), x\$2) the successor of diff(Theta(x), x)  but diff(g(x), x) the successor of diff(g(x), x\$2)  ?

## How to extract dat file from contour plot...

Dear Users,

I hope everyone here is fine. I want to extract dat file from the attached contour plot file. Please help me to resolve this issue. Many thanks in advance

Dat_file.mw

## Is there a command to get errors from fit paramete...

Hi everyone, I'm studying physics at college and we have to do lab reports. Of course we have to fit data sets. They only taught us how to calculate errors of the parameters of lineaer distributions.

Unforutnately I have to fit points that follow these functions:

First of all, which command do I use to fit for the second function? (Its the formula of  in function of the frequence in RC circuits)

I know for the first one there's the PowerFit command.

Also, is there a command that returns the errors for the variaous fit parameters? (i.e. a,b,c,d)

Or at least, someone knows the methods and formulas to find them?

## Ploting in pdsolve numerically...

Dear Users,
I hope you are doing well. The following is the code to solve a nonlinear PD equation numerically and I plotted the graphs for T(y,t) sucessfully.

restart; with(plots); PDE1 := Pr*(diff(T(y, t), t)-Ree*(diff(T(y, t), y))) = (1+Nr*(T(y, t)+1)^3)*(diff(T(y, t), y, y))+3*Nr*(T(y, t)+1)^2*(diff(T(y, t), y))^2; ICandBC := {T(1, t) = 1, T(y, 0) = 1, (D[1](T))(0, t) = T(0, t)}; Ree := .1; Pr := 6.2; HA1 := [0, 1, 10]; AA := [red, green, blue, cyan, purple, black];
printlevel := 2; for i to nops(HA1) do Nr := op(i, HA1); print("Nr = ", %); PDE[i] := {PDE1}; pds[i] := pdsolve(PDE[i], ICandBC, numeric, spacestep = 1/200, timestep = 1/100); PlotsT[i] := pds[i]:-plot[display](T(y, t), t = 1, linestyle = "solid", labels = ["y", "u"], color = op(i, AA), numpoints = 800) end do;
display([`\$`(PlotsT[j], j = 1 .. nops(HA1))], size = [1000, 600], axes = boxed, labels = [x, (convert("T", symbol))(x, T)], labelfont = ["Times", 14, Bold], labeldirections = [horizontal, vertical], axesfont = ["Arial", 14, Bold], thickness = 3)

I want to plot the graphs for (1+Nr*(T(y, t)+1)^3)*(diff(T(y, t), y)), at t = 1. Also want to plot diff(T(y, t), y) at y = 0 and y = 1 against Nr. Kindly help me in this matter.

## Factorization and ascending order of an expression...

Dear Users!
I hope are fine here. I got the following expression after a lot of computations

((1/2)*r*(r-1)+(1/6)*r*(r-1)*(r-2))*`&Delta;y`[-1]^3+(1/2)*r*(r-1)*`&Delta;y`[-1]^2+(1/120)*r*(r-1)*(r-2)*(r-3)*(r-4)*`&Delta;y`[-2]^7+((1/6)*r*(r-1)*(r-2)+(1/12)*r*(r-1)*(r-2)*(r-3)+(1/120)*r*(r-1)*(r-2)*(r-3)*(r-4))*`&Delta;y`[-2]^5+((1/6)*r*(r-1)*(r-2)+(1/24)*r*(r-1)*(r-2)*(r-3))*`&Delta;y`[-2]^4+((1/24)*r*(r-1)*(r-2)*(r-3)+(1/60)*r*(r-1)*(r-2)*(r-3)*(r-4))*`&Delta;y`[-3]^7+((1/24)*r*(r-1)*(r-2)*(r-3)+(1/60)*r*(r-1)*(r-2)*(r-3)*(r-4))*`&Delta;y`[-3]^6+r*`&Delta;y`[0]+y[0]

Actually, for the above, I want the factorization of each coefficient of `&Delta;y`[0], `&Delta;y`[-1], `&Delta;y`[-2] etc and the above expression shoud be in descending order given as:

y[0]+r*`&Delta;y`[0]+(1/2)*r*(r-1)*`&Delta;y`[-1]^2+(1/6)*r*(r-1)*(1+r)*`&Delta;y`[-1]^3+(1/24)*r*(r-1)*(r-2)*(1+r)*`&Delta;y`[-2]^4+(1/120)*r*(r-1)*(r-2)*(r+2)*(1+r)*`&Delta;y`[-2]^5+(1/120)*r*(r-1)*(r-2)*(r-3)*(r-4)*`&Delta;y`[-2]^7+(1/120)*r*(r-1)*(r-2)*(r-3)*(-3+2*r)*`&Delta;y`[-3]^6+(1/120)*r*(r-1)*(r-2)*(r-3)*(-3+2*r)*`&Delta;y`[-3]^7

I am waiting for your positive response. Thanks

## Difficulties to compute a definite integral....

Does anyone have any idea why Maple can obtain a closed form of

`Int(f, t=1..3);`

but doesn't for

`Int(g, t=1..3);`

?

The Int forms are quite close and I don't understand what makes Maple's task that difficult in the second case (the issue seems to come from the conditions in the piecewise function).
Can we force Maple to perform the second integration ?

TIA

 > restart:
 > interface(Version)
 (1)
 > f := piecewise(z/t < 0, 0, z/t < 1, 630*z^8/t^8-2520*z^7/t^7+3780*z^6/t^6-2520*z^5/t^5+630*z^4/t^4, 0)/t: Int(f, t=1..3); value(%);  # returns a closed form of the integral
 > g := piecewise(z/t < 1, 0, z/t < 2, 10080-60480*z/t+156240*z^2/t^2-226800*z^3/t^3+202230*z^4/t^4-113400*z^5/t^5+39060*z^6/t^6-7560*z^7/t^7+630*z^8/t^8, 0)/t: Int(g, t=1..3); value(%): # unable to return a closed form of the integral

## Why does "discont" give this result...

I'm working on finding the analytic expression of the PDF of a sum of abstract Uniform Random Variables URV).
Here "abstract" means that the supports are not numeric but litteral.

Maple is capable to find such a PDF for numeric supports but unable to determine the PDF of U1+U2 where

```U1 := RandomVariable(Uniform(a1, b1)):
U2 := RandomVariable(Uniform(a2, b2)):
```

A way to deal with abstract URV is to complute explicitely the convolution product of th PDFs.
Ir seems that this fails (MAPLE 2015.2) for these PDF are piecewise functions.
A workaround is to convert them first into Heaviside(s).

One done the explicit expression of the convolution product can be obtained for a sum of 2 abstract URVs, but not for a sum of a larger number of abstract URVs.

Thus the second workaround which consists in using direct and inverse Fourier transform.

The question is :
obviously, the PDF f(t ; a1...aN, b1...bN) of  U1 + ... + UN is a continuous function of t: why does discont(f(t ; ...), t) returns the non empty set of the values where the Heaviside functions are undefined ?

Here is a very simple result

```u1 := RandomVariable(Uniform(-1, 1)):
u2 := RandomVariable(Uniform(-1, 1)):
p := PDF(u1+u2, t):
discont(p, t);

print("-------------------------------------");

f1 := convert(PDF(u1, t), Heaviside):
f2 := convert(PDF(u2, t), Heaviside):
g1 := fourier(f1, t, xi):
g2 := fourier(f2, t, xi):
g  := g1*g2:
f  := invfourier(g, xi, t):
discont(f, t);

{}
"-------------------------------------"
{-2, 0, 2}
```

The problem is (IMO) that discont(f, t) should return { }, but that some function (does it exists) should say that d is undefined at points t=-2, t=0, t=2.
The output of discont(f, t) doesn't seem consistent with the definition of the continuity

```limit(f, t=-2, left);
limit(f, t=-2, right);
eval(f, t=-2)
0
0
undefined
```
 > restart:
 > with(inttrans); with(Statistics):
 (1)
 > N := 3: for n from 1 to N do   U||n := RandomVariable(Uniform(a__||n, b__||n)): end do;
 (2)
 > # Maple fails to compute the PDF of a sum of abstract (meaning with symbolic support) uniform RVS # PDF(U1+U2, t)
 > # For N <=3 the computation of the convolution product is possible. # # For N > 4 (Maple 2015) it seems this is no longer the case. The trick used here is based on # the fact that Fourier(Conv(f, g)) : Fourier(f)*Fourier(g) # Thus PDF(U1+U2) = conv(PDF(U1), PDF(U2)) = invFourier(Fourier(PDF(U1)).Fourier(PDF(U1))) for n from 1 to N do   f||n := convert(PDF(U||n, t), Heaviside): end do: for n from 1 to N do   g||n := fourier(f||n, t, xi): end do: g := mul(g||n, n=1..N): hyp := seq(b__||n > a__||n, n=1..N); f   := invfourier(g, xi, t) assuming hyp;
 (3)
 > # f is obviously a continuous function of t, but I get this strange result discont(f, t);
 (4)
 > # note that this "error" also appears if the a__n's and b__n's are numeric r := rand(0. .. 1.): P := convert(indets(g, name) minus{xi}, list): E := NULL: for n from 1 to N do   a := r():   b := a + r():   E := E, a__||n = a, b__||n = b end do: E := [E]; G := eval(g, E): f := invfourier(G, xi, t); discont(f, t);
 (5)
 > u1 := RandomVariable(Uniform(-1, 1)): u2 := RandomVariable(Uniform(-1, 1)): p := PDF(u1+u2, t): discont(p, t); print("-------------------------------------"); f1 := convert(PDF(u1, t), Heaviside): f2 := convert(PDF(u2, t), Heaviside): g1 := fourier(f1, t, xi): g2 := fourier(f2, t, xi): g  := g1*g2: f  := invfourier(g, xi, t): discont(f, t);
 (6)
 > limit(f, t=-2, left); limit(f, t=-2, right); eval(f, t=-2); print("-------------------------------------"); limit(f, t=0, left); limit(f, t=0, right); eval(f, t=0)
 (7)
 >

## How to remove the unit?...

Consider this piece of program

```restart:
interface(version)
Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 21 2015 Build ID 1097895
with(Units):
a := 3*Unit('m');
3 Units:-Unit('m')
```

I would like to define a new quantity b which is the dimensionless variant of a.
I browsed the Units package to look for a function that would "remove" the dimension of a dimensional quantity like a above (that is to get '3' alone).

As I couldn't find such a function I use to use this workaround.

```b := remove(has, a, Unit);
3
```

Is this a robust strategy?
What would you propose to "remove" the dimension of a?

## Why are the level curves wrong when axis mode is ...

Using plot3d(..., style=surfacecontour, ...) or contourplot3d(...) displays wrong level curves when some axis are switched to a log mode.

Example:

 > restart:
 > interface(version)
 (1)
 > X := (0.4000000000e-4*(-R+80.00))/(R*(0.4e-1+M__a)):
 > plot3d(X, R=0..10, M__a=10^0..10^4, style=surfacecontour, color=gold)
 > plot3d(X, R=0..10, M__a=10^0..10^4, axis[2]=[mode=log], axis[3]=[mode=log], style=surfacecontour, color=gold)
 > plots:-display(   plots:-contourplot3d(X, R=0..10, M__a=10^0..10^4, axis[2]=[mode=log], axis[3]=[mode=log], color=red),   plot3d(X, R=0..10, M__a=10^0..10^4, style=surface, color=gold) )
 >

The problem is not dramatic because there is a workaround.

 > restart:
 > interface(version)
 (1)
 > X := (0.4000000000e-4*(-R+80.00))/(R*(0.4e-1+M__a)):
 > fig := plot3d(X, R=0..10, M__a=10^0..10^4, style=surfacecontour, color=gold): Tr  := plottools:-transform((x, y, z) -> [x, log[10](y), log[10](z)]): plots:-display(Tr(fig), axis[2]=[tickmarks=[seq(i=10^i, i=0..4)]], axis[3]=[tickmarks=[seq(i=nprintf("%1.0e", 10.^i), i=-7..-1)]])
 >

## How to select an undocumented name generated by Ro...

Even though this question is related to this one
feel it is about a different issue. If any of you feel otherwise feel free to move it to the original one.

In this notional example  the name _Z1~ is created by RootOf: and here is an ad hoc way to catch it.

 > restart:
 > f := RootOf(cos(x)-z, x): u := indets(f, name); s := series(f, z): v := remove(type, indets(s, name), constant); w := v minus u
 (1)
 >

In this more complex example an assumption must be made on M to obtain ths desired solution g and the previous method no longer works.

 > restart
 > f := 10*cos((-1+t)/sqrt(1+M))-10*cos(t/sqrt(1+M)): assume(M::nonnegative): u := indets(f, name); g := solve({diff(f, t), t>0 }, t, allsolutions)[1][1]; v := remove(type, indets(rhs(g), name), constant); w := v minus u
 (1)
 >

I have tried using select to "capture" the name _Z2~ but I can't know how to distinguish M~ from _Z2~ (is there a type which could be used?).

Can you helpm fix this?
TIA

## Why does dsolve return a solution with a singular...

I don't understand why the solution of sys_2 isn't those of sys_1 when M__p=1 and M__a=0 ?

Traces of the computation seem to indicate that dsolve proceeds exactly the same for sys_2 and sys_1 .

Please note that sol_1 contains a term of the form t*cos(t) that sol_2 doesn't, thus the question: "Is sol_2 correct?"

Could you help me to fix this?
TIA

 > restart
 > infolevel[dsolve] := 4;
 (1)
 > sys_1 := {diff(x(t), t\$2)=sin(t)-x(t), x(0)=0, D(x)(0)=0}; sol_1 := dsolve(sys_1)
 Methods for second order ODEs: --- Trying classification methods --- trying a quadrature trying high order exact linear fully integrable trying differential order: 2; linear nonhomogeneous with symmetry [0,1] trying a double symmetry of the form [xi=0, eta=F(x)] -> Try solving first the homogeneous part of the ODE    checking if the LODE has constant coefficients    <- constant coefficients successful    -> Determining now a particular solution to the non-homogeneous ODE       building a particular solution using variation of parameters <- solving first the homogeneous part of the ODE successful
 (2)
 > sys_2 := {(M__p+M__a)*diff(x(t), t\$2)=M__p*sin(t)-x(t), x(0)=0, D(x)(0)=0}; sol_2 := dsolve(sys_2)
 Methods for second order ODEs: --- Trying classification methods --- trying a quadrature trying high order exact linear fully integrable trying differential order: 2; linear nonhomogeneous with symmetry [0,1] trying a double symmetry of the form [xi=0, eta=F(x)] -> Try solving first the homogeneous part of the ODE    checking if the LODE has constant coefficients    <- constant coefficients successful    -> Determining now a particular solution to the non-homogeneous ODE       building a particular solution using variation of parameters <- solving first the homogeneous part of the ODE successful
 (3)
 > eval(sol_2, [M__p=1, M__a=0])
 >

PS: Already, in the following case, dsolve doesn't return the solution of sys_1.

```sys_3 := {(A+B)*diff(x(t), t\$2)=(A+B)*sin(t)-x(t), x(0)=0, D(x)(0)=0};
sol_3 := dsolve(sys_3)
```

If I do this

```sys_4 := {(A+B)*diff(v(t), t)=(A+B)*sin(t)-x(t), diff(x(t), t)=v(t), x(0)=0, v(0)=0}:
sol_4 := dsolve(sys_4)
```

I get a very complex solution wich contains a piecewise function which separates the cases A+B=1 and A+B<>1.
Evaluating sol_4 for A+B=1 gives the same expression than sys_1:

```simplify(eval(sol_4, A=1-B), trig)
/       1                  1          1         \
{ v(t) = - sin(t) t, x(t) = - sin(t) - - cos(t) t }
\       2                  2          2         /
```

Here is a workaround to get the correct solution of sys_2:

```sys_5 := {(M__P+M__A)*diff(v(t), t)=(M__P+C)*sin(t)-x(t), diff(x(t), t)=v(t), x(0)=0, v(0)=0}:
sol_5 := dsolve(sys_5):
simplify(eval(sol_5, [M__P=1, M__A=0, C=0]), trig)
/       1                  1          1         \
{ v(t) = - sin(t) t, x(t) = - sin(t) - - cos(t) t }
\       2                  2          2         /
```

e

## How can I get the desired answer from "solve"...

I compute the solution of this differential system

```shock := piecewise(t <0, 0, t < 1, 10, 0):
sys   := {(M__p+M__a)*diff(x(t), t\$2)=M__p*shock-x(t), x(0)=0, D(x)(0)=0}
sol   := unapply(rhs(dsolve(sys)), (M__p,M__a))
```

I'm interested in 3 quantities:

• the first time tend > 0 such that sol(tend) = 0,
• the time tmax in (0..tend) where sol(tmax) reaches its maximum value,
• the value xmax = sol(tmax).

Since sol has a relatively simple expression, I first attempted to use solve for calculating tend, but that didn't work.
The conclusion is still the same for tmax and xmax.

The values of these 3 quantities that I expect solve to provide, are those obtained using fsolve.

Can you explain me the failures I faced and show me how to force solve to get these values?
TIA

ToyProblem.mw

## fsolve is not working...

Hello Everyone;

Hope you are fine. I need to solve the system of equation. I am using fsolve command but it is not working. Kindly guide me.

Thanks

ques.mw

 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 (1)
 >
 >

## How to setup pacemaker and Corosync to maple work?...

Can pacemaker and corosync work with maple?

How to setup pacemaker and Corosync to maple work in Amazon EC2?

i had only one installed License in linux

how to make it work in clusters ?

what is the difference with supercomputing in Amazon ?

which consulting company in Hong Kong can help to use supercomputing in Amazon in my case ? I would like to run batch of batch total 100 script running maple in one instance , but total numbers need to run around 60 years. Any consultant to calculate and setup this supercomputing or pacemaker to make calculations into one day or a few days ?