4

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

2 Answers2

4

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] *)
Natas
  • 2,310
  • 4
  • 14
  • 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

    – ayman zayed Nov 13 '20 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? – Natas Nov 14 '20 at 07:53
0

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