# Use of variational operator, 𝛿 in Mathematica

I am working in Hamilton's principle. Part of deriving the equation of motion is to use the delta operator (𝛿) which can be operated just like a differential operator. It is not the function VariationalD in package VariationalMethods.

A post was posted regarding the same subject but it seems that who asked the question found the answer somewhere else. The previous question is here.

Example on the equation is:

T= 0.5 Mu'^2

applying the delta operator

𝛿T=M u' 𝛿 u'

I need to find the first and second variation of this function w.r.t the dependent variable.

regards

Indeed, VariationalD does perform integration by parts which might be unwanted.

For this simple univariat case, one can hack together a quick function myVariationalD:

Clear[δ, myVariationalD]
myVariationalD[expr_, f_[x_]] := Module[{maxDerivative},
maxDerivative = Max @ Cases[expr, Derivative[m_][f][x] :> m, Infinity];
D[expr, f[x]] δ[f[x]] +
Sum[D[expr, Derivative[m][f][x]] δ[Derivative[m][f][x]], {m,
1, maxDerivative}]
]


The example you have given can then be computed as

expr = 1/2 \[DoubleStruckCapitalM] u'[t]^2;
myVariationalD[expr, u[t]]
(* \[DoubleStruckCapitalM] δ[u'[t]] u'[t] *)

• Thank you Natas, What about below equation: >> T = 0.5 M D[u[t], t]^2 >> [Delta]T = D[T /. {u -> u + s [Delta]u}, s] /. s -> 0 Commented Nov 13, 2020 at 20:06
• @aymanzayed Sorry, but I don't quite understand what you are asking. Perhaps you can modify your question and explain in detail the expected output for a given input and I can then edit my answer? Commented Nov 14, 2020 at 7:53

I am also working on Hamilton's Principle to derive the governing equation of beam. After evaluating the strain and kinetic energy, I am combining both the energies. Now I want to apply the variational operator on my Hamilton's principle. The strain energy and kinetic energy terms contain the five variables such as u[x,t], v[x,t], w[x,t],Theta[x,t] and Phi[x,t].

How I can get the governing equation with these five variables? The Strain energy terms are as follows:

D00 ks \[Theta][x, t]^2 + D00 \[Phi][x, t]^2 + B00
\!$$\*SuperscriptBox[\(u$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]^2 - 2 D00 \[Phi][x, t]
\!$$\*SuperscriptBox[\(v$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t] + D00
\!$$\*SuperscriptBox[\(v$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]^2 - 2 D00 ks \[Theta][x, t]
\!$$\*SuperscriptBox[\(w$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t] + D00 ks
\!$$\*SuperscriptBox[\(w$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]^2 - 2 B10
\!$$\*SuperscriptBox[\(u$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]
\!$$\*SuperscriptBox[\(\[Theta]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t] + B20
\!$$\*SuperscriptBox[\(\[Theta]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]^2 - 2 B01
\!$$\*SuperscriptBox[\(u$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]
\!$$\*SuperscriptBox[\(\[Phi]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t] - 2 B01 \[Theta][x, t]
\!$$\*SuperscriptBox[\(u$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]
\!$$\*SuperscriptBox[\(\[Phi]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t] + 2 B10 \[Phi][x, t]
\!$$\*SuperscriptBox[\(u$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]
\!$$\*SuperscriptBox[\(\[Phi]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t] + B11
\!$$\*SuperscriptBox[\(\[Theta]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]
\!$$\*SuperscriptBox[\(\[Phi]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t] + B20
\!$$\*SuperscriptBox[\(\[Theta]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]
\!$$\*SuperscriptBox[\(\[Phi]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t] + B11 \[Theta][x, t]
\!$$\*SuperscriptBox[\(\[Theta]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]
\!$$\*SuperscriptBox[\(\[Phi]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t] + B20 \[Theta][x, t]
\!$$\*SuperscriptBox[\(\[Theta]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]
\!$$\*SuperscriptBox[\(\[Phi]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t] - 2 B20 \[Phi][x, t]
\!$$\*SuperscriptBox[\(\[Theta]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]
\!$$\*SuperscriptBox[\(\[Phi]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t] + B11
\!$$\*SuperscriptBox[\(\[Phi]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]^2 + 2 B11 \[Theta][x, t]
\!$$\*SuperscriptBox[\(\[Phi]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]^2 + B11 \[Theta][x, t]^2
\!$$\*SuperscriptBox[\(\[Phi]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]^2 - B11 \[Phi][x, t]
\!$$\*SuperscriptBox[\(\[Phi]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]^2 - B20 \[Phi][x, t]
\!$$\*SuperscriptBox[\(\[Phi]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]^2 - B11 \[Theta][x, t] \[Phi][x, t]
\!$$\*SuperscriptBox[\(\[Phi]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]^2 - B20 \[Theta][x, t] \[Phi][x, t]
\!$$\*SuperscriptBox[\(\[Phi]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]^2 + B20 \[Phi][x, t]^2
\!$$\*SuperscriptBox[\(\[Phi]$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]^2

• This doesn't appear to be an answer to the original question, rather a question in its own right. You should post it as a question and delete this 'answer'. Commented Jan 6, 2022 at 15:13
• This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From Review Commented Jan 6, 2022 at 16:54