Question: Maximizing, with a constraint

...and starting values. I want to reproduce the maximum in Maple using the solution structure in the attached file, similar to the old Mathcad method. Instead of using the Euler-Lagrange equation, I want to separately enter the objective function, then the boundary conditions, and finally the starting values ​​for an iteration (as was done in the old Mathcad solution block). I entered the latter into the "maximize" command using the Maple help text. But nothing is being calculated. What am I doing wrong? As I said, I only want a numerically generated approximate solution.test.mw

restart

kernelopts(version)

`Maple 2026.0, X86 64 WINDOWS, Mar 05 2026, Build ID 2001916`

(1)

interface(version)

`Standard Worksheet Interface, Maple 2026.0, Windows 11, March 05 2026 Build ID 2001916`

(2)

with(VariationalCalculus)

[ConjugateEquation, Convex, EulerLagrange, Jacobi, Weierstrass]

(3)

with(plots, implicitplot)

[implicitplot]

(4)

with(Optimization)

 

assume(x >= 0, y(x) >= 0)

"p(a,b,c,x):=a∗x^(2)+b∗x+c;"

proc (a, b, c, x) options operator, arrow, function_assign; a*x^2+b*x+c end proc

(5)

" q(d,f,x):=d∗x^(2)+f∗x;"

proc (d, f, x) options operator, arrow, function_assign; d*x^2+f*x end proc

(6)

"yn(a,b,c,d,f,g,x):=p(a,b,c,x)∗exp(q(d,f,x))+g;"

proc (a, b, c, d, f, g, x) options operator, arrow, function_assign; p(a, b, c, x)*exp(q(d, f, x))+g end proc

(7)

" wn(a,b,c,d,f,g,xend):=(∫)[0]^(xend)x∗yn(a,b,c,d,f,g,x)ⅆx;"

proc (a, b, c, d, f, g, xend) options operator, arrow, function_assign; int(x*yn(a, b, c, d, f, g, x), x = 0 .. xend) end proc

(8)

"constr(a,b,c,d,f,g,xend):=(∫)[0]^(xend)(sqrt(1+((ⅆ)/(ⅆx)(yn(a,b,c,d,f,g,x)))^(2))-50)ⅆx=0;"

proc (a, b, c, d, f, g, xend) options operator, arrow, function_assign; int(sqrt(1+(diff(yn(a, b, c, d, f, g, x), x))^2)-50, x = 0 .. xend) = 0 end proc

(9)

 

maximize(wn(a, b, c, d, f, g, xend), constr(a, b, c, d, f, g, xend), initialpoint = {a = -0.2e-1, b = 1.06, c = 0.14e-2, d = 0.46e-3, f = -0.12e-2, g = -0.14e-2, xend = 30})

maximize(-(1/16)*(8*a*xend^2*(-d)^(11/2)*exp(d*xend^2+f*xend)-8*g*xend^2*(-d)^(13/2)+4*a*f*xend*(-d)^(9/2)*exp(d*xend^2+f*xend)+8*b*xend*(-d)^(11/2)*exp(d*xend^2+f*xend)+2*exp(d*xend^2+f*xend)*(-d)^(7/2)*a*f^2+4*b*f*(-d)^(9/2)*exp(d*xend^2+f*xend)+8*c*(-d)^(11/2)*exp(d*xend^2+f*xend)-erf((1/2)*(2*d*xend+f)/(-d)^(1/2))*Pi^(1/2)*exp(-(1/4)*f^2/d)*d^3*a*f^3+2*erf((1/2)*(2*d*xend+f)/(-d)^(1/2))*Pi^(1/2)*exp(-(1/4)*f^2/d)*d^4*b*f^2-4*erf((1/2)*(2*d*xend+f)/(-d)^(1/2))*Pi^(1/2)*exp(-(1/4)*f^2/d)*d^5*c*f+8*a*(-d)^(9/2)*exp(d*xend^2+f*xend)+erf((1/2)*f/(-d)^(1/2))*Pi^(1/2)*exp(-(1/4)*f^2/d)*a*f^3*d^3-2*erf((1/2)*f/(-d)^(1/2))*Pi^(1/2)*exp(-(1/4)*f^2/d)*b*f^2*d^4+4*erf((1/2)*f/(-d)^(1/2))*Pi^(1/2)*exp(-(1/4)*f^2/d)*c*f*d^5-2*a*f^2*(-d)^(7/2)-4*b*f*(-d)^(9/2)-8*c*(-d)^(11/2)+6*erf((1/2)*(2*d*xend+f)/(-d)^(1/2))*Pi^(1/2)*exp(-(1/4)*f^2/d)*d^4*a*f-4*erf((1/2)*(2*d*xend+f)/(-d)^(1/2))*Pi^(1/2)*exp(-(1/4)*f^2/d)*d^5*b-6*erf((1/2)*f/(-d)^(1/2))*Pi^(1/2)*exp(-(1/4)*f^2/d)*a*f*d^4+4*erf((1/2)*f/(-d)^(1/2))*Pi^(1/2)*exp(-(1/4)*f^2/d)*b*d^5-8*a*(-d)^(9/2))/(-d)^(13/2), int((1+((2*a*x+b)*exp(d*x^2+f*x)+(a*x^2+b*x+c)*(2*d*x+f)*exp(d*x^2+f*x))^2)^(1/2)-50, x = 0 .. xend) = 0, initialpoint = {a = -0.2e-1, b = 1.06, c = 0.14e-2, d = 0.46e-3, f = -0.12e-2, g = -0.14e-2, xend = 30})

(10)

 

Download test.mw

Please Wait...