GuidewireSimulation
Requirements Traceability
Member GuidewireSim.ConstraintSolvingStep.CorrectBendTwistPredictions (int cylinderIndex, BSM.Quaternion[] cylinderOrientationPredictions)

The relevant entries of cylinderOrientationPredictions should be unit quaternions, i.e. have length approximately equal to one.

After the quaternion predictions got corrected, they should again be unit quaternions, i.e. have length approximately equal to one.

Member GuidewireSim.ConstraintSolvingStep.CorrectStretchPredictions (int sphereIndex, Vector3[] spherePositionPredictions, BSM.Quaternion[] cylinderOrientationPredictions)

The relevant entries of cylinderOrientationPredictions should be unit quaternions, i.e. have length approximately equal to one.

After the quaternion prediction got corrected, it should again be a unit quaternions, i.e. have length approximately equal to one.

Member GuidewireSim.ConstraintSolvingStep.SolveBendTwistConstraint (BSM.Quaternion orientationOne, BSM.Quaternion orientationTwo, Vector3 discreteRestDarbouxVector, float rodElementLength, out BSM.Quaternion deltaOrientationOne, out BSM.Quaternion deltaOrientationTwo, float inertiaWeightOne=1f, float inertiaWeightTwo=1f)

orientationOne and orientationTwo should be unit quaternions, i.e. have length approximately equal to one.

rodElementLength should be positive.

inertiaWeightOne and inertiaWeightTwo should be values between 0 and 1.

Member GuidewireSim.ConstraintSolvingStep.SolveBendTwistConstraints (BSM.Quaternion[] cylinderOrientationPredictions, int cylinderCount, Vector3[] discreteRestDarbouxVectors, float rodElementLength)

cylinderCount should be at least one.

rodElementLength should be positive.

Executes the constraint solving step in bilateral interleaving order if executeInBilateralOrder and otherwise in naive order.

Member GuidewireSim.ConstraintSolvingStep.SolveBendTwistConstraintsInBilateralOrder (BSM.Quaternion[] cylinderOrientationPredictions, int cylinderCount, Vector3[] discreteRestDarbouxVectors, float rodElementLength)

cylinderCount should be at least one.

rodElementLength should be positive.

Member GuidewireSim.ConstraintSolvingStep.SolveBendTwistConstraintsInNaiveOrder (BSM.Quaternion[] cylinderOrientationPredictions, int cylinderCount, Vector3[] discreteRestDarbouxVectors, float rodElementLength)

cylinderCount should be at least one.

rodElementLength should be positive.

Member GuidewireSim.ConstraintSolvingStep.SolveStretchConstraint (Vector3 particlePositionOne, Vector3 particlePositionTwo, BSM.Quaternion orientation, BSM.Quaternion e_3, float rodElementLength, out Vector3 deltaPositionOne, out Vector3 deltaPositionTwo, out BSM.Quaternion deltaOrientation, float inverseMassOne=1f, float inverseMassTwo=1f, float inertiaWeight=1f)

orientation should be a unit quaternions, i.e. have length approximately equal to one.

e_3 should be a unit quaternions, i.e. have length approximately equal to one.

rodElementLength should be positive.

inverseMassOne, inverseMassTwo and inertiaWeight should be values between 0 and 1.

Member GuidewireSim.ConstraintSolvingStep.SolveStretchConstraints (Vector3[] spherePositionPredictions, BSM.Quaternion[] cylinderOrientationPredictions, int spheresCount, BSM.Quaternion[] worldSpaceBasis, float rodElementLength)

spheresCount should be at least one.

rodElementLength should be positive.

Executes the constraint solving step in bilateral interleaving order if executeInBilateralOrder and otherwise in naive order.

Member GuidewireSim.ConstraintSolvingStep.SolveStretchConstraintsInBilateralOrder (Vector3[] spherePositionPredictions, BSM.Quaternion[] cylinderOrientationPredictions, int spheresCount, float rodElementLength, BSM.Quaternion e_3)

spheresCount should be at least one.

rodElementLength should be positive.

Member GuidewireSim.ConstraintSolvingStep.SolveStretchConstraintsInNaiveOrder (Vector3[] spherePositionPredictions, BSM.Quaternion[] cylinderOrientationPredictions, int spheresCount, float rodElementLength, BSM.Quaternion e_3)

spheresCount should be at least one.

rodElementLength should be positive.

Member GuidewireSim.DirectorsDrawer.CalculateArrowHeadPositions (Vector3 startPosition, Vector3 endPosition)
arrowHeadPositions has a length of 4.
Member GuidewireSim.DirectorsDrawer.DrawArrowHeadLines (int directorIndex, Vector3 endPosition, Vector3[] arrowHeadPositions)
arrowHeadPositions has a length of 4.
Member GuidewireSim.InitializationStep.InitDiscreteRestDarbouxVectors (int cylinderCount, BSM.Quaternion[] cylinderOrientations, out Vector3[] discreteRestDarbouxVectors, float rodElementLength)

cylinderCount should be at least one.

rodElementLength should be positive.

Member GuidewireSim.InitializationStep.InitSpherePositions (GameObject[] spheres, int spheresCount, out Vector3[] spherePositions)
spheresCount should be at least one.
Member GuidewireSim.MathHelper.MatrixVectorMultiplication (float[,] matrix, Vector3 vector)
matrix must be a \( 3 \times 3 \) matrix.
Member GuidewireSim.MathHelper.RandomUnitQuaternion ()
The length of the drawn quaternion is approximately equal to one.
Member GuidewireSim.SimulationLoop.AdoptCalculations ()

Sets the positions of the GameObjects spheres to spherePositions.

Calculates cylinderPositions based on spherePositions.

Sets the positions of the GameObjects cylinders to cylinderPositions.

Sets the rotations of the GameObjects cylinders to cylinderOrientations.

Member GuidewireSim.SimulationLoop.FixedUpdate ()
Execute the simulation loop if and only if ExecuteSingleLoopTest is false.
Member GuidewireSim.SimulationLoop.PerformConstraintSolvingStep ()

Performs the constraint solving of every constraint #solverStep many times.

Solve stretch constraints, if and only if solveStretchConstraints is true.

Solve bend twist constraints, if and only if solveBendTwistConstraints is true.

If solveStretchConstraints, then SpheresCount is at least two.

If solveStretchConstraints, then CylinderCount is at least one.

If solveBendTwistConstraints, then SpheresCount is at least three.

If solveBendTwistConstraints, then CylinderCount is at least two.

If solveStretchConstraints, after the step is complete the deviation between the actual rod element length and the default (rest state) rodElementLength should be close to zero.

If solveStretchConstraints, after the step is complete the deviation of the stretch constraint to zero should be close to zero.

Member GuidewireSim.SimulationLoop.PerformInitializationStep ()

Set SpheresCount to the length of spheres.

Set CylinderCount to the length of cylinders.

Call every init method of initializationStep.

Member GuidewireSim.SimulationLoop.PerformPredictionStep ()

Predict the sphereVelocities.

Predict the spherePositionPredictions.

Predict the cylinderAngularVelocities.

Predict the cylinderOrientationPredictions.

Member GuidewireSim.SimulationLoop.PerformUpdateStep ()

Upate sphereVelocities.

Upate spherePositions.

Upate cylinderAngularVelocities.

Upate cylinderOrientations.

Upate directors.

Member GuidewireSim.StressTestPerformer.PerformStressTestOne (float applyForceTime=1f)
Output a log message when no further forces are applied to the guidewire.
Member GuidewireSim.TorqueTestPerformer.PerformTorqueTestThree (Vector3 pullTorque, float applyTorqueTime=10f)
Output a log message when no further torques are applied to the guidewire.
Member GuidewireSim.TorqueTestPerformer.PerformTorqueTestTwo (Vector3 pullTorque, float applyTorqueTime=1f)
Output a log message when no further torques are applied to the guidewire.
Member UnitTest_SolveBendTwistConstraint.Test_SolveBendTwistConstraint (int iterations, BSM.Quaternion orientationOne, BSM.Quaternion orientationTwo, float rodElementLength, Vector3 discreteRestDarbouxVector, GuidewireSim.MathHelper mathHelper, GuidewireSim.ConstraintSolvingStep constraintSolvingStep)

orientationOne and orientationTwo are still unit quaternions at the end of the test.

The deviation between the bend twist constraint and zero is lower than a reasonable tolerance, i.e. close to zero., which means that the algorithm of SolveBendTwistConstraint() converges towards the fulfillment of the bend twist constraint.

Member UnitTest_SolveStretchConstraint.PickRandomPositions (out Vector3 particlePositionOne, out Vector3 particlePositionTwo)

Picks the first particle position uniformly distributed so that \( x,y,z \in [-5, 5] \).

Picks a distance between the two particles that is uniformly distributed in the interval \( [rodElementLength - maximalDistanceOffset, rodElementLength + maximalDistanceOffset] \).

Picks the second particle position uniformly distributed on the surface of the sphere with center particlePositionOne and radius startDistance.

Member UnitTest_SolveStretchConstraint.Test_SolveStretchConstraint (int iterations, Vector3 particlePositionOne, Vector3 particlePositionTwo, BSM.Quaternion orientation, GuidewireSim.MathHelper mathHelper, GuidewireSim.ConstraintSolvingStep constraintSolvingStep)

orientation is still a unit quaternion at the end of the test.

The deviation between the stretch constraint and zero is lower than the tolerance 0.1, which means that the algorithm of SolveStretchConstraint() converges towards the fulfillment of the stretch constraint.

The deviation between the actual distance of particlePositionOne and particlePositionTwo and the rest rod element length is lower than a reasonable tolerance, i.e. close to zero.