MaplePrimes Questions

I have an ode y''(x) + ...=0 that depends on a parameter a and I would like to see how the solutions vary with a. I created a procedure using odeplot to yield a sequence of plots and display them. Not bad but I really need to look more closely. Plotting y for a=7 and overlaying a plot for y=7.1 is too crude. I want to look at y(x,7.1) - y (x,7) or y(x,7.1) /y (x,7) for x=0..3 say. The obvious solution is to compute y(x,7.1) for x=0..3 and save it as a vector and also y(x, 7). How can I do that so that the pointsx at which y(x, 7.1) are the same as the pointsx for which y(x,7) are evaluated. In other words, how can I specify to dsolve the intermediate points xj for which y(x) is calculated? 

I currently have a 3D plot where the axes are Pn​, w, and the objective value (TM1, TM2, TM3 are all positive). I want to convert this into a 2D regional plot with Pn on the x-axis and w on the y-axis. How do I write the syntax for generating such a 2D region plot?

restart

with(Optimization); with(plots); with(LinearAlgebra)

_local(Pi)

Pi

(1)
 

TM1 := (Pn-.35)*(3.000000000-3.333333333*Pn)+.1115859938-.2510684861*w

(Pn-.35)*(3.000000000-3.333333333*Pn)+.1115859938-.2510684861*w

(2)

TM2 := (Pn-.348)*(2.996666666-3.333333333*Pn)+.1017286174-.2299240474*w

(Pn-.348)*(2.996666666-3.333333333*Pn)+.1017286174-.2299240474*w

(3)

TM3 := (Pn-.348)*(2.996666666-3.333333333*Pn)+.1018208882-.2301325952*w

(Pn-.348)*(2.996666666-3.333333333*Pn)+.1018208882-.2301325952*w

(4)

S1 := plot3d(TM1, Pn = 0 .. 1, w = 0 .. 1, orientation = [165, 75, 0], color = "SkyBlue"); S2 := plot3d(TM2, Pn = 0 .. 1, w = 0 .. 1, orientation = [165, 75, 0], color = "Yellow"); S3 := plot3d(TM3, Pn = 0 .. 1, w = 0 .. 1, orientation = [165, 75, 0], color = "Red")

display({S1, S2, S3})

 

``

Download Plot_3D_to_2D.mw

 

Hello Ladies and Genlemen :)

a[1]:=1;

a__1:=1;

is( a[1]=a__1) returns false.

OK ...so [] is a ist ; __ is just a double underscore .

I skim through the docs but nothing interresting for me.

so what are the whys and the wherefores of this difference ?

I must say that i have been using Maple since 1992 ! (Maple V.2)

I *always* used [] for indexing variables.

I  can't remember where/when __ was introduced...I am an old man now :)

Thank you very much and kind regards to all.

Jean-Michel

In the attached document (an excerpt from a larger document) is a call to the interactive plotbuilder.
The call is somewhere hidden in a document block but the document block with the redline is empty. Deleting the document block only moves the red line to another block. 

Executing the entire document (with !!!) starts the plot builder, execution step by step (with !) does not.

How to delete the call to the plotbuilder?

Interactive_plotbuilder.mw

I am trying to plot a 3D surface graph for my problem, and even though it's working, but the surface plot is not appearing at the base. Could anyone help me with the similar surface shade appearing at the base of the final output?

3D_shadow_at_the_base_Help.mw

I have this code

restart;
with(geometry);
with(StringTools);
interface(worksheetdir);
currentdir(%);
toX := e -> latex(e, 'output' = 'string');
s := toX(e);
s := StringTools:-Substitute(s, "[", "(");
s := StringTools:-Substitute(s, "]", ")");
s := StringTools:-SubstituteAll(s, ",", ";");
s := StringTools:-SubstituteAll(s, "\\frac", "\\dfrac");
s := StringTools:-SubstituteAll(s, "-\\infty", "#@#");
s := StringTools:-SubstituteAll(%, "\\infty", "+\\infty");
s := StringTools:-SubstituteAll(%, "#@#", "-\\infty");
printf("\\documentclass[12pt]{article}\n");
printf("\\usepackage{amsmath,amssymb}\n");
printf("\\usepackage{enumitem}\n");
printf("\\begin{document}\n\n");
f := x -> (x^2 + 4*x + 7)/(x + 1);
df := simplify(diff(f(x), x));
cuctri := sort([solve(df = 0, x)], key = evalf);
g := simplify(diff(df, x));
xcd := rhs(solve([df = 0, g(x) < 0], x)[1]);
xct := rhs(solve([df = 0, 0 < g(x)], x)[1]);
ycd := simplify(f(xcd));
yct := simplify(f(xct));
mycd := coordinates(point(A, xcd, ycd));
myct := coordinates(point(B, xct, yct));
L := [cat("Let a function be given: $y = ", toX(f(x)), "$."), cat("Its derivative is: $y' = ", toX(df), "$."), cat("The maximum point of the graph  $ ", toX(mycd), "$.")];

printf("\\begin{enumerate}[label=\\arabic*)]\n");
for item in L do
    printf("\\item %s\n", item);
end do;
printf("\\end{enumerate}\n\n");

I got

\documentclass[12pt]{article}
\usepackage{amsmath,amssymb}
\usepackage{enumitem}
\begin{document}

\begin{enumerate}[label=\arabic*)]
\item Let a function be given: $y = \frac{x^{2}+4 x +7}{x +1}$.
\item Its derivative is: $y' = \frac{x^{2}+2 x -3}{\left(x +1\right)^{2}}$.
\item The maximum point of the graph  $ [-3, -2]$.
\end{enumerate}

I want to $ (-3; -2)$, not $ [-3, -2]$. How can I make the function toX apply to the whole document?

I tried

restart;
with(geometry);
with(StringTools);
interface(worksheetdir);
currentdir(%);
toX := proc(e) local s; s := latex(e, 'output' = 'string'); s := Substitute(s, "[", "("); s := Substitute(s, "]", ")"); s := SubstituteAll(s, ",", ";"); s := SubstituteAll(s, "\\frac", "\\dfrac"); s := SubstituteAll(s, "-\\infty", "#@#"); s := SubstituteAll(s, "\\infty", "+\\infty"); s := SubstituteAll(s, "#@#", "-\\infty"); return s; end proc;
printf("\\documentclass[12pt]{article}\n");
printf("\\usepackage{amsmath,amssymb}\n");
printf("\\usepackage{enumitem}\n");
printf("\\begin{document}\n\n");
f := x -> (x^2 + 4*x + 7)/(x + 1);
df := simplify(diff(f(x), x));
cuctri := sort([solve(df = 0, x)], key = evalf);
g := simplify(diff(df, x));
xcd := rhs(solve([df = 0, g(x) < 0], x)[1]);
xct := rhs(solve([df = 0, 0 < g(x)], x)[1]);
ycd := simplify(f(xcd));
yct := simplify(f(xct));
mycd := coordinates(point(A, xcd, ycd));
myct := coordinates(point(B, xct, yct));
L := [cat("Let a function be given: $y = ", toX(f(x)), "$."), cat("Its derivative is: $y' = ", toX(df), "$."), cat("The maximum point of the graph  $ ", toX(mycd), "$.")];
printf("\\begin{enumerate}[label=\\arabic*)]\n");
for item in L do
    printf("\\item %s\n", item);
end do;
printf("\\end{enumerate}\n\n");

and got the 

 

\begin{enumerate}[label=\arabic*)]
\item Let a function be given: $y = \dfrac{x^{2}+4 x +7}{x +1}$.
\item Its derivative is: $y' = \dfrac{x^{2}+2 x -3}{\left(x +1\right)^{2}}$.
\item The maximum point of the graph  $ (-3; -2)$.
\end{enumerate}

 

I would like to combine all the plots into a single figure. The curves S1, S2, and S3 represent the manufacturer’s profit as Ce​ varies, and S12, S22, and S33 represent the retailer’s profit for the same changes in Ce​. I want all of these displayed together in one plot using a dual y-axis: one axis for the manufacturer’s profit and the other for the retailer’s profit, with Ce on the x-axis. How to create such a dual-axis plot with appropriate scaling so that the differences between the curves are also clearly visible.

restart

with(Optimization); with(plots); with(Student[VectorCalculus]); with(LinearAlgebra)

``

_local(Pi)

Pi

(1)

`&Pi;_12` := (0.1455251030e-2*Ce+.5352049476)*(0.369876310e-1-0.3638127575e-2*Ce)+(.8*(-.1671790360+1.121361872*Ce))*(0.1849381518e-1-0.1819063782e-2*Ce)-Ce*(0.1849381518e-1-0.1819063782e-2*Ce)

(0.1455251030e-2*Ce+.5352049476)*(0.369876310e-1-0.3638127575e-2*Ce)+(-.1337432288+.8970894976*Ce)*(0.1849381518e-1-0.1819063782e-2*Ce)-Ce*(0.1849381518e-1-0.1819063782e-2*Ce)

(2)

`&Pi;_22` := (0.1455251030e-2*Ce+.5356096675)*(0.355258312e-1-0.3638127575e-2*Ce)+(.8*(-.1184158360+1.121361872*Ce))*(0.1776291535e-1-0.1819063782e-2*Ce)-Ce*(0.1776291535e-1-0.1819063782e-2*Ce)

(0.1455251030e-2*Ce+.5356096675)*(0.355258312e-1-0.3638127575e-2*Ce)+(-0.9473266880e-1+.8970894976*Ce)*(0.1776291535e-1-0.1819063782e-2*Ce)-Ce*(0.1776291535e-1-0.1819063782e-2*Ce)

(3)

`&Pi;_32` := (0.1455251030e-2*Ce+.5356038465)*(0.355403838e-1-0.3638127575e-2*Ce)+(.8*(-.1179012835+1.121361872*Ce))*(0.1777019161e-1-0.1819063782e-2*Ce)-Ce*(0.1777019161e-1-0.1819063782e-2*Ce)

(0.1455251030e-2*Ce+.5356038465)*(0.355403838e-1-0.3638127575e-2*Ce)+(-0.9432102680e-1+.8970894976*Ce)*(0.1777019161e-1-0.1819063782e-2*Ce)-Ce*(0.1777019161e-1-0.1819063782e-2*Ce)

(4)

S12 := plot(`&Pi;_12`, Ce = 0 .. 0.9e-1, color = [red], labels = ["Ce", "Manufacturer Profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("m"),mn("W"));`]); S22 := plot(`&Pi;_22`, Ce = 0 .. 0.9e-1, color = [green], labels = ["Ce", "Manufacturer profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("m"),mn("D"));`]); S32 := plot(`&Pi;_32`, Ce = 0 .. 0.9e-1, color = [blue], labels = ["Ce", "Manufacturer profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("m"),mn("S"));`])

 

 

 

`&Pi;_1` := (-0.60726413e-1*Ce+.6173851967)*(0.1849381518e-1-0.1819063782e-2*Ce)-0.2500000000e-1*(0.1849381518e-1-0.1819063782e-2*Ce)^2

(-0.60726413e-1*Ce+.6173851967)*(0.1849381518e-1-0.1819063782e-2*Ce)-0.2500000000e-1*(0.1849381518e-1-0.1819063782e-2*Ce)^2

(5)

`&Pi;_2` := (-0.60726413e-1*Ce+.5929853242)*(0.1776291535e-1-0.1819063782e-2*Ce)-0.2500000000e-1*(0.1776291535e-1-0.1819063782e-2*Ce)^2

(-0.60726413e-1*Ce+.5929853242)*(0.1776291535e-1-0.1819063782e-2*Ce)-0.2500000000e-1*(0.1776291535e-1-0.1819063782e-2*Ce)^2

(6)

`&Pi;_3` := (-0.60726413e-1*Ce+.5932282299)*(0.1777019161e-1-0.1819063782e-2*Ce)-0.2500000000e-1*(0.1777019161e-1-0.1819063782e-2*Ce)^2

(-0.60726413e-1*Ce+.5932282299)*(0.1777019161e-1-0.1819063782e-2*Ce)-0.2500000000e-1*(0.1777019161e-1-0.1819063782e-2*Ce)^2

(7)

S1 := plot(`&Pi;_1`, Ce = 0 .. 0.9e-1, color = [yellow], labels = ["Ce", "Retailer profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("r"),mn("W"));`]); S2 := plot(`&Pi;_2`, Ce = 0 .. 0.9e-1, color = [black], labels = ["Ce", "Retailer  profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("r"),mn("D"));`]); S3 := plot(`&Pi;_3`, Ce = 0 .. 0.9e-1, color = [grey], labels = ["Ce", "Retailer profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("r"),mn("S"));`])

 

 

 

dualaxisplot(plot(`&Pi;_22`, Ce = 0 .. 0.9e-1, color = ["red"], labels = ["Ce", "Manufacturer profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("m"),mn("D"));`]), plot(`&Pi;_2`, Ce = 0 .. 0.9e-1, color = ["green"], labels = ["Ce", "Retailer profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("r"),mn("D"));`]), title = "fairnes cost Comparison")

 

display({S1, S12, S2, S22, S3, S32})

 
 

``

Download All_plots_Combined.mw

I am working in Maple 2025:

I executed the following code:

restart:
p:=int(x ** 3 + 2 * x, x);

Maple replied with:

(x^2 + 2)^2/4

I was expecting :

x^4/4+x^2

Did Maple do this integration incorrectly?

Hello! I have a simple system of linear ODEs and I am trying to solve them much like the above link ODEs were solved but I keep getting a pesky problem and no matter what I do, I can't seem to make Maple happy! Could someone take a look & see what I am doing wrong.

Thank you.

Download SimpleMarsEntryAndAeroBrakingModel.mw

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

I tried this combination of transfer functions, and it appears that the PhasePlot isn't correct.  Does anyone have any suggestions on what might be causing the issue? 

What_do_I_have_wrong_Phase_Plot.zip

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?

1 2 3 4 5 6 7 Last Page 1 of 2439