1
$\begingroup$

I see this variational problem here.

The functional is : $$J(y)=y^{2}(x_{0})+\int_{x_{0}}^{x_{1}}(xy+y'^{2}) dx$$ In the textbook, the result of finding the functional variation according to the functional variation defined by Lagrange is :

enter image description here

The variation sign δ has the following basic operational properties :

enter image description here enter image description here enter image description here enter image description here

How to use MMA to define a correlation function and find the variation of this function according to the definition of Lagrange?

I really want to solve this problem, but when I replace y with y+ε*δ, it can't be expanded linearly, so I can't do further calculation.

f[x] /. f :> f + ε*δ
f'[x] + f[x] /. f :> f + ε*δ

I want to get the following result according to the linear operation rule of variation mentioned above:

f[x] + ε*δ f[x]
(f'[x] + ε*δ f'[x]) + (f[x] + ε*δ f[x])

But the above code cannot be expanded obviously. Please help me.

The title of the book is 《变分法基础》, the author is 老大中. And the relevant content is on page 59 to page 63.

enter image description here

You can get a photocopy of this book from here. The password of the online disk is wthj.

$\endgroup$
5
  • 2
    $\begingroup$ have you seen EulerEquations? $\endgroup$ Feb 21 '20 at 3:03
  • $\begingroup$ @AccidentalFourierTransform Yes. I've seen the built-in VariationalMethods function package, but I want to do a similar custom function to solve variational problem according to the textbook definition. $\endgroup$ Feb 21 '20 at 3:07
  • 1
    $\begingroup$ Please provide the title and author of the textbook. $\endgroup$
    – LouisB
    Feb 21 '20 at 3:34
  • 1
    $\begingroup$ @LouisB I'm sorry, the textbook is written in Chinese. The title of the book is called《变分法基础》, the author is 老大中 and the relevant content is from page 59 to page 63. $\endgroup$ Feb 21 '20 at 3:39
  • $\begingroup$ What is the desired result? $\endgroup$ Feb 21 '20 at 8:14
2
$\begingroup$

To obtain the formal variation for the given functional we can use

J[y_, x_, x0_, x1_] := (y^2 /. {x -> x0}) + Integrate[x y + D[y, x]^2, {x, x0, x1}]
varJ[J_, y_, x_, x0_, x1_] := D[J[y + epsilon delta[y], x, x0, x1], epsilon] /. {epsilon -> 0}

varJ[J, y[x], x, x0, x1]

Regarding the result obtained

$$ \delta J(y) = 2\delta(y(x_0))y(x_0)+\int_{x_0}^{x_1}(x\delta(y)+2\delta'(y)(y')^2)dx $$

NOTE

The operator should be able to detect

$$ \delta'(y)(y')^2 = (\delta(y))'y' = (\delta(y)y')'-\delta(y)y'' $$

concluding with

$$ \int_{x_0}^{x_1}(x\delta(y)+2\delta'(y)(y')^2)dx = \int_{x_0}^{x_1}(x-2y'')\delta(y)dx-\delta(y)y'|_{x_0}^{x_1} $$

$\endgroup$
5
  • $\begingroup$ Thanks a lot. But your variational sign $δ$ does not perform the variational correlation operation like the differential sign $d$, and the result is not consistent with that in the textbook. $\endgroup$ Feb 21 '20 at 2:04
  • 2
    $\begingroup$ The operator $\delta(y)$ performs an action very similar to a differentiation. With the results in hand, we can choose which properties apply. $\endgroup$
    – Cesareo
    Feb 21 '20 at 9:59
  • $\begingroup$ This is what I mean. Can you write down the specific implementation process? $\endgroup$ Feb 21 '20 at 10:10
  • 1
    $\begingroup$ Please. See attached note. $\endgroup$
    – Cesareo
    Feb 21 '20 at 11:11
  • $\begingroup$ Thank you very much, but the result of the code above is 2 y[x0] delta[y[x0]] + Integrate[(2 Derivative[1][y][x]^2 Derivative[1][delta][y[x]] + x delta[y[x]]) \[DifferentialD]x, {x, x0, x1}], while the result of the textbook is 2 y[x0] delta[y[x0]] + Integrate[(2 Derivative[1][y][x] Derivative[1][delta][y[x]] + x delta[y[x]]) \[DifferentialD]x, {x, x0, x1}], they are slightly different.How to modify them to be the same? $\endgroup$ Feb 22 '20 at 7:26
1
$\begingroup$

I am not sure if VariationalMethods`VariationalD works properly for this problem, but worthy of trying, I suppose.

<< VariationalMethods`

Clear[J]
J = y[x0]^2 + Integrate[x y[x] + y'[x]^2, {x, x0, x1}];

VariationalD[J, y[x], x]

1/2 (-x0^2 + x1^2)

$\endgroup$
2
  • 1
    $\begingroup$ I want a result like I want a result like 2 y[x0] δ[y[x0]] + Integrate[(x δ[y[x]] + 2 Derivative[1][y][x] δ[y'[x]]), {x, x0, x1}] or 2 y[x0] δ[y[x0]] + Integrate[(x δ[y[x]] + 2 Derivative[1][y][x] δ'[y[x]]), {x, x0, x1}] . $\endgroup$ Feb 21 '20 at 9:54
  • $\begingroup$ @PleaseCorrectGrammarMistakes OK, VariationalD returns the variational derivative, which is not what you want for the moment. $\endgroup$ Feb 21 '20 at 11:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.