4
$\begingroup$

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

$\endgroup$
4
$\begingroup$

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] *)
$\endgroup$
2
  • $\begingroup$ 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 $\endgroup$ Nov 13 '20 at 20:06
  • $\begingroup$ @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? $\endgroup$
    – Natas
    Nov 14 '20 at 7:53

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.