SolveLagrangian

SolveLagrangian[linkage, {t, start, end}]
function calculates the Lagrangian of the linkage, define the Lagrange's equations and numerically differentiateit. It returns the list of interpolation functions of the driving variables.
SolveLagrangian[linkage, {lagrangian}, {t, start, end}]
Lagrangian of the linkage can be passed as second argument of the function. The function generates Lagrange's equations based on the lagrangian.
  • If linkage has $LDTorques or $LDForces records they are taken into account as the Lagrange's equation is derived.
  • Lagrangian () is calculated from the kinetical energy ( T) and potential energy (V) as
  • = T - V
  • The Lagrange' equations are calculated as :
  • , where
  • qi is the i-th generalized coordinate
  • Qi is the i-th generalized force
  • The following options of NDSolve can be given:
AccuracyGoalAutomaticAccuracyGoal is an option for various numerical operations which specifies how many effective digits of accuracy should be sought in the final result.
CompiledAutomaticCompiled is an option for various numerical and plotting functions which specifies whether the expressions they work with should automatically be compiled.
DependentVariablesAutomaticDependentVariables is an option which specifies the list of all objects that should be considered as dependent variables in equations that have been supplied.
EvaluationMonitorNoneEvaluationMonitor is an option for various numerical computation and plotting functions that gives an expression to evaluate whenever functions derived from the input are evaluated numerically.
InterpolationOrderAutomaticInterpolationOrder is an option for Interpolation, as well as ListLinePlot, ListPlot3D, ListContourPlot and related functions, that specifies what order of interpolation to use.
MaxStepFraction1 -- 10MaxStepFraction is an option to functions like NDSolve that specifies the maximum fraction of the total range to cover in a single step.
MaxSteps10000MaxSteps is an option to functions like NDSolve that specifies the maximum number of steps to take in generating a result.
MaxStepSizeAutomaticMaxStepSize is an option to functions like NDSolve that specifies the maximum size of a single step used in generating a result.
MethodAutomaticMethod is an option for various algorithm-intensive functions that specifies what internal methods they should use.
NormFunctionAutomaticNormFunction is an option for functions such as FindFit and NDSolve which gives a function to be minimized in generating results.
PrecisionGoalAutomaticPrecisionGoal is an option for various numerical operations which specifies how many effective digits of precision should be sought in the final result.
SolveDelayedAutomaticSolveDelayed is an option to NDSolve. SolveDelayed -> False causes the derivatives to be solved for symbolically at the beginning. SolveDelayed -> True causes the ODEs to be evaluated numerically and the derivatives solved for at each step.
StartingStepSizeAutomaticStartingStepSize is an option to NDSolve and related functions that specifies the initial step size to use in trying to generate results.
StepMonitorNoneStepMonitor is an option for iterative numerical computation functions that gives an expression to evaluate whenever a step is taken by the numerical method used.
WorkingPrecisionMachinePrecisionWorkingPrecision is an option for various numerical operations which specifies how many digits of precision should be maintained in internal computations.
Load LinkageDesigner package
In[1]:=
Click for copyable input
Load the example double pendulum linkage
In[2]:=
Click for copyable input
Out[2]=
Define two spring damper torque on the two links
In[3]:=
Click for copyable input
Display the mechanism
In[4]:=
Click for copyable input
Out[4]=
Set the driving velocities to 0. These values will be used as initial velocities at start time.
In[5]:=
Click for copyable input
Out[5]=
Set the driving variables to 15° and 45° respectively these value will be used as initial values at start time
In[6]:=
Click for copyable input
Out[6]=
Solve the Lagrangian's equation fro (0,10) interval
In[7]:=
Click for copyable input
Out[7]=
Plot the time function of the generalized coordinates
In[8]:=
Click for copyable input
Out[8]=
Animate the linkage
In[9]:=
Click for copyable input
Out[9]=