MaplePrimes Questions

Hello
I would like to write a Maple program that gives me all possible sums >=  a given maximum maxsum and with and odd number q >= 3 of distinct summands from a given list. q can be 3, 5, 7, .. t, where t is odd and depends on L and max.

Example:
maxsum:=97, L := [9,15,21,25,27,33,35,39,45,49,51,55,57,63,65,69,75,77,81,85,87].

Here t= 3 and only q=3 is possible. In the final version of the program the list L and the maxsum will be much larger, so that the sums for every odd q =3, 5, 7, ..., t.

I tried to write a code for this basic case:

q := 3:
p := 91:
L := [9,15,21,25,27,33,35,39,45,49,51,55,57,63,65,69,75,77,81,85,87]:
M := []:

NestedLoops := proc(startIndex, remainingDepth, currentSum)
    local i;
    if remainingDepth = 0 then
        if currentSum <= p then
            M := [op(M), currentSum]:
        end if;
        return:
    end if;

    for i from startIndex to nops(L) - remainingDepth + 1 do
        NestedLoops(i + 1, remainingDepth - 1, currentSum + L[i]):
    od;
end proc:

NestedLoops(1, q, 0);
M;

The result ist "[]". What is wrong? How would be a correct and efficient version?

Thanks for helping me.

Do you think could be a bug in dsolve? 

restart;

interface(version);

`Standard Worksheet Interface, Maple 2025.0, Linux, March 24 2025 Build ID 1909157`

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1861 and is the same as the version installed in this computer, created 2025, April 10, 15:58 hours Pacific Time.`

restart;

ode:=x^2+3*x*diff(y(x),x)=y(x)^3+2*y(x);
DEtools:-odeadvisor(ode);
dsolve([ode,y(1)=1],[Abel])

x^2+3*x*(diff(y(x), x)) = y(x)^3+2*y(x)

[_rational, _Abel]

Error, (in dsolve) numeric exception: division by zero

 

 

Download dsolve_division_by_zero_abel_april_16_2025.mw

If I do not tell it to use Abel, then dsolve does not give divison by zero.

Maple 2025 on Linux

As shown in the paper, and in many similar ones, the authors use a particular method that I believe is related to the long wave limit. I’m familiar with other approaches, but the traditional methods haven’t been successful in this case. This author, along with a few others, has tried applying this long wave limit approach, though many papers don’t explicitly mention the substitutions they use to arrive at the lump solution.

I’ve been able to separately find the lump series, but for some of the other solutions, we first need to figure out how to derive this key result. Once that part is clear, the rest should be easier to handle. I've been working through everything step by step and have managed to reproduce many of the solutions from the paper.

Also i don't know how finding (eq17) in paper, which they found by apply long wave limit to (eq7) in paper

additionaly How finding line which i think they found by finding velocity?

Please, if you have any information or insight into how we can obtain this more difficult result, I would really appreciate your help.

restart

with(PDEtools)

with(LinearAlgebra)

NULL

with(SolveTools)

_local(gamma)

NULL

declare(u(x, y, z, t))

u(x, y, z, t)*`will now be displayed as`*u

(1)

declare(f(x, y, z, t))

f(x, y, z, t)*`will now be displayed as`*f

(2)

alpha := 1; beta := 1; delta := 1; lambda := 1

1

 

1

 

1

 

1

(3)

pde := diff(diff(u(x, y, z, t), t)+6*u(x, y, z, t)*(diff(u(x, y, z, t), x))+diff(u(x, y, z, t), `$`(x, 3)), x)-lambda*(diff(u(x, y, z, t), `$`(y, 2)))+diff(alpha*(diff(u(x, y, z, t), x))+beta*(diff(u(x, y, z, t), y))+delta*(diff(u(x, y, z, t), z)), x)

diff(diff(u(x, y, z, t), t), x)+6*(diff(u(x, y, z, t), x))^2+6*u(x, y, z, t)*(diff(diff(u(x, y, z, t), x), x))+diff(diff(diff(diff(u(x, y, z, t), x), x), x), x)-(diff(diff(u(x, y, z, t), y), y))+diff(diff(u(x, y, z, t), x), x)+diff(diff(u(x, y, z, t), x), y)+diff(diff(u(x, y, z, t), x), z)

(4)

thetai := t*w[i]+x*k[i]+y*l[i]+z*r[i]+eta[i]

eq15 := w[i] = -(k[i]^4+k[i]^2+k[i]*l[i]+k[i]*r[i]-l[i]^2)/k[i]

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

A[sj] := (3*k[i]^4*k[j]^2-6*k[i]^3*k[j]^3+(3*k[j]^4+l[j]^2)*k[i]^2-2*k[i]*k[j]*l[i]*l[j]+k[j]^2*l[i]^2)/(3*k[i]^4*k[j]^2+6*k[i]^3*k[j]^3+(3*k[j]^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1]-eta[1]*k[1])/k[1]-(t*k[2]^4+t*k[2]^2+t*k[2]*l[2]+t*k[2]*r[2]-t*l[2]^2-x*k[2]^2-y*k[2]*l[2]-eta[2]*k[2])/k[2])}

(8)

eq1 := eval(F222, {eta[1] = -1, eta[2] = -1, k[1] = K[1]*epsilon, l[1] = L[1]*epsilon, r[1] = R[1]*epsilon})

exp(-(epsilon^4*t*K[1]^4+epsilon^2*t*K[1]^2+epsilon^2*t*K[1]*L[1]+epsilon^2*t*K[1]*R[1]-epsilon^2*t*L[1]^2-epsilon^2*x*K[1]^2-epsilon^2*y*K[1]*L[1]+epsilon*K[1])/(K[1]*epsilon))+(3*K[1]^4*epsilon^4*k[2]^2-6*K[1]^3*epsilon^3*k[2]^3+(3*k[2]^4+l[2]^2)*K[1]^2*epsilon^2-2*K[1]*epsilon^2*k[2]*L[1]*l[2]+k[2]^2*L[1]^2*epsilon^2)*exp(-(epsilon^4*t*K[1]^4+epsilon^2*t*K[1]^2+epsilon^2*t*K[1]*L[1]+epsilon^2*t*K[1]*R[1]-epsilon^2*t*L[1]^2-epsilon^2*x*K[1]^2-epsilon^2*y*K[1]*L[1]+epsilon*K[1])/(K[1]*epsilon)-(t*k[2]^4+t*k[2]^2+t*k[2]*l[2]+t*k[2]*r[2]-t*l[2]^2-x*k[2]^2-y*k[2]*l[2]+k[2])/k[2])/(3*K[1]^4*epsilon^4*k[2]^2+6*K[1]^3*epsilon^3*k[2]^3+(3*k[2]^4+l[2]^2)*K[1]^2*epsilon^2-2*K[1]*epsilon^2*k[2]*L[1]*l[2]+k[2]^2*L[1]^2*epsilon^2)+exp(-(t*k[2]^4+t*k[2]^2+t*k[2]*l[2]+t*k[2]*r[2]-t*l[2]^2-x*k[2]^2-y*k[2]*l[2]+k[2])/k[2])

(9)

G := limit(eq1, epsilon = 0)

exp(-(t*k[2]^4+t*k[2]^2+t*k[2]*l[2]+t*k[2]*r[2]-t*l[2]^2-x*k[2]^2-y*k[2]*l[2]+2*k[2])/k[2])+exp(-1)+exp(-(t*k[2]^4+t*k[2]^2+t*k[2]*l[2]+t*k[2]*r[2]-t*l[2]^2-x*k[2]^2-y*k[2]*l[2]+k[2])/k[2])

(10)

Download LWL.mw

Where is my question ?  
No reason to delete this...nothing copy righted code 

Hello! How can I plot a tiling of regular 6-gons in Maple, and paint it using three colors?

Maybe someone would be so kind as to share the code for such a tiling.

in try to figure out why in some function i can find this critical point for ploting i need that point , untill now i just find in one function and other i can't and my program not runing for other and really this is make problem for my invistigation i want to fixed that and i upload that file i did and that file i can't find it for , thanks for any help?

line-undone.mw

Line-1-Done.mw

I can't find the help page for Abel second kind, class B. 

Maple has help page for Abel second kind, class A and Abel second kind, class C. But not for class B. 

Here is an example of Abel second kind class B

ode:=(3*t*y(t)+y(t)^2)+(t^2+t*y(t))*diff(y(t),t)=0;
DEtools:-odeadvisor(ode)

I wanted to know the difference and the transformation used for class B to make it Abel first kind.

I googled and can't find it. Also local help skips over class B.

Is this documented somewhere else?

btw, find error on the help page for class A. Transformation used is wrong. Will leave this for another question.

I'm not currently working on the topic of fluids and I'm not very familiar with it. However, my partner is working on it and is using other software. They have a question about whether Maple can handle this kind of work. Are there any examples available? I’d appreciate any help

thanks!

Dear Maple experts,

is there a possibility/command to get a vizualization of the output of the command FeedbackConnect?

I was thinking of something like this:


as it is given on the maple-help page for that command (but not generated via a maple command as far as I understood)

Thanks in advance !

I have repeatedly seen this on two Windows PCs:

The assignement operator := is rendered as a roman d

This happens after using Maple for some time.
 Exiting Maple and restart of Maple is required. Has someone noticed the same?
All on Windows 10 and for sure in screen reader mode (my default, cannot report on the new GUI).

Please, I am encountering error trying to run these codes for sensitivity analysis using the formula for sensitivity analysis

``

restart;

#
# Set up numerical values for all problem parameters
#
  params:=[ Lambda__p=100,         gamma__B=0.05,      gamma__B=0.05,
                 gamma__C=0.01, omega__C=0.001,  omega__B=0.001,
            sigma__B=0.0001,     sigma__C=0.01, sigma__BC=0.01,
                theta__B=0.8,     theta__C=0.5,      mu__C=1.0,
              Lambda__A=1.0,       Lambda__w=1.0,   varphi__8.33,
            mu__A=1.0, mu__w=1.0, alpha__B=0.005, alpha__C=0.005, alpha__BC=0.15, Zeta__B=0.5, Zeta__C=0.5, delta__A=0.66, delta__w=1.33
          ]:

#
# Define main function
#
  R:= (varphi^2*theta__B*Lambda__p*alpha__B*Lambda__A)/((mu__c*mu__A*N__p^2)*(mu__A*mu__c+mu__A*omega__B+mu__A*sigma__B+mu__c*delta__A+delta__A*omega__B+delta__A*sigma__B));

varphi^2*theta__B*Lambda__p*alpha__B*Lambda__A/(mu__c*mu__A*N__p^2*(mu__A*mu__c+mu__A*omega__B+mu__A*sigma__B+mu__c*delta__A+delta__A*omega__B+delta__A*sigma__B))

(1)

#
# Compute "all" derivatives and evaluate numerically.
#
# For the purposes of this calculation "all"
# derivatives, means the derivatives with respect to
# every variable returned by indets(R, name)
#
# Output a list of two element lists where each of
# the latter is
#
# [ varName,
#   eval( diff( R, varName), params )
# ]
#
 [ seq( [j, eval( diff( R, j), params )],j in indets(R, name))];

Error, invalid input: eval expects its 2nd argument, eqns, to be of type {integer, equation, set(equation)}, but received [Lambda__p = 100, gamma__B = 0.5e-1, gamma__B = 0.5e-1, gamma__C = 0.1e-1, omega__C = 0.1e-2, omega__B = 0.1e-2, sigma__B = 0.1e-3, sigma__C = 0.1e-1, sigma__BC = 0.1e-1, theta__B = .8, theta__C = .5, mu__C = 1.0, Lambda__A = 1.0, Lambda__w = 1.0, 33*varphi__8, mu__A = 1.0, mu__w = 1.0, alpha__B = 0.5e-2, alpha__C = 0.5e-2, alpha__BC = .15, Zeta__B = .5, Zeta__C = .5, delta__A = .66, delta__w = 1.33]

 

#
# Compute all "sensitivities" (where the sensitivity
# is as defined in Rouben Rostamian response to the
# OP's earlier post) and evaluate numerically.
#
# For the purposes of this calculation "all" sensitivities
# means the sensitivity with respect to every variable
# returned by indets(R, name)
#
# Output a list of two element lists where each of
# the latter is
#
# [ varName,
#   eval( varName*diff( R, varName)/R, params )
# ]
#
  seq( [j, eval( j*diff( R, j)/R, params )],j in indets(R, name));

Error, invalid input: eval expects its 2nd argument, eqns, to be of type {integer, equation, set(equation)}, but received [Lambda__p = 100, gamma__B = 0.5e-1, gamma__B = 0.5e-1, gamma__C = 0.1e-1, omega__C = 0.1e-2, omega__B = 0.1e-2, sigma__B = 0.1e-3, sigma__C = 0.1e-1, sigma__BC = 0.1e-1, theta__B = .8, theta__C = .5, mu__C = 1.0, Lambda__A = 1.0, Lambda__w = 1.0, 33*varphi__8, mu__A = 1.0, mu__w = 1.0, alpha__B = 0.5e-2, alpha__C = 0.5e-2, alpha__BC = .15, Zeta__B = .5, Zeta__C = .5, delta__A = .66, delta__w = 1.33]

 

Download Computed_Sensitivity_Analys_for_CBD.mw

Dear Maple experts,

I try to avoid the generation of new variable names (for states, inputs, outputs) introduced automatically by maple (StateSpace(), FeedbackConnect()) in the two (connected) cases:

1)

I generated a discrete StateSpace system using a difference equation:

sys2 := StateSpace([u(n)=K_virt*(q_a(n)-q_d)+D_virt*(q_a(n)-q_a(n-1))/T],inputvariable=[q_a(n)],outputvariable=[u(n)],discrete=true,sampletime=T);

The statevariable "x1(n)" is automatically generated by maple

I tried to avoid this by using the following commands that don't work:

sys2 := StateSpace([u(n)=K_virt*(q_a(n)-q_d)+D_virt*(q_a(n)-q_a(n-1))/T],inputvariable=[q_a(n)],outputvariable=[u(n)],statevariable=[q_a(n-1)],discrete=true,sampletime=T);

-> error message:

Error, (in ProcessOptions) argument 'statevariable = [q_a(n-1)]' invalid: rhs should be of type list({name, anyfunc(name)})

sys2 := StateSpace([u(n)=K_virt*(q_a(n)-q_d)+D_virt*(q_a(n)-q_a(n-1))/T],inputvariable=[q_a(n)],outputvariable=[u(n)],statevariable=[q_a_delayed],discrete=true,sampletime=T);

-> error message:

Error, (in DynamicSystems:-StateSpace) missing state(s): {q_a_delayed(n)}

sys2 := StateSpace([u(n)=K_virt*(q_a(n)-q_d)+D_virt*(q_a(n)-q_a(n-1))/T],inputvariable=[q_a(n)],outputvariable=[u(n)],statevariable=[q_a_delayed(n)],discrete=true,sampletime=T);

-> error message:

Error, (in DynamicSystems:-StateSpace) missing state(s): {q_a_delayed(n)}

Can you help me here?

2)

I have two discrete StateSpace models (sys1, sys2):

* sys2 is the one from above (1 input, 1 output, 1 state)

* sys1 (2 inputs, 4 outputs, 4 states) doesn't contain any automatically generated variables (I obtained this one by transforming a continuous statespace model to a discrete one)

* variables that represent the same signal have the same name in both systems.

   -> "q_a(n)" appears as an output in sys1 and as an input in in sys2

   -> "u(n)"     appears as an input in sys1 and as an output in in sys2

Now I combined these two models via:

FeedbackConnect([sys1, sys2],[[2,2,1,-1]])

Instead of using the variable names I introduced maple generates new variable names for inputs, outputs and states.

How can I avoid this?

(the option "merge=evaluate") seems not to work (even if I work with numeric values for the system parameters instead of symbols)

Thank you in advance!

It seems that the new Ribbon interface has several bugs (probably an update will come soon). So, not only the Export As is not working, but I see that (at least in Windows), opening a worksheet with a large output will display the output using the Maple input font.
Just save a .mw with the content:

expand((x+1)^200);

and then open it.

in this example is so different solution How i can get directly answer of this kind of ode equation when contain complicate term

restart; ode := 6*x*y(x)^2+4*x^3*y(x)+(6*x^2*y(x)+x^4+exp(y(x)))*(diff(y(x), x)) = 0; with(DEtools, odeadvisor); Student:-ODEs:-Type(ode); W := dsolve(ode, y(x)); odetest(W, ode)

0

(1)

NULL

Download ode.mw

hello everyone,

I am a bit shortsighted even with my glasses.

So my question is easy :: is there a way that when I open a (new) worksheet the magnification is 150%.

I can do it easily by hand but I am looking for 'something' in my maple.ini file to do this?

As well with the help pages.

Because even if I have a 150% magnification and I call a help page the display is still 100 % not 150%.

A part that I would like to set for every session a Digits:16 .

In the .ini file where I must input this? A ";" or not?

Thank you veru much.

Jean-Michel

5 6 7 8 9 10 11 Last Page 7 of 2413