SetDrivingVariables

SetDrivingVariables[linkage, {varixi..}]
sets the pose value of vari driving variable to xi in linkage and returns the modified LinkageData.
SetDrivingVariables[linkage, {x1, x2, .}]
sets the pos values {x1,x2,..} to driving variables {var1,var2,..} of linkage and returns the modified LinkageData.
  • The linkage argument of the function is a LinkageData object.
  • If linkage contains $LDDerivedparametersB record, the value of the derived parameters are re-calculated with the new driving variable using FindRoot function.
  • The new derived parameters are calculated by solving their constraint equations. The solution utilize the FindRoot function. The default initial guess for the root finding are the current values of the parameters. One can reset any of the default initial guess values by setting the ParameterInitialGuess option.
  • If the JointLimitCheck option is True, only those driving variables are updated, that do not exceed their limits. The joint limits are specified in the $LDLowOrderJoint record.
  • The following selected option can be defined:
ParameterInitialGuessAutomaticSpecifies the intial values used in root finding.
JointLimitCheckFalseSwitches on/off the limit check of driving variables
AccuracyGoalAutomaticSpecifies how many effective digits of accuracy should be sought in the final result during root finding.
MaxIterations100Specifies the maximum number of iterations that should be tried during root finding.
PrecisionGoalAutomaticSpecifies how many effective digits of precision should be sought in the final resul during root findingt
  • SetDrivingVariables accepts all options of FindRoot function
Load LinkageDesigner package
In[1]:=
Click for copyable input
Define a 4-bar mechanism
In[2]:=
Click for copyable input
Out[2]=
Set the 1 driving variables to 90°. The resulted linkage is stored in pose1 variable.
In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
Out[4]=
The initial guess for the SetDrivingVariables function is the actual values of the variables in $LDDerivedParametersB record.
In[5]:=
Click for copyable input
Out[5]=
The new values of the $LDDerivedParametersB record
In[6]:=
Click for copyable input
Out[6]=
Set the 1 driving variables to 90° by using the ParameterInitialGuess option with {3→1}. The resulted linkage is stored in pose2 variable.
In[7]:=
Click for copyable input
Out[7]=
Display pose2 linkage
In[8]:=
Click for copyable input
Out[8]=
In[9]:=
Click for copyable input
Out[9]=
Display the two linkages (pose1 and pose2) together
In[10]:=
Click for copyable input
Out[10]=