Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I am a newbie Maple user. I am trying to learn how to work with Maple. I would like to view some of the underlying Maple source code; for example the code behind Students[Calculus1]:-InversePlot.

I have tried the following, but all I get back is module() ... end module.

restart
kernelopts(opaquemodules=false);
with(Student[Calculus1]);
interface(verboseproc=3);
eval(Student[Calculus1]:-InversePlot);

Is there a way to do this?

Thanks

How to do this with differential geometry for a vectorfield like this one ?
But lets start easier , with straight arrows 

please give me a link to find the best presentation about maple? i am looking for it but nothing intrested found 

Dear sir here not matching the table values in the given pdf and if the Bc ((D(D(f)))(1) = 0) is also not satisfying 

thin_film_base_paper_comparision.mw

restart;
with(PDEtools):
with(plots):
with(LinearAlgebra):

A1 := 1:

# A2: Density coefficient
A2 := 1:

# A3: Thermal conductivity coefficient (Maxwell model)
A3 := 1:

# A4: Heat capacity coefficient  
A4 := 1:

# A5: Electrical conductivity coefficient (Maxwell model)
A5 := 1:
 

 

# Default parameter values (can be varied in studies)
M := 0:               # Magnetic field parameter
               # Unsteadiness parameter  
lambda_val := 0.5:      # Film thickness parameter (β²)
R := 0:               # Radiation parameter
A_star := 0.5:          # Heat source parameter
B_star := 0.5:          # Heat sink parameter
Ec := 0:              # Eckert number
Pr := 1:            # Prandtl number

OdeSys := A1 * diff(f(eta), eta, eta, eta) +
                     A2 * lambda_val * (f(eta) * diff(f(eta), eta, eta) -
                     diff(f(eta), eta)^2 - S * diff(f(eta), eta) -
                     (S * eta/2) * diff(f(eta), eta, eta)) -
                     M * A5 * diff(f(eta), eta) = 0,(A3 + (4/3)*R) * diff(theta(eta), eta, eta) -
                   Pr * A4 * lambda_val * ((S/2) * (3*theta(eta) + eta*diff(theta(eta), eta)) +
                   2*diff(f(eta), eta)*theta(eta) - f(eta)*diff(theta(eta), eta)) +
                   lambda_val * (B_star * theta(eta) + A_star * diff(f(eta), eta)) = 0;

diff(diff(diff(f(eta), eta), eta), eta)+.5*f(eta)*(diff(diff(f(eta), eta), eta))-.5*(diff(f(eta), eta))^2-.5*S*(diff(f(eta), eta))-.2500000000*S*eta*(diff(diff(f(eta), eta), eta)) = 0, diff(diff(theta(eta), eta), eta)-.2500000000*S*(3*theta(eta)+eta*(diff(theta(eta), eta)))-1.0*(diff(f(eta), eta))*theta(eta)+.5*f(eta)*(diff(theta(eta), eta))+.25*theta(eta)+.25*(diff(f(eta), eta)) = 0

(1)

 

# Boundary conditions
    Cond :=f(0) = 0, D(f)(0) = 1, theta(0) = 1, f(1) = S/2,  D(theta)(1) = 0:
#(D(D(f)))(1) = 0:

SVals := [1, 1.2, 1.4, 1.6,1.8]:



for j to numelems(SVals) do
  
        Ans[j] := dsolve(eval([OdeSys, Cond], S = SVals[j]), numeric,
                         output = listprocedure):
end do:
       

interface(rtablesize = 100); interface(displayprecision = 6); Matrix([[Y, Nu, Nu, Nu, Nu, Nu], seq([k, seq([-(eval(diff(theta(eta), eta), Ans[j]))(k)][], j = 1 .. numelems(SVals))], k = 0)]); interface(rtablesize = 10); interface(displayprecision = -1)

Matrix(%id = 36893490264274272116)

(2)
 

 

Download thin_film_base_paper_comparision.mw
fin_base_paper.pdf

I want to change all `\infty` with `+\infty`. I tried

s := StringTools:-SubstituteAll(s, "\\infty", "+\\infty")

Then,  `-\\infty` to `- + \\infty`. How can I replace \infty with +\infty but keep -\infty unchanged?

How can I isolate the positive terms on one side and the negative terms on the other? Is there a systematic way to split and rearrange the expression so that I can determine the conditions under which L is positive or negative?

restart

``

L := simplify(-rho0*(-Cn*Cr*alpha*d*rho0+Cr*Pr*alpha*d*rho0-Cr*alpha*d*delta*rho0+Ce*alpha*d*delta+Cr*alpha*d*rho0-Crm*alpha*d*delta+Pr*alpha*d*delta-alpha*c*d*delta-alpha*delta*g*i2-Ce*alpha*d-Ce*d*delta-2*Cn*alpha*rho0+Crm*alpha*d-Pr*alpha*d+2*Pr*alpha*rho0+2*a*alpha*delta+alpha*c*d-alpha*c*delta-2*alpha*delta*rho0+alpha*g*i2+Ce*d-2*a*alpha+alpha*c+2*alpha*rho0)/(Cr*alpha*d*delta*rho0^2-Cr*alpha*d*rho0^2+2*alpha*delta*rho0^2-2*alpha*rho0^2-d*delta^2+2*d*delta-d)) = 0

-2*((((-(1/2)*rho0*Cr-(1/2)*Crm-(1/2)*c+(1/2)*Ce+(1/2)*Pr)*delta-(1/2)*Cr*(Cn-Pr-1)*rho0+(1/2)*Crm+(1/2)*c-(1/2)*Ce-(1/2)*Pr)*d+(-(1/2)*i2*g+a-rho0-(1/2)*c)*delta+(-Cn+Pr+1)*rho0+(1/2)*i2*g-a+(1/2)*c)*alpha-(1/2)*d*Ce*(delta-1))*rho0/((rho0^2*(Cr*d+2)*alpha-d*(delta-1))*(delta-1)) = 0

(1)
 

``

Download Positive_Negative_Isolation.mw

 

I'm Hi,looking to make this exercise dynamic by animating the trajectories and displaying the velocity vector. Do you have any ideas to help me build this pedagogical scenario within the Maple environment? Many thanks in advance.

mX(m, isumSD_TOT) := isumSD_REG; 
is changed to: 
mX := (m, isumSD_TOT) -> isumSD_REG;

This clobbers the Matrix mRegResTot. I can't fix it for the Matrix in the lower part. No clue why. 
The syntax works normally inside the do loops. Maple is changing the code if there is a variable that is passed as the first parm, but only outside a do loop. 

Code snippet duplicating 
_________________________________________________________________________________________

restart;
with(Statistics);
with(ArrayTools);
with(LinearAlgebra);
with(plots);
with(plottools);
with(ExcelTools);

mX := Matrix(20, 9);
iDreg := 1;
itSD_DREG := 2;
isumSD_REG := 3;
iDres := 4;
itSD_DRES := 5;
isumSD_RES := 6;
iDtot := 7;
itSD_DTOT := 8;
isumSD_TOT := 9;
for m to 20 do  # Load the matrix with values from 1 to 9. 
    mX(m, iDreg) := iDreg;
    mX(m, itSD_DREG) := itSD_DREG;
    mX(m, isumSD_REG) := isumSD_REG;
    mX(m, iDres) := iDres;
    mX(m, itSD_DRES) := itSD_DRES;
    mX(m, isumSD_RES) := isumSD_RES;
    mX(m, iDtot) := iDtot;
    mX(m, itSD_DTOT) := itSD_DTOT;
    mX(m, isumSD_TOT) := isumSD_TOT;
end do;
mX; # Show the Matrix is loaded. 
mX(5, isumSD_TOT) := itSD_DREG;  #change the last cell in the 5th row. 
mX; # Show the Matrix has row 5 column 9 changed to a 2. 
for m to 5 do #Load the first 5 rows of column 9 to a value of 1.
    mX(m, isumSD_TOT) := iDreg;
end do;
mX; # Show that the Matrix values were changed. 
m := 5;
mX(m, isumSD_TOT) := isumSD_REG;   # See syntax changed to:   mX := (m, isumSD_TOT) -> isumSD_REG;
mX;  # Show that the Matrix has been clobbered. 

 

Why are characters printed with additional back ticks when decimal HTML code is used (see output (3) below). lprint((3)) does not print them.

Looks like an exception. Is there a reason for that? Can it be used for something?

With HTML entitiy

`‰`

`‰`

(1)

With HTML hex code

`‰`

`‰`

(2)

With HTML decimal code

`‰`

`‰`

(3)
 

 

Download back_ticks_with_decimal_code.mw

Good afternoon.

Here is (what appears to be) a simple assignment problem that involves scheduling 3 jobs through 2 machines, and I wish to minimize the total time required to complete all 3 jobs. Each job must be processed first on machine #1 before going to machine #2,and each machine can only handle one job at a time.

I have determined the optimal sequence to minimize the makespan (i.e., the completion time of the last job on machine #2) using a manual method and I was wondering if someone could review this (please see attached) and recommend a structured LP method or let me know if such a procedure exists in Maple's Optimization package.

Any help will be appreciated! 

Thanks for reading.

MaplePrimes_Nov_4.mw

HeunC(-4*b, 4*b, 2, 8*b^2, -8*b^2 - _c[2] + 1, (-r + 2*b)/(2*b))
Is there a simple way in Maple to determine whether the following confluent Heun function terminates or when it terminates?

I want to write the equation of the line in the form a*x + b*y + c=0, with igcd(a,b,c)=1 of this code

restart;
with(geometry);
point(A, 2, -3);
point(B, -1, 6);
sort(Equation(line(d, [A, B], [x, y])));

I tried by hand

-1/3*sort(Equation(line(d, [A, B], [x, y])))

How can I get the result 3x + y - 3=0 automatically?

PS. I tried and get the answer 3x + y - 3 =0.

restart;
with(geometry);
point(A, 2, -3);
point(B, -1, 6);
eq := sort(Equation(line(AB, [A, B], [x, y])));
k := igcd(coeff(lhs(eq), x), coeff(lhs(eq), y));
sort(eq*sign(coeff(lhs(eq), x))/k);

 

Embedded typesetting code in names is still giving me troubles. This is because the functionality and interplay of the characters ", &, #, ; and ` are not documented (appart from some MaplePrimes posts). Sometimes an escape  character (is that term correct?) is required sometimes it can be omitted or replaced by something else. I read somewhere that in former Maple versions strings were composed with back ticks `...` and this has moved to double quotes but both ways work for typesetting (if one knows how to).

Overall, there is allot of guesswork and trial-and-error involved in typesetting.

In the below I discovered a pecularity that prevented me to add certain symbols to the favorite palette.

On the positive side I found anwsers for an older question. On negative side an atomic identity has to be converted to atomic to add it to the favourites. This confuses me.

Maybe someone knows why this has to be done? Does a dragg operation strips of certain characters? Or is it in the case below that the use of the ampersand plays a role which is normally reserved to define neutral operators. Or is it fully unrelated because HTML codes and HTML entities for special symbols start with an ampersand (however an &D entitiy does not seem to exist).

Besides an explanation for the double atomization any insights and guidance with repect to typesetting of names is highly appreciated. Creating an italic captial D as a variable/name has been anwsered to my full satisfaction here. This question is more about a better understanding of typesetting.

Define a symbol with "name quotes" (left single quotes or back ticks)

NULL

`&D;`

`&D;`

(1)

whattype(`&D;`)

symbol

(2)

lprint(`&D;`)

`&D;`

 

type(`&D;`, atomic)

true

(3)

Select and drag the output (1) into the favourites leads to a blue symbol in the favorites .
Clicking on that symbol an executing

D

D

(4)

lprint(D)

D

 

whattype(D)

procedure

(5)

It seems that the drag operation has removed not only the back ticks but also the ampersand and the semicolon. (The purpose of the semi-collon  in this context seems to be the suppression of the ampersand printout (not sure about this)).


Doing the same in 2D (to later on make the symbol atomic using the context menu)

`&D;`

`&D;`

(6)

whattype(`&D;`)

symbol

(7)

lprint(`&D;`)

`&D;`

 

type(`&D;`, atomic)

true

(8)

Now the same input (copied as MathML from the input of (6)) and converted to atomic (by select -> right click -> 2D-Math-> Convert To -> Atomic)

`#mi("\`&D;\`")`

`#mi("\`&D;\`")`

(9)

whattype(`#mi("\`&D;\`")`)

symbol

(10)

lprint(`#mi("\`&D;\`")`)

`#mi("\`&D;\`")`

 

type(`#mi("\`&D;\`")`, atomic)

true

(11)

Seleceting and dragging the output (9) to the favorites leads to a new symbol
Clicking on that symbol an executing

`#mi("&D;")`

`#mi("&D;")`

(12)

whattype(`#mi("&D;")`)

symbol

(13)

lprint(`#mi("&D;")`)

`#mi("&D;")`

 

type(`#mi("&D;")`, atomic)

true

(14)

Removing now  from the favorite palette and adding the output (12) again as before
and clicking on the newly added symbol

`#mi("&D;")`

`#mi("&D;")`

(15)

lprint(`#mi("&D;")`)

`#mi("&D;")`

 

 

In summary`#mi("&D;")` = `#mi("&D;")` and `#mi("\`&D;\`")` = `#mi("\`&D;\`")` (although they are of type atomic) must be converted to atomic to drag their output into the favourite palette.

On the other hand the output "`#mi("\`&D;\`")`" cannot be used as input and converted in the same way. It must be converted to 1D-MathError, invalid neutral operator"`#mi("\`&D;\`")`"

`#mi("\`&D;\`")`;

`#mi("\`&D;\`")`

(16)

before the output can be dragged to the favorite palette.


Download dragging_atomic.mw

Please advise. I have a logarithmic equation.

   E(ν)=E0·ln(1+2·A·ν)+Em+C·ν^2

With constant E0>0, Em<0, C<0 and A>0, and E(ν) of variable ν between [10^4 and 10^13]

I have 3 points, ν1, ν2, and ν3, and the value of the function E(ν) at each point. I want to choose A to obtain the smallest absolute value of Em, preferably ~ -0.00005. The value of ν1, ν2, ν3 and E(ν1), E(ν2), E(ν3) are known.

With what “A” should I start to obtain  Em~ -0.00005?

restart;

 

Digits:=25;

25

(1)

 

E(nu):=Em+E0*ln(1+A*3.7653333333333333333*10^(-18)*nu)+ C*nu^2;

Em+E0*ln(1+0.3765333333333333333300000e-17*A*nu)+C*nu^2

(2)

E1:=subs(nu=5.754173859*10^8,E(nu));

Em+E0*ln(1+0.2166638263708799999980819e-8*A)+331105167995989518.8100000*C

(3)

E2:=subs(nu=6.338671958*10^8,E(nu));

Em+E0*ln(1+0.2386721281252266666645538e-8*A)+401787621911355537.6400000*C

(4)

E3:=subs(nu=31*10^9,E(nu));

Em+E0*ln(1+0.1167253333333333333323000e-6*A)+961000000000000000000*C

(5)

solve({E1=3.259,E2=3.59});

{A = A, C = 0.1414778271842943053715718e-16*E0*ln(1.+0.2166638263708799999980819e-8*A)-0.1414778271842943053715718e-16*E0*ln(1.+0.2386721281252266666645538e-8*A)+0.4682916079800141507799027e-17, E0 = E0, Em = 4.684403973756333877677291*E0*ln(1.+0.2386721281252266666645538e-8*A)-5.684403973756333877677291*E0*ln(1.+0.2166638263708799999980819e-8*A)+1.708462284686653486488817}

(6)

sol:=solve({E1=3.259,E2=3.59,E3=0},{Em,E0,C,A});

{A = A, C = .1000000000000000000000000*(3259.*ln(1.+0.2386721281252266666645538e-8*A)+331.*ln(1.+0.1167253333333333333323000e-6*A)-3590.*ln(1.+0.2166638263708799999980819e-8*A))/(7068245391536601883.*ln(1.+0.1167253333333333333323000e-6*A)-96066889483200401048119.*ln(1.+0.2386721281252266666645538e-8*A)+96059821237808864446236.*ln(1.+0.2166638263708799999980819e-8*A)), E0 = -31821175830670350532464.09/(7068245391536601883.*ln(1.+0.1167253333333333333323000e-6*A)-96066889483200401048119.*ln(1.+0.2386721281252266666645538e-8*A)+96059821237808864446236.*ln(1.+0.2166638263708799999980819e-8*A)), Em = 0.2000000000000000000000000e-2*(6037915335175266232043.*ln(1.+0.1167253333333333333323000e-6*A)-0.1565949500000000000000000e27*ln(1.+0.2386721281252266666645538e-8*A)+0.1724995000000000000000000e27*ln(1.+0.2166638263708799999980819e-8*A))/(7068245391536601883.*ln(1.+0.1167253333333333333323000e-6*A)-96066889483200401048119.*ln(1.+0.2386721281252266666645538e-8*A)+96059821237808864446236.*ln(1.+0.2166638263708799999980819e-8*A))}

(7)

A:=4.19747*10^6;evalf(sol[4]);#Em

4197470.00000

 

Em = -0.7291335370248713771647314e-1

(8)

Em:=-0.07291335370248713771647314;

-0.7291335370248713771647314e-1

(9)

evalf(sol[3]);#E0

E0 = 373.7014139352964920547905

(10)

E0:=373.7014139352964920547905;

373.7014139352964920547905

(11)

evalf(sol[2]);#C

C = -0.1549823289304468027271168e-18

(12)

C:=-1.549823289304468027271168*10^(-19);

-0.1549823289304468027271168e-18

(13)

E(nu):=Em+E0*ln(1+A*3.7653333333333333333*10^(-18)*nu)+ C*nu^2;

-0.7291335370248713771647314e-1+373.7014139352964920547905*ln(1+0.1580487370666666666652675e-10*nu)-0.1549823289304468027271168e-18*nu^2

(14)

plot(E(nu),nu=10^6..3.1*10^10);

 

evalf(subs(nu=5.754173859*10^8,E(nu)));evalf(subs(nu=6.338671958*10^8,E(nu)));evalf(subs(nu=6.974105195*10^8,E(nu)));

3.258999999999999999999993

 

3.589999999999999999999993

 

3.948288407313424284054632

(15)

evalf(subs(nu=0,E(nu)));evalf(subs(nu=11.4*10^6,E(nu)));evalf(subs(nu=15.9*10^9,E(nu)));#44.5eV @ 15.9Ghz

-0.7291335370248713771647314e-1

 

-0.560769863114429190697634e-2

 

44.52276318342970513246218

(16)
 

 

Download ML.mw

I am starting a new project and I anticipate creating dozens of files along the way. Each file will need the same collection of definitions, procedures, etc. and I would prefer not to have to copy and pace them as a preamble each time I open anew file. I guess I could write some startup code but would that mean every time I open an unrelated Maple file the Startup code would be laoded? I will be using Maple for other things besides this project. Also, while the stratup code would be hidden most of the time I would perhaps like to be able to see what the n1 procedure is; n1(x) would invoke the procedure-I just want to see waht it does. I usually endup up labeling my files in some lazy way so if I want to go back and find something it takes for ever. Any suggestions for improving that?

Thanks,

2 3 4 5 6 7 8 Last Page 4 of 2231