Alfred_F

Mr. Alfred Flaßhaar

525 Reputation

11 Badges

1 years, 237 days
Brandenburg, Germany
As a retired individual with degrees from German universities in mathematics/analysis and structural engineering, I spent my professional life in responsible positions in research, teaching, and practical application, working on the mathematical modeling of states and processes in real-world systems. Now I have the time to explore interesting mathematical problems using Maple. It is my professional curiosity that drives me.

MaplePrimes Activity


These are questions asked by Alfred_F

...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

With thanks to @sand and @janhardo for their help in solving a variational problem using Maple, I'm presenting a puzzle worth remembering. It was originally published in an IBM competition over 20 years ago under simpler conditions than those presented here, and later posed in a more challenging form in private circles:

A farmer wants to buy a section of a large meadow/pasture for his sheep. He likes a lone, large oak tree on the meadow. This tree is to be the starting and ending point of the fence around the desired section. The fence is exactly 100 meters long. The farmer creates a sketch of the situation. He places the oak tree at the origin of a Cartesian coordinate system with a positive y-axis pointing north and sketches the estimated location of the desired meadow section east of the oak tree. The seller then stipulates that the price per square meter increases linearly eastward by a factor of 1/m³. An agreement is reached, and the farmer now considers the optimal route for the fence to maximize the return on his investment.

The fence route without corners and the value of the purchased meadow must be calculated.

In the attached file, I would like to evaluate the integral according to (16) and the minimum according to (17). I would appreciate your help. The goal is to calculate the coefficients a and b.

Euler_eq.mw

In the attached file test1, two terms are to be compared using the "is" function. Theoretically, these terms are equal. A plot is provided for illustration. However, regardless of which symbol ("equal," "not equal," etc.) is used in "is," the result is always "false." What am I doing wrong?

restart

simplify(exp(u)/(1+exp(u))^2)

exp(u)/(1+exp(u))^2

(1)

is(exp(u)/(1+exp(u))^2 = 1/(4*cosh((1/2)*u)^2))

false

(2)

plot([exp(u)/(1+exp(u))^2, 1/(4*cosh((1/2)*u)^2)], u)

 

NULL

Download test1.mw

According to the help text in Maple 2024.2, a number of classical integral equations can be solved using "intsolve". The Volterra equation of the first kind, with an upper limit of integration x, is of particular interest. A long time ago, I had to solve a similar equation. This one arose from a model of a real-world process, but instead of x, the upper limit of integration was the function y(x), which I had to calculate. I painstakingly solved it to a good approximation. Is there an algorithm in Maple that can at least calculate an approximate solution, or is a numerical solution, e.g., using Ritz, the only option?

edited: I forgot to upload an example

 test.mw

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