MaplePrimes Questions

Search Questions:

is been a while i work on it but i can't figure out where is problem and even my solution is so far from it when numerically i tested , i got same outcome as the paper did maybe is  long but it is same and maybe have some typical different but they are same , the problem in here is that which when i substitue is not my answer i don't know where is my mistake ?

pde-te.mw

f18.mw

f19.mw

I recently attempted to Fourier Transform the LommelS1 function using Maple. After loading

restart;
with(inttrans);
[addtable, fourier, fouriercos, fouriersin, hankel, hilbert, invfourier, invhilbert, invlaplace, invmellin, laplace, mellin,   savetable, setup]

the command did not work on LommelS1, after several attempts. I then used the 1F2 hypergeometric definition of LommelS1, and tried
fourier (t^(mu + 1)*hypergeom([1], [3/2 + nu/2 + mu/2, 3/2 - nu/2 + mu/2], -t^2/4)/((mu - nu + 1)*(mu + nu + 1)), t, w)

and after about 6 attempts of restart thru to fourier(...), it finally gave me about 30 lines of output, which simplified to about 8 lines, then subsequently simplified symbolically to two final lines of output- but I haven't been able to reproduce the result since (after about 20 attempts), so it really makes me question the algorithm, its implementation and its stability, or am I missing something here??

The plot in the attached file only works if the complete function expression is entered. If only the function name is entered, no plot appears. What am I doing wrong?test.mw

restart;

c(x)dsum(sin(10^k*x)/10^k, k = 1 .. 10^2)

plot(c(x), x = -(1/4)*Pi .. (1/4)*Pi)

 

``

c(x)dsum(sin(10^k*x)/10^k, k = 1 .. 10^2)

plot(sum(sin(10^k*x)/10^k, k = 1 .. 10^2), x = -(1/4)*Pi .. (1/4)*Pi)

 

 

NULL

Download test.mw

Dear All,

I am currently encountering an issue while solving my boundary value problem in Maple. The following error message appears:
"Error, (in dsolve/numeric/bvp) cannot determine a suitable initial profile; please specify an approximate initial solution."

This problem arises when I attempt to generate plots by varying the parameters λl, λu, βl, βu, etc.

Lamda_l_new.mw


I recently got access to a 12-core Intel MacPro with 64 GB main memory. This motivated me to try parallel programming again, even though in prior years I have never been successfull. The project I am trying to do is particle tracking through a circular accelerator, an embarassingly parallel problem in the sense that you can track n particles in parallel through your machine for many turns and then gather up the results for analysis. The function describing the tracking is a 6-component polynomial function acting on 6-vectors and yielding a 6-Vector as a result. Each accelerator component (magnet, drift section, rf, ...) is described by such a function. I am simplifying this a bit here, but in the problem at hand this is what I am doing. The point is that each particle gets treated independently from the others, hence parallelization should be trivial.

Using an existing package (Lattice, which I published with Maple) as framework I set this up such that the tracking proc for n turns of one particle in the accelerator is a member of a module. This module is in the body of a proc and gets returned when the proc is called, essentially instantiating the tracking object and assigning it to a Vector with as many elements as I have particles to track. The tracking function returns a 6-Vector with the coordinates after all turns are complete. 
A separate proc does the instantiation of all tracking objects, gives each one its particle number (from a Beam object it is being given) and sends it off using Threads:-Create. It then waits until every task is done (using Threads:-Wait) and assembles the result in another Beam object which it returns. Please refer to the enclosed Maple worksheet for how it is done.

This actually all appears to work. MacOS is 15.7.2 (Sequoia); Maple is 2023.2. The results are identical both parallel and serial.

The "interesting" result however, is that usage of the available CPU cores saturates at about 4. In the graph shown below, the green line shows the CPU usage of the mserver process, and it saturates between 400 & 500%, actually going down to 360% as more particles get added. 100% is one core, so I am never getting more than about 4 cores to work for me. Correspondingly, the no. of seconds per particle goes up from about 3 s (particle 1 to 4) up to about 15 s/particle, settling at about 10 s/particle as 12 particles are approached. Below is a graph against no. of particles (n) of running time (red), CPU time (dark blue), CPU usage (yellow) and # or mkernel threads (green). 

Bottom line: I am only getting 4 cores out of the 12. Process limits of MacOS (ulimit -a) do not indicate any limit that would cause this (and I have had build jobs that would merrily use all 12 cores).

Is there a limit in Maple that prevents using all available cores? Am I doing something inefficient that could cause this?? This is the first time I actually got parallel operations in Maple to work, so I am happy about that, but my happiness is tempered by not getting it to work at the level I was aiming for. I did google around a bit and found some prior conversations on MP (mostly involving @acer and @Carl Love) about parallel threads which indicated that (a) environment variable OMP_NUM_THREADS should be set and (b) that numcpus can only be set at the very beginning of a Maple session (which I interpret as "right after firing up Maple"). Did both (and verified the settings were in) but no change in behaviour of this code; I only get four cpu cores to work.

Thanks,

Mac Dude

Parallel_tracking_attempt.mw

Edit: Added graph, fixed up graph.

I do not think I've ever seen this before.

I have Maple set up to use one engine per one worksheet.

 

Today, when I tried to open new worksheet (after Maple had an internal error running some code in another worksheet), I was not able to execute anything in the new worksheet. I get this message

Looking at task manager, I see the front end running at high CPU

Stange thing, there was nothing else running at the time.

Had to kill all of Maple.

Just wondering if any one saw this message before and what could cause it?

I'll try to see if I can reproduce it again by running same code which caused that initial Maple error in the first worksheet. But as I said, this is the first I see such a problem in Maple.

I was connected to the network at the time, if this makes any difference.

I want the Minkowski metric in spherical coordinates, so I do the following:

restart;

with(Physics):

Setup(coordinatesystems=spherical,signature=`-+++`);

`Systems of spacetime coordinates are:`*{X = (t, r, theta, phi)}

 

[coordinatesystems = {X}, signature = `- + + +`]

(1)

g_[lineelement]

-Physics:-d_(t)^2+Physics:-d_(r)^2+Physics:-d_(theta)^2+Physics:-d_(phi)^2

(2)

 

Which is not correct, it should return:

-d_(t)^2 + d_(r)^2 + r^2*d_(theta)^2 + r^2*sin(theta)^2*d_(phi)^2

Any ideas why it is giving the wrong answer? I usually just define my metric manually, but I was curious why this is occuring. I also noticed something else strange: after running the worksheet, if I go back to the setup line and execute, it will return the correct expression! But if I execute restart and then Setup again, wrong answer. 

Any thoughts would be appreciated, thanks! 

What is the opinion here on the following. If given   A which is linear in x, but not simplified. now type(A,x) gives false.  But type(simplify(A),x) gives true.

Does this mean it is the user responsibility to simplify the expression first before calling type on it? 

Why does not type command do this internally to see if it is linear before deciding? What is the reason for this design choice?

interface(version);

`Standard Worksheet Interface, Maple 2025.2, Windows 10, November 11 2025 Build ID 1971053`

restart;

 

A:=(x+y+1)^2-(x+y-1)^2;

(x+y+1)^2-(x+y-1)^2

simplify(A);

4*x+4*y

type(A,linear(y))

false

type(simplify(A),linear(y))

true

type(A,linear(x))

false

type(simplify(A),linear(x))

true

 

 

Download why_simplify_is_needed_feb_9_2026.mw

Hi,

I’m trying to transpose an existing animation that connects the unit circle to the graphs of cos⁡(θ)\ and sin⁡(θ)\ into a complex-numbers visualization, so that students can clearly see the link between

z=eiθ=cos⁡θ+isin⁡θ,arg⁡(z)=θ,∣z∣=1

and the corresponding real/imaginary components.

Goal: a dynamic view where a point z(θ) moves on the unit circle in the complex plane while (simultaneously)

  • the projections show ℜ(z)=cos⁡θ\  and ℑ(z)=sin⁡θ,

  •  the graphs of cos⁡θ and sin⁡θ are traced against θ\,

  • and/or the angle θ\ and argument are displayed in a clean, didactic way.

To better illustrate my objective, here is the link to the target animation I would like to transpose: 

Illustration

Thank you in advance for your insights and feedback.

Animation_Question.mw

I have created three random variables:  r, theta and phi.  That went as I expected.  I then did some math with these random variable.  I calculated the following:  sin(phi), sin(theta), cos(phi) and cos(theta).

When I viewed the PDFs of these above four, I get what I expected with the exception of sin(theta).  I got an error message telling me that I provided three arguments when Maple expected only two arguments.  I am confused as to why this happened.

I wonder if I broke any rules when I named these variables, but I don't know...any suggestions? My work is attached.

with(Statistics)

theta := RandomVariable(Uniform(0, 2*Pi))

_R

(1)

phi := arccos(-1+2*RandomVariable(Uniform(0, 1)))

arccos(-1+2*_R0)

(2)

r := RandomVariable(Uniform(0, 1))^(1/3)

_R1^(1/3)

(3)

SinPhi := sin(phi)

2*(-_R0^2+_R0)^(1/2)

(4)

PDF(SinPhi, t)

piecewise(t <= 0, 0, t < (1/2)*4^(1/2), t/(-t^2+1)^(1/2), (1/2)*4^(1/2) <= t, 0)

(5)

SinTheta := sin(theta)

sin(_R)

(6)

PDF(SinTheta, t)

Error, (in Statistics:-PDF) invalid input: type expects 2 arguments, but received 3

 

CosPhi := cos(phi)

-1+2*_R0

(7)

PDF(CosPhi, t)

(1/2)*piecewise((1/2)*t < -1/2, 0, (1/2)*t < 1/2, 1, 0)

(8)

CosTheta := cos(theta)

cos(_R)

(9)

PDF(CosTheta, t)

piecewise(t <= -1, 0, t < 1, 1/(Pi*(-t^2+1)^(1/2)), 1 <= t, 0)

(10)
 

NULL

Download Basics.mw

Could someone suggest a way to help dsolve be able to obtain this solution to this complicated first order ode? In V 2025.2 it is not able to solve it as is

interface(version);

`Standard Worksheet Interface, Maple 2025.2, Windows 10, November 11 2025 Build ID 1971053`

ode:=-x*sqrt((1 - x)/(x + 1))*(x + 1)*arcsech(x)*diff(y(x), x)*exp(y(x)/arcsech(x) + exp(y(x)/arcsech(x))) - y(x)*exp(y(x)/arcsech(x) + exp(y(x)/arcsech(x))) + 2*x*sqrt((1 - x)/(x + 1))*(x + 1)*arcsech(x)^2 = 0;

-x*((1-x)/(x+1))^(1/2)*(x+1)*arcsech(x)*(diff(y(x), x))*exp(y(x)/arcsech(x)+exp(y(x)/arcsech(x)))-y(x)*exp(y(x)/arcsech(x)+exp(y(x)/arcsech(x)))+2*x*((1-x)/(x+1))^(1/2)*(x+1)*arcsech(x)^2 = 0

sol:=dsolve(ode);

expected_sol:=y(x)=arcsech(x)*ln(ln(2*x+_C1));

y(x) = arcsech(x)*ln(ln(2*x+_C1))

odetest(expected_sol,ode) assuming x>0

0

 

 

Download ode_solution_feb_6_2026.mw

Instead of

if not(type(expr,atomic))...

I would like to use something like that for better readabilty

if type(expr,composite)...

where "composite" is a placeholder for beeing not atomic.

Does anyone have any exoerience playing with this topic?

I have the functions dx(t), dt(t), and dz(t).  They are all the same function.  I constructed the dz(t) function as a piecewise function, then copied it to dx(t) and dy(t).  The area under the function curves sum to one as I would expect.

How can I convert these functions into a PDF form so that I can perform mathematical operations on the PDFs, such as add the PDFs to create another PDF?

SphereFinal.mw

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