## how to keep set members in order of addition...

i have a question about sets. how can i keep set members in order of addition not the defualt maple ordering.
in maple help, i saw the command setsort=0..8 but i do not know how to use it.
consider exmaple below:

 > restart
 > L:={}:
 > for j in [3,5,6,1] do birth:=j: L:=`union`(L ,{j}); od;
 (1)
 >

how can i keep L as order of addition? L={3,5,6,1}. thanks in advance

## loops backwards...

Hi I am using Maple 18 and am trying to make my looping work backward.

with(Student[Calculus1]);
with(linalg);
with(orthopoly);
Digits := 20;
n, K := 5, 4;
for k from 0 to n do a[k] := (int((T(2, t)-T(0, t))*T(k, t)/sqrt(-t^2+1), t = -1 .. 1))/Pi end do

First I use the above command to generate a0, a1, a2, a3, a4 and a5. Now i want to do a back substitute using the following recurrence relation to determine the values of b5, b4, b3, b2, b1 and b0.

b[n] := 0; (to find b5)

b[n-1] := a[n]; (to find b4)

(to find b3, b2, b1, b0)

Can someone assist me with the backward looping please. I does not seem to work.

## How can I get one option of coordinates of all ver...

I calculate volume of tetrahedron SABC by this way. Now, I want to find one option  of coordinates of all vertices of this tetrahedron. How can I get the coordinates of the points S, A, B, C so that coordinates  center of circumcircle of the triangle ABC is (0,0,0)?

```restart:
SA := 3:
SB := 5:
SC := 7:
AB := 3:
BC := 4:
AC := 5:
V := (1/12)*sqrt(SA^2*BC^2*(AB^2+AC^2-BC^2-SA^2+SB^2+SC^2)+SB^2*AC^2*(AB^2-AC^2+BC^2+SA^2-SB^2+SC^2)+SC^2*AB^2*(-AB^2+AC^2+BC^2+SA^2+SB^2-SC^2)-SA^2*AB^2*SB^2-SB^2*BC^2*SC^2-SA^2*AC^2*SC^2-AB^2*BC^2*AC^2);```

From here https://www.mapleprimes.com/questions/227573-How-To-Get-Coordinates-Of-Triangle-ABC
I find coordinates of the point A, B, C. Now I tried

```with(geom3d):
point(A, -3/2, -2, 0):
point(B, 3/2, -2, 0):
point(C, -3/2, 2, 0):
point(S, x, y, z):
solve([distance(S, A) = 3, distance(S, B) = 5, distance(S, C) = 7], [x, y, z], explicit);```
```with(geom3d):
point(A, -3/2, -2, 0):
point(B, 3/2, -2, 0):
point(C, -3/2, 2, 0):
point(S, x, y, z):
solve([distance(S, A) = 5, distance(S, B) = 3, distance(S, C) = 7], [x, y, z], explicit);```

Use the above code, I obtain the result.

## Making a 3d graph of a continuous piecewise smooth...

Lang_2_output_as_tswitch_varies.mw

^ in this worksheet I have made a graph of a variable in a simple ODE against time (shown below), at t=150 a switch condition, in the worksheet called tswitch, changes the rates of change of the ODE.

I am thinking about afunction that maps tswitch->solution of the ODE and would like to visualise it as a 3d surface, but couldn't work it out in Maple

## Problems with the "collect" command...

Hello everyone,

I have a function of 5 variables, A, P, N, k. I want to solve and express as a power series of 'k'

w=F*k+G+H/k+...

and gather the coefficients of each power.

However, the result I obtain in my code differs from the analytical value I found. What am I doing wrong?

Thanks!

collect_mp.mw

## HDF5 data import?...

Does Maple allow importing HDF5 data files? I checked the docs & cannot find any hint that it does. But before I launch an SCR I thought I'd ask here.

TIA,

M.D.

## Trouble converting units directly from evaluation ...

I've recently changed to maple 2019, from the 2016 version as my license for that product had expired.
However I find it really frustrating that often upon evaluating an expression I can't convert the units.

For instance I had a calculation that evaluated to:

2.114163508*10^7 [kg/s^2]

When I try to directly replace the units within maple to instead be [J/m^2] I recieve the following error message:

"Error, (in  Units:-TestDimensions) 'op(3, i) does not  evaluate to module"

There is no explanation for this error when I try to look it up. However if I once again manually write the answer:
2.114163508*10^7 [kg/s^2] and use the replace units function.
No problem.
I find this quite annoying and frustrating and I hope you can help.

Best regards

Anders Alexander Wagenblast

## reverse solution of diffusion equation...

Hello all

I am going to find the diffusion constant in the following equation :

PDE:=diff(C(x,t),t)=d*diff(C(x,t),x,x);

In a way that ,

evalf(Int(C(x,t=specific),x=0..L))/L - m_number(t=specific)=0

In other words, It would be an iterative procedure to guess "d" and then find the solution C (something like shooting method). The objective is to find "d" in a way that the average of C (solution of PDE) would be equal to m_number at that specific time.

Also, Since I have 5 specific time and m_number, I will have 5 different d. So, I need to use least square method or other optimization technique find one finalized d value.

inverse_numerical_diffusion.mw

I am not good at using Proc command and  I think the error of my code is because of that.

Would you help me to find out my problem in the code and any new idea for solviong this equaltion would be greatly appreciated.

Amir

## 3D Printing and Surface Thickness...

Hello!

I recently began learning how to 3D print with maple using the "Export & .stl " command together.

I was wondering if anyone knew how to increase the surface thickness for parametric plots and implicit plots. My hope would be to increase the "extrusion level" so to say.

I came across:

https://www.mapleprimes.com/questions/134103-Plotting-3d-Surfaces-With-A-Thickness

But I am not sure how to extend this idea to a parametric surface or an implict surface.

One more quick tidbit is that I will be trying to print several surfaces arising in differential geometry and algebraic geometry. Severel of these surfaces are open and or have singularities that I would like to "smooth out."

I would love to hear any ideas and thanks!

## How to get correct result this equation?...

How to get correct result this equation
restart; with(Student:-MultivariateCalculus);
A := [0, 0, 0];
B := [c, 0, 0];
S := [x, 0, z];
solve([Distance(S, A) = a, Distance(S, B) = b], [x, z]) assuming and(a > 0, b > 0, c > 0);

## difficult integral of Dirac delta function...

The integral of y = Dirac(phi-m), in which phi is a continuously variable quantity and m is a positive integer, from -infinity to infinity yields 1 as an answer.   The analogous integral of y2 yields no answer.  Is it possible that the latter integral has some mathematical meaning that might yield an answer?

## How to Plot a figure from Differential Equation (I...

I have Differential equation sytems as follow:

r := 10^(-2);k := 10^12;c1 := 5*10^(-11);c2 := 10^(-13);mu := 8;lambda := 4.16;a := 2*10^3;q := 300;s0 := 3*10^5;d := 10^(-3);rho := 10^(-12);gama := 10^2;delta := 10^4;b := 5*10^6;

eq1 := {N(0) = 2*10^10, P(0) = 5*10^7, Q(0) = 0, diff(N(t), t) = r*N(t)*(1 - N(t)/k) - c1*N(t)*P(t) - mu*N(t)*Q(t)/(a + Q(t)), diff(P(t), t) = s(t) + s0 - d*P(t) + rho*N(t)*P(t)/(gama + N(t)) - c2*N(t)*P(t) - delta*P(t)*Q(t)/(b + Q(t)), diff(Q(t), t) = q(t) - lambda*Q(t)}. I replace I with P.

N(t):The number of cancer cells; P(t): The number of immune cells (Healthy T-Lymphocuyes); Q(t): The amount of chemotherapeutic agent in bloodstream; q(t): Source terms standing for chemotherapy.

My question is how to get the first two figures below based on these information: q_infinity means constant chemotherapy infusion, while s_infinity means constant immunotherpy.

I got the plot for Q(t) as follow:

Please anyone has any suggestions to help. Thank you very much.

## how does Maple decide which is simpler expression?...

This is may be a philosophical question. But sometimes Maple suprises me when telling it to "simplify" expression. As in this example.

 > expr:=1/(y^3+1)^(2/3);

 > int(expr,y)

 > simplify(%)

 >

For me, the original result is "simpler". (Not only smaller leaf count, but it has one special function, vs. two: Legendre and Gamma). But may be Maple considers hypergeom always more "complex" than any other?

That is why I use simplify(expr,size) because I am scared of simplify without any option, as I have little idea how it decides which is simpler.

Any thoughts from the experts on how Maple decided to simplify something when no option is used? What kinds of rules it uses to decide how to transform the expression?

Maple 2019.1

In the DE solution below I cannot convert the RootOf function to radicals.
macro(solve = allvalues@solve);
_EnvExplicit := true;
de := x^4*diff(y(x), x \$ 2) + omega^2*y(x) = 0;
bc := y(a) = 0, y(b) = 0, D(y)(a) = 1;
dsol := (dsolve({bc, de}, {omega, y(x)}) assuming (0 < a, a < b));
{omega = RootOf(tan(_Z)*_Z*b*_C2 - sin(-2*_B5*Pi + 2*Pi*_Z10 + 2*_B5*arccos(_Z*b*_C2/a) - arccos(_Z*b*_C2/a))*a)*b, y(x) = x*(-cos(RootOf(tan(_Z)*_Z*b*_C2 - sin(-2*_B5*Pi + 2*Pi*_Z10 + 2*_B5*arccos(_Z*b*_C2/a) - arccos(_Z*b*_C2/a))*a)*b/x)*sin(-2*_B5*Pi + 2*Pi*_Z10 + 2*_B5*arccos(RootOf(tan(_Z)*_Z*b*_C2 - sin(-2*_B5*Pi + 2*Pi*_Z10 + 2*_B5*arccos(_Z*b*_C2/a) - arccos(_Z*b*_C2/a))*a)*b*_C2/a) - arccos(RootOf(tan(_Z)*_Z*b*_C2 - sin(-2*_B5*Pi + 2*Pi*_Z10 + 2*_B5*arccos(_Z*b*_C2/a) - arccos(_Z*b*_C2/a))*a)*b*_C2/a))*a/(RootOf(tan(_Z)*_Z*b*_C2 - sin(-2*_B5*Pi + 2*Pi*_Z10 + 2*_B5*arccos(_Z*b*_C2/a) - arccos(_Z*b*_C2/a))*a)*b) + sin(RootOf(tan(_Z)*_Z*b*_C2 - sin(-2*_B5*Pi + 2*Pi*_Z10 + 2*_B5*arccos(_Z*b*_C2/a) - arccos(_Z*b*_C2/a))*a)*b/x)*_C2)}

Does anyone know how to convert the above expression to radicals?
I'm grateful.
Oliveira

In the DE solution below I cannot convert the RootOf function to radicals.

 >
 >
 >
 >
 >
 >
 (1)

Does anyone know how to convert the above expression to radicals?
I'm grateful.

Oliveira