Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I have functions using define_external to call a .dll  In uploaded file "dll_test.mw" I'm showing one such function.  Immediately after defining the function I call it and it works.  There are a lot more similarly defined functions and once defined in the worksheet they are working as hoped. 

My question is can I make the functions avaliable across multiple worksheets somehow?  google ai suggested using "read" but in uploaded file "read and load test.mw" you can see that it's not working for me.  using read I get an error I don't understand and using load doesn't return an error but it also doesn't result in an executable KinAddCurveData function.

Any help would be very appreciated.

KinAddCurveData := define_external('AddCurveData', 'LIB' = "C:\\Users\\tom\\Documents\\Excel docs\\kinexa dll solver\\equilibriumdll\\Equilibrium.dll")

NULL

KinAddCurveData()

 

NULL

Download dll_test.mw

read "C:/Users/tom/Documents/maple docs/KinExA tools/dll_test.mw"

Error, on line %1, syntax error, character `?` unexpected:

 

<?xml version="1.0" encoding="UTF-8"?>
 ^

 

Error, while reading `%1`

 

load("C:/Users/tom/Documents/maple docs/KinExA tools/dll_test.mw")

load("C:/Users/tom/Documents/maple docs/KinExA tools/dll_test.mw")

(1)

KinAddCurveData()

KinAddCurveData()

(2)

jhdladjkh()

jhdladjkh()

(3)
 

NULL

Download read_and_load_test.mw

I ran the Fourier Transform about 6 months ago.

>

>

The out put was 23 lines long, and then used the Simplify/Simplify option for the result to obtain

, a relatively easier result.

I tried to re-run it today but it just gave me

with the result

Do you have any idea as to why this happens?? I seem to recall there may be similar “memory” problem

that occurred in the past.

HIPT.mw

Could you please help me to solve this error.

In this example by applying the substitution i can get half of paicewise function but how get another  half ? i am looking for B_rs as Piecewise function ?

restart

eij := ((-3*k[i]*(k[i]-k[j])*l[j]+beta)*l[i]^2-(2*(-3*k[j]*(k[i]-k[j])*l[j]*(1/2)+beta))*l[j]*l[i]+beta*l[j]^2)/((-3*k[i]*(k[i]+k[j])*l[j]+beta)*l[i]^2-(2*(3*k[j]*(k[i]+k[j])*l[j]*(1/2)+beta))*l[j]*l[i]+beta*l[j]^2)

((-3*k[i]*(k[i]-k[j])*l[j]+beta)*l[i]^2-2*(-(3/2)*k[j]*(k[i]-k[j])*l[j]+beta)*l[j]*l[i]+beta*l[j]^2)/((-3*k[i]*(k[i]+k[j])*l[j]+beta)*l[i]^2-2*((3/2)*k[j]*(k[i]+k[j])*l[j]+beta)*l[j]*l[i]+beta*l[j]^2)

(1)

eval(eij, k[j] = b*k[i]); series(%, k[i], 3); convert(%, polynom); eval(%, b = k[j]/k[i]); Bij := (%-1)/(k[i]*k[j])

((-3*k[i]*(-b*k[i]+k[i])*l[j]+beta)*l[i]^2-2*(-(3/2)*b*k[i]*(-b*k[i]+k[i])*l[j]+beta)*l[j]*l[i]+beta*l[j]^2)/((-3*k[i]*(b*k[i]+k[i])*l[j]+beta)*l[i]^2-2*((3/2)*b*k[i]*(b*k[i]+k[i])*l[j]+beta)*l[j]*l[i]+beta*l[j]^2)

 

series(1+((-3*(-b+1)*l[j]*l[i]^2+3*b*(-b+1)*l[j]^2*l[i]+3*(b+1)*l[j]*l[i]^2+3*b*(b+1)*l[j]^2*l[i])/(beta*l[i]^2-2*beta*l[i]*l[j]+beta*l[j]^2))*k[i]^2+O(k[i]^4),k[i],4)

 

1+(-3*(-b+1)*l[j]*l[i]^2+3*b*(-b+1)*l[j]^2*l[i]+3*(b+1)*l[j]*l[i]^2+3*b*(b+1)*l[j]^2*l[i])*k[i]^2/(beta*l[i]^2-2*beta*l[i]*l[j]+beta*l[j]^2)

 

1+(-3*(-k[j]/k[i]+1)*l[j]*l[i]^2+3*k[j]*(-k[j]/k[i]+1)*l[j]^2*l[i]/k[i]+3*(k[j]/k[i]+1)*l[j]*l[i]^2+3*k[j]*(k[j]/k[i]+1)*l[j]^2*l[i]/k[i])*k[i]^2/(beta*l[i]^2-2*beta*l[i]*l[j]+beta*l[j]^2)

 

(-3*(-k[j]/k[i]+1)*l[j]*l[i]^2+3*k[j]*(-k[j]/k[i]+1)*l[j]^2*l[i]/k[i]+3*(k[j]/k[i]+1)*l[j]*l[i]^2+3*k[j]*(k[j]/k[i]+1)*l[j]^2*l[i]/k[i])*k[i]/((beta*l[i]^2-2*beta*l[i]*l[j]+beta*l[j]^2)*k[j])

(2)

simplify((-3*(-k[j]/k[i]+1)*l[j]*l[i]^2+3*k[j]*(-k[j]/k[i]+1)*l[j]^2*l[i]/k[i]+3*(k[j]/k[i]+1)*l[j]*l[i]^2+3*k[j]*(k[j]/k[i]+1)*l[j]^2*l[i]/k[i])*k[i]/((beta*l[i]^2-2*beta*l[i]*l[j]+beta*l[j]^2)*k[j]))

6*l[j]*l[i]*(l[i]+l[j])/((l[i]-l[j])^2*beta)

(3)


Download Lim.mw

Determine the analytic function whose real part is 𝑢(𝑥, 𝑦) = sin2𝑥/cosh2𝑦–cos2𝑥

using Direct method

The Maplesoft Physics Updates, introduced over a decade ago, brought with them an innovative concept: to deliver fixes and new developments continuously, as soon as they enter the development version of the Maple library for the next release. A key aspect of this initiative was prioritizing the resolution of issues reported on MaplePrimes, ensuring that fixes became available to everyone within 24 to 48 hours. Initially focused solely on the Physics package, the scope of the updates quickly expanded to include other parts of the Maple library and the Typesetting system.

This initiative, which I developed outside regular work hours, aimed to enhance the Maple experience—where issues encountered in daily use could be resolved almost immediately, minimizing disruptions and benefiting the entire user community through shared updates.

As of January 1st, I have stepped away from my role at Maplesoft and have been increasingly involved in activities unrelated to Maple. This raises the question of what will happen with the Physics Updates for Maple 2025 and after.

The Physics project remains a unique and personally meaningful endeavor for me. So, for now, I will continue to dedicate some time to these Updates—but only for the Physics package, not for other parts of the library. As before, these fixes and developments will be included in the Physics Updates only after they have been integrated into the development version of Maple’s official library for the next release. In that sense, they will continue to be Maplesoft updates.

On that note, the first release of the Physics Updates for Maple 2025—focused solely on the Physics package—went out today as version 1854. To install it, the first time open Maple 2025 and use the Maplecloud toolbar -> Packages, or else input PackageTools:-Install(5137472255164416). Any next time, just enter Physics:-Version(latest)

As for fixes beyond the Physics package, I understand that Maplesoft is exploring the possibility of offering something similar to what was previously delivered through the Maplesoft Physics Updates.

All the best

PS: to install the last version of the Maplesoft Physics Updates for Maple 2024, open Maple and input Physics:-Version(1852), not 1853.
 
Edgardo S. Cheb-Terrab
Physics, Differential Equations, and Mathematical Functions
Maplesoft Emmeritus
Research and Education—passionate about all that.

Hey everyone,
I am trying to find the roots of a very large polynomial, specifically targeting the leading Fisher's zero (the root with the smallest positive imaginary part). I'm using Maple's RootFinding[Analytic] package with Digits := 10, but the results only show 5-digit accuracy (see the attached file plz)

  1. Why does RootFinding[Analytic] fail to achieve full 10-digit precision despite the Digits setting? Are there hidden limitations or optional parameters to improve this?

  2. Are there alternative methods in Maple to accurately locate only the leading zero (without computing all roots in a region)?
    Root_Poly.mw

In 1D-Math an inert division can be entered as an infix operator using "%/"

The same sequence of chracters does not work the same way in 2D-Math

In 2D-Math I have to use

Is there an infix division operator in 2D-Math?

Is there a helppage describing %arithop and the like?

I was reading a book on complex analysis, and I tried to answer some questions like "Find and plot the sixth roots of unity on Maple."  I tried the following code, which works. Is there any other way to solve and plot the same question?

with(plots); interface(imaginaryunit = 'I'); s := [seq(exp(2*I*Pi*k*(1/6)), k = 0 .. 5)]; X := [seq(Re(s[k]), k = 1 .. 6)]; Y := [seq(Im(s[k]), k = 1 .. 6)]

[1, 1/2+((1/2)*I)*3^(1/2), -1/2+((1/2)*I)*3^(1/2), -1, -1/2-((1/2)*I)*3^(1/2), 1/2-((1/2)*I)*3^(1/2)]

 

[1, 1/2, -1/2, -1, -1/2, 1/2]

 

[0, (1/2)*3^(1/2), (1/2)*3^(1/2), 0, -(1/2)*3^(1/2), -(1/2)*3^(1/2)]

(1)

UnitCircle := plot([cos(t), sin(t), t = 0 .. 2*Pi], color = gray, linestyle = dash); RootsPlot := pointplot([X, Y], symbol = solidcircle, color = blue, symbolsize = 10); display(UnitCircle, RootsPlot, scaling = constrained, title = "6th Roots of Unity")

 

NULL


 

Download 6th_roots_of_unity.mw

Hello everyone,

I want to plot some 2D polygon shapes in one plot. Every shape should have their own color. 
for example: from the Plasma colorschem "Plasma 212" 

Can somebody give me an example code ?

Thanks 

Best regards Jannis

Hello,

I have several sets of nonlinear equations that need to be solved for certain unknowns. In many cases, the equations admit more than one solution, and Maple is sometimes able to find different solutions by changing the order of the unknowns.

However, in one particular case, I haven't been able to get Maple to find a known solution that was obtained elsewhere.

Below are the equations, the list of unknowns, the solution returned by Maple, and the alternative solution I'm trying to obtain.

Is there a way to guide Maple to find this other solution?

 

eqjerkAB:=[-alpha[9, 1, 1] - alpha[9, 2, 2] - alpha[9, 3, 3] = -alpha[14, 1, 1] - alpha[14, 2, 2] - alpha[14, 3, 3], alpha[9, 1, 1] + alpha[9, 2, 2] = alpha[14, 1, 1] + alpha[14, 2, 2], -alpha[9, 2, 6]*alpha[9, 3, 5] = -alpha[14, 2, 6]*alpha[14, 3, 5], alpha[9, 1, 1]*alpha[9, 3, 3] + alpha[9, 2, 2]*alpha[9, 3, 3] = alpha[14, 1, 1]*alpha[14, 3, 3] + alpha[14, 2, 2]*alpha[14, 3, 3], alpha[9, 1, 1]*alpha[9, 2, 6]*alpha[9, 3, 5] - alpha[9, 1, 2]*alpha[9, 2, 6]*alpha[9, 3, 4] = alpha[14, 1, 1]*alpha[14, 2, 6]*alpha[14, 3, 5], -alpha[9, 1, 1]*alpha[9, 2, 2]*alpha[9, 3, 3] - alpha[9, 1, 2]*alpha[9, 2, 6]*alpha[9, 3, 0] = -alpha[14, 1, 1]*alpha[14, 2, 2]*alpha[14, 3, 3] + alpha[14, 1, 2]*alpha[14, 2, 1]*alpha[14, 3, 3]]:
incA:={alpha[9, 1, 1], alpha[9, 1, 2], alpha[9, 2, 2], alpha[9, 2, 6], alpha[9, 3, 0], alpha[9, 3, 3], alpha[9, 3, 4], alpha[9, 3, 5]}:
solM:=[alpha[9, 1, 1] = (alpha[9, 1, 2]*alpha[9, 2, 6]*alpha[9, 3, 4] + alpha[14, 1, 1]*alpha[14, 2, 6]*alpha[14, 3, 5])/(alpha[14, 2, 6]*alpha[14, 3, 5]), alpha[9, 1, 2] = alpha[9, 1, 2], alpha[9, 2, 2] = (-alpha[9, 1, 2]*alpha[9, 2, 6]*alpha[9, 3, 4] + alpha[14, 2, 2]*alpha[14, 2, 6]*alpha[14, 3, 5])/(alpha[14, 2, 6]*alpha[14, 3, 5]), alpha[9, 2, 6] = alpha[9, 2, 6], alpha[9, 3, 0] = alpha[14, 3, 3]*(-alpha[14, 1, 2]*alpha[14, 2, 1]*alpha[14, 2, 6]^2*alpha[14, 3, 5]^2 + alpha[9, 1, 2]*alpha[14, 3, 5]*alpha[9, 2, 6]*alpha[9, 3, 4]*(alpha[14, 1, 1] - alpha[14, 2, 2])*alpha[14, 2, 6] + alpha[9, 1, 2]^2*alpha[9, 2, 6]^2*alpha[9, 3, 4]^2)/(alpha[9, 1, 2]*alpha[9, 2, 6]*alpha[14, 3, 5]^2*alpha[14, 2, 6]^2), alpha[9, 3, 3] = alpha[14, 3, 3], alpha[9, 3, 4] = alpha[9, 3, 4], alpha[9, 3, 5] = alpha[14, 2, 6]*alpha[14, 3, 5]/alpha[9, 2, 6]]:
solother:={alpha[9,2,2]=-alpha[9,1,1] + alpha[14,1,1] + alpha[14,2,2],
alpha[9,3,0] = (((alpha[9,1,1] - alpha[14,1,1])*(alpha[9,1,1] - alpha[14,2,2]) - alpha[14,1,2]*alpha[14,2,1])*alpha[14,3,3])/(alpha[9,1,2]*alpha[9,2,6]),
alpha[9,3,3] = alpha[14,3,3],
alpha[9,3,4] = (alpha[9,1,1] - alpha[14,1,1])*alpha[14,2,6]*alpha[14,3,5]/(alpha[9,1,2]*alpha[9,2,6]),
alpha[9,3,5] = alpha[14,2,6]*alpha[14,3,5]/alpha[9,2,6]}:

Many thanks.

Ed
 

I want to run Maple Linux builds under Windows. I know that this can be done with a virtual machine but that's it.

Are there other options to do that?

I would go for an easy installation with the possibilty to save and load files from the Windows file system and ideally to copy/paste screen content from and to Windows applications.

Any recommendations and/or references?

i did this question before but i didn't get any answer before, but the shape of question is different, the function is different this time i try 3 term like they mention in that paper so there  must be a way for finding R[2],R[1], and R[0] 

Download Find-U-in-PDE.mw

why i get error in end and how i can fix this error?

restart

with(PDEtools)

undeclare(prime, quiet); declare(u(x, y, t), quiet); declare(f(x, y, t), quiet)

theta := i -> t*w[i]+y*l[i]+x:

eqf := f(x, y, t) = theta(1)*theta(2)+Bij(1, 2):

eqfcomplex := eval(eqf, l[2] = conjugate(l[1])):

eq17 := u(x, y, t) =2*diff(f(x, y, t), x)/f(x, y, t):

equ := eval(eq17, eqfcomplex):

sys := map(normal, {diff(rhs(equ), x), diff(rhs(equ), y)}):

nsys  := map(numer, sys):
nroot := solve(nsys, {x, y}, explicit):

dsys  := map(denom, sys):
droot := solve(dsys, {x, y}, explicit):

{nroot} intersect {droot}

{}

(1)

compact_ans1 := nroot[1]:

__w := seq(w[i] = (-beta*l[i]^2 - b*l[i] - a), i=1..2):

__Bij := (i,j) -> 12*alpha/(beta*(l[i] - l[j])^2):

eval(eval(compact_ans1, {__w, Bij(1, 2) = __Bij(1, 2)}), l[1]=lambda[1]+I*lambda[2])
assuming lambda[1]::real, lambda[2]::real:
 

ans1 := map(simplify, %, size): # it's up to you to use another simplification strategy

eqp1 := eval(eval(ans1, l[2] = conjugate(l[1])), l[1] = lambda[1]+I*lambda[2])

NULL

# Do the same for the other nroot solutions

eqp := {x = xp+((1/2)*beta*lambda[2]^3+I*(-beta*lambda[1]-b)*lambda[2]^2*(1/2)-((1/2)*beta*conjugate(lambda[1]+I*lambda[2])^2-(1/2)*beta*lambda[1]^2+(1/2)*b*conjugate(lambda[1]+I*lambda[2])+a)*lambda[2]+I*lambda[1]*(conjugate(lambda[1]+I*lambda[2])-lambda[1])*(beta*conjugate(lambda[1]+I*lambda[2])+beta*lambda[1]+b)*(1/2))*t/lambda[2], y = yp-(I*beta*lambda[2]^2+(2*beta*lambda[1]+b)*lambda[2]+I*((conjugate(lambda[1]+I*lambda[2])+lambda[1])*beta+b)*(conjugate(lambda[1]+I*lambda[2])-lambda[1]))*t/(2*lambda[2])}

NULL

vx, vy := diff(eval(x, eqp), t), diff(eval(y, eqp), t); dydx := simplify(vy/vx)

eqfp := dchange(eqp, eqfcomplex, [xp, yp], params = [a, b, alpha, beta, `&lambda;__1`, `&lambda;__2`], simplify); eq17p := dchange(eqp, eq17, [xp, yp], params = [a, b, alpha, beta, `&lambda;__1`, `&lambda;__2`], simplify); eqt := simplify(eval(eq17p, eqfp))

eqt1 := eval(subs({xp = x, yp = y}, eqt), l[1] = lambda[1]+I*lambda[2])

with(plots); lambda[1] := .14; lambda[2] := .68; alpha := -.46; beta := 1.83; a := 1.56; b := -.19; eq := y = (-beta*conjugate(lambda[1]+I*lambda[2])^2-b*conjugate(lambda[1]+I*lambda[2])-beta*lambda[2]^2+I*(2*beta*lambda[1]+b)*lambda[2]+lambda[1]*(beta*lambda[1]+b))*(x+(2*I)*sqrt(3)*lambda[1]*sqrt(alpha/(beta*(lambda[1]+I*lambda[2]-conjugate(lambda[1]+I*lambda[2]))^2))/lambda[2])/((lambda[1]+I*lambda[2])*beta*conjugate(lambda[1]+I*lambda[2])^2+(lambda[1]+I*lambda[2])*b*conjugate(lambda[1]+I*lambda[2])-I*beta*lambda[2]^3+(-beta*lambda[1]-b)*lambda[2]^2+I*(-beta*lambda[1]^2+2*a)*lambda[2]-beta*lambda[1]^3-b*lambda[1]^2); U := proc (x, y, a, b, alpha, beta, `&lambda;__1`, `&lambda;__2`) options operator, arrow; rhs(eqt1) end proc; contour1 := contourplot(eval(U(x, y, a, b, alpha, beta, `&lambda;__1`, `&lambda;__2`), t = -50), x = -200 .. 200, y = -100 .. 100, contours = 30, color = red, grid = [100, 100], transparency = .1); contour2 := contourplot(eval(U(x, y, a, b, alpha, beta, `&lambda;__1`, `&lambda;__2`), t = 0), x = -200 .. 200, y = -100 .. 100, contours = 30, color = green, grid = [100, 100], transparency = .1); contour3 := contourplot(eval(U(x, y, a, b, alpha, beta, `&lambda;__1`, `&lambda;__2`), t = 50), x = -200 .. 200, y = -100 .. 100, contours = 30, color = blue, grid = [100, 100], transparency = .1); trajectory_plot := implicitplot(eq, x = -200 .. 200, y = -200 .. 200, color = black, thickness = 1); T := textplot([[100, 45, "t=50", color = blue], [45, -10, "t=0", color = green], [-100, -45, "t=-50", color = red]], font = [Times, Roman, 16]); display(contour1, contour2, contour3, trajectory_plot, T, labels = ["x", "y"], scaling = constrained, size = [1200, 800])

.14

 

.68

 

-.46

 

1.83

 

1.56

 

-.19

 

y = (.4755583090+0.*I)*(x+(-0.+.1517971372*I)*3^(1/2))

 

proc (x, y, a, b, alpha, beta, lambda__1, lambda__2) options operator, arrow; rhs(eqt1) end proc

 

Error, (in plot/iplot2d) invalid input: Plot:-ColorBar expects its 2nd argument, ymin, to be of type numeric, but received infinity

 

Error, (in plot/iplot2d) invalid input: Plot:-ColorBar expects its 2nd argument, ymin, to be of type numeric, but received infinity

 

Error, (in plot/iplot2d) invalid input: Plot:-ColorBar expects its 2nd argument, ymin, to be of type numeric, but received infinity

 

Error, (in plots:-display) expecting plot structure but received: contour1

 
8

Download line-plot.mw

( squircle is the humoristic name for the 2D open ball of center 0 and radius 1 in Ln norm ).
The equation of the squircle in Ln norm writes  |x|n+|y|n = 1

The attached file gives the exact values of the areas of squircles in norms L2L4L100L1
Unless for n=2 the results are dramatically poor (evalf/Int gives the same wrong results).

The function a(n) gives the exact expression of the squircle area in  Ln norm.

squircle.mw

First 11 12 13 14 15 16 17 Last Page 13 of 2206