Application Center - Maplesoft

App Preview:

Applications of Numerical Continuation, ODE-IVP Approach

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

Image 

Applications of Numerical Continuation 

ODE-IVP Approach 

Hakan Tiftikci
Turkey
hakan.tiftikci@yahoo.com.tr
 

Introduction  

In this  application, numerical continuation is applied to surface-surface intersection problem and kinematic analysis of a common mechanism called fourbar. There are numerous approaches to solve Numerical Continuation problem [Eugene,Kurt]. Approach employed in this work is to convert (nonlinear) equation system to a differential system which in turn describes an ODE-IVP problem, where initial condition comes from any solution on the continuation determined.
 

Overview of Numerical Continuation 

Numerical continuation methods follow the solution of one-parameter-family multivariate equation system as the parameter is varied continuously (or updated by small amounts). Symbolically such system is described by Typesetting:-mrow(Typesetting:-mi(Typesetting:-mrow(Typesetting:-mi(In usual form, Typesetting:-mrow(Typesetting:-mi( and there are Typesetting:-mrow(Typesetting:-mi( equations in Typesetting:-mrow(Typesetting:-mi( unknowns so that for a fixed values of parameter Typesetting:-mrow(Typesetting:-mi(, system becomes square and determinate. As the parameter Typesetting:-mrow(Typesetting:-mi( is varied, point(s)/solution(s) of the system of equations trace the locus of solution as a curve in Typesetting:-msup(Typesetting:-mi(. If Typesetting:-mrow(Typesetting:-mi( then the system is either underdetermined or overdetermined and usual procedure may be applied in least-square sense (using Moore-Penrose pseudoinverse as in Newton iteration). 

 

Typical introductory illustration in literature involves solving a multivariate equation system Typesetting:-mrow(Typesetting:-mi(in presence of another "simpler" equation system Typesetting:-mrow(Typesetting:-mi(whose solution is available or easier to solve than the original. In that case, the so-called "homotopy" function defined by Typesetting:-mrow(Typesetting:-mi(allows continuing to zero of  Typesetting:-mrow(Typesetting:-mi(starting with available solution obtained from simpler function Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi( and varying parameter Typesetting:-mrow(Typesetting:-mi( from 0 to 1. 

 

For detailed explanation of available methods see [Eugene,Kurt] 

Employed Method 

The method employed in this work converts continuation problem to an ODE-IVP problem. The method required that image space and domain space dimensions are equal Typesetting:-mrow(Typesetting:-mi( (excluding the parameter Typesetting:-mrow(Typesetting:-mi() so there are Typesetting:-mrow(Typesetting:-mi( equations in Typesetting:-mrow(Typesetting:-mi( unknowns , 

Typesetting:-mrow(Typesetting:-mi( 

Typesetting:-mrow(Typesetting:-mi( 

... 

Typesetting:-mrow(Typesetting:-mi( 

Geometrically this set describes Typesetting:-mrow(Typesetting:-mi( hypersurfaces in Typesetting:-mrow(Typesetting:-msup(Typesetting:-mi((that constrain the Typesetting:-mrow(Typesetting:-mi(variables Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi() so that the locus is a curve in Typesetting:-mrow(Typesetting:-msup(Typesetting:-mi( 

Total differential of the equation system is 

Typesetting:-mrow(Typesetting:-mi( 

Typesetting:-mrow(Typesetting:-mi( 

... 

Typesetting:-mrow(Typesetting:-mi( 

denoting 

Typesetting:-mrow(Typesetting:-mi( 

Typesetting:-mrow(Typesetting:-mo( 

total differentials in vectorial notation become dot product of gradients and differential Typesetting:-mrow(Typesetting:-mi( 

Typesetting:-mrow(Typesetting:-mi( 

Typesetting:-mrow(Typesetting:-mi( 

... 

Typesetting:-mrow(Typesetting:-mi( 

Above conditions geometrically indicate that the tangent to solution Typesetting:-mrow(Typesetting:-mi( must be orthogonal to each of gradients Typesetting:-mrow(Typesetting:-mo(So if a direction (vector) can be found such that it is orthogonal to all gradients, then solution curve can be traced by following this direction. Procedure given below determines this orthogonal vector. 

 

Given Typesetting:-mrow(Typesetting:-mi( independent vectors Typesetting:-mrow(Typesetting:-mi(in Typesetting:-mrow(Typesetting:-mi(dimensional space, there is a unique direction in Typesetting:-mrow(Typesetting:-mi( dimensional space orthogonal to all Typesetting:-mrow(Typesetting:-mi( vectors given by 

Typesetting:-mrow(Typesetting:-mi( 

where Typesetting:-mrow(Typesetting:-mi( denotes basis vectors used to decompose/project vectors Typesetting:-mrow(Typesetting:-mi( but treated as a symbol in this determinant expression (general orthogonal vector concept may be related to multilinear algebra with wedge products and Hodge star producing better notation, but to make implementation clear here, matrix notation is used) Typesetting:-mrow(Typesetting:-mo(For example, in 2D there is unique perpendicular direction to 1 vector Typesetting:-mrow(Typesetting:-mi(given by 

Typesetting:-mrow(Typesetting:-mi( 

and in 3D there is unique direction orthogonal to 2 vectors Typesetting:-mrow(Typesetting:-mi( given by 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
 

Typesetting:-mrow(Typesetting:-mi( 

Typesetting:-mrow(Typesetting:-mi( 

which is recognized to be cross product of vectors  Typesetting:-mrow(Typesetting:-mi( 

Thus direction of solution curve tangent  Typesetting:-mrow(Typesetting:-mi(may be obtained from gradients by 

Typesetting:-mrow(Typesetting:-mi( 

Since this direction vector is is parallel to tangent of solution curve Typesetting:-mrow(Typesetting:-mi(  where Typesetting:-mrow(Typesetting:-mi(is a suitable scaling scalar, continuation problem is equivalant to differential equation  

Typesetting:-mrow(Typesetting:-mi(Typesetting:-mrow(Typesetting:-mi( 

where Typesetting:-mrow(Typesetting:-mi( is an arbitrary time-like parameter and need not to be interpretable, Typesetting:-mrow(Typesetting:-mi( is scaling parameter and Typesetting:-mrow(Typesetting:-mi(is vector orthogonal to all gradients Typesetting:-mrow(Typesetting:-mo( Note that for some problems it is preferrable to have one of the variables as differentiation parameter Typesetting:-mrow(Typesetting:-mi(so that one can observe other variables with respect to Typesetting:-mrow(Typesetting:-mi( and this approach is commonly used in kinematic analysis of mechanisms . 

Initialization 

 

> restart:
 

Procedure Definitions 

 

Basic Rotation Matrices 

Following functions define rotation matrices about X,Y,Z axis. This matrices will be used to orient surfaces by Euler angles 

> Rx := proc(t)
<<1,0,0>|<0,cos(t),sin(t)>|<0,-sin(t),cos(t)>>;
end proc:
 

> Ry := proc(t)
<<cos(t),0,-sin(t)>|<0,1,0>|<sin(t),0,cos(t)>>;
end proc:
 

> Rz := proc(t)
<<cos(t),sin(t),0>|<-sin(t),cos(t),0>|<0,0,1>>;
end proc:
 

Application to Surface-Surface intersections 

In this section continuation technique described above is applied to determine intersection of two surfaces. To illustrate the application of the method, surfaces are represented both in explicit and implicit form and continuation is applied in explicit-explicit, implicit-implicit, implicit-explicit combinations of two surfaces. 

 

One of the surfaces if ellipsoid of radii Typesetting:-mrow(Typesetting:-mi(in 3 axis given implicitly by  

 

Typesetting:-mrow(Typesetting:-mi( and explicitly by parameters Typesetting:-mrow(Typesetting:-mi( 

 

Typesetting:-mrow(Typesetting:-mi( 

 

where Typesetting:-mrow(Typesetting:-mi(are angle of position vector with z-axis and xy-plane 

 

Other surface is cylinder of radius Typesetting:-mrow(Typesetting:-mi(given implicitly by 

 

Typesetting:-mrow(Typesetting:-mi(and explicitly by parameters Typesetting:-mrow(Typesetting:-mi( 

 

Typesetting:-mrow(Typesetting:-mi( 

 

If both surface representation are selected as explicit then equations take the form 

 

Typesetting:-mrow(Typesetting:-mi( 

 

which is 3 scalar equations in four variables Typesetting:-mrow(Typesetting:-mi( For both implicit representation there are two equations 

 

Typesetting:-mrow(Typesetting:-mi( 

 

involving three variables Typesetting:-mrow(Typesetting:-mi( 

 

For implicit-explicit case there are two sub alternatives. Equations are either 

 

Typesetting:-mrow(Typesetting:-mi( 

Typesetting:-mrow(Typesetting:-mi( 

having variables either 

Typesetting:-mrow(Typesetting:-mi( or Typesetting:-mrow(Typesetting:-mi( 

 

Following table summarize the configurations to represent two surfaces whose intersection is to be determined. Note that #Equaions=#Variables-1 for all configurations as required. 

 

Configuration 

Equations 

Variables 

#Equations 

#Variables 

Explicit-Explicit 

Typesetting:-mrow(Typesetting:-mi( 

Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi( 

3 

4 

Implicit-Implicit 

{Typesetting:-mrow(Typesetting:-mi( 

Typesetting:-mrow(Typesetting:-mi( 

2 

3 

Explicit-Implicit 

Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi(
 

Typesetting:-mrow(Typesetting:-mi( 

4 

5 

Explicit-Implicit 

Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi(
 

Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi( 

4 

5 

 

 

Summary of the application of the technique in following sections is described in following steps  

 

  • ) setup Typesetting:-mrow(Typesetting:-mi(equations in Typesetting:-mrow(Typesetting:-mi(variables Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi(
 

  • ) determine Typesetting:-mrow(Typesetting:-mi(gradients by Jacobian of functions to yield Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi(
 

  • ) stack Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi(with a row (symbolical) basis vectors
 

  • ) determine orthogonal direction Typesetting:-mrow(Typesetting:-mi(by determinant of Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi(
 

  • ) replace each variable Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi(in orthogonal direction vector by its dependent form Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi(
 

  • ) define the equation that assigns rates of variables Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi(to orthogonal direction Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi(
 

  • ) determine a starting point (initial condition for ODE Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi() by fixing one of the parameters and solving for the rest (Newton's method, etc. can be used in numerical implementation)
 

  • ) check solution graphically or comparing the residual Typesetting:-mrow(Typesetting:-mo( to 0
 

 

Not: Steps 2-4 may be replaced by more concise implementation using Minors of matrix Typesetting:-msub(Typesetting:-mi( 

Define Surfaces 

 

Sphere implicit and Explicit (Parametric) Representations 

> fSphere := (r, a1, a2, a3) -> r[1]^2/a1^2+r[2]^2/a2^2+r[3]^2/a3^2-1;
 

proc (r, a1, a2, a3) options operator, arrow; `+`(`/`(`*`(`^`(r[1], 2)), `*`(`^`(a1, 2))), `/`(`*`(`^`(r[2], 2)), `*`(`^`(a2, 2))), `/`(`*`(`^`(r[3], 2)), `*`(`^`(a3, 2))), `-`(1)) end proc (3.1.1.1)
 

> sSphere := (phi, theta, a1, a2, a3) -> <(a1*sin(phi)*cos(theta), a2*sin(phi)*sin(theta), a3*cos(phi))>;
 

proc (phi, theta, a1, a2, a3) options operator, arrow; `<,>`(`*`(a1, `*`(sin(phi), `*`(cos(theta)))), `*`(a2, `*`(sin(phi), `*`(sin(theta)))), `*`(a3, `*`(cos(phi)))) end proc (3.1.1.2)
 

 

Cylinder implicit and Explicit (Parametric) Representations 

> fCylinder := (r, radius) -> r[1]^2+r[2]^2-radius^2;
 

proc (r, radius) options operator, arrow; `+`(`*`(`^`(r[1], 2)), `*`(`^`(r[2], 2)), `-`(`*`(`^`(radius, 2)))) end proc (3.1.2.1)
 

> sCylinder := (psi, h, radius) -> <radius*cos(psi), radius*sin(psi), h>;
 

proc (psi, h, radius) options operator, arrow; `<,>`(`*`(radius, `*`(cos(psi))), `*`(radius, `*`(sin(psi))), h) end proc (3.1.2.2)
 

 

Setup example surfaces 

 

Set radii of ellipsoid in X,Y,Z axis 

> RS1 := 3; RS2 := 2; RS3 := 5/2;
 

 

 

3
2
`/`(5, 2) (3.1.3.1)
 

Set rotation matrix to orient ellipsoid (45 degrees turn around x-axis and then 60 degrees turn about rotated z-axis) 

> C := Rx(Pi/4) . Rz(Pi/3);
 

Typesetting:-mrow(Typesetting:-mi( (3.1.3.2)
 

Map global Cartesian coordinates Typesetting:-mrow(Typesetting:-mi(to local frame Typesetting:-mrow(Typesetting:-mi( 

> R := LinearAlgebra:-Transpose(C) . <x, y, z>;
 

Typesetting:-mrow(Typesetting:-mi( (3.1.3.3)
 

Determine implicit representation using transformed local coordinates 

> fS := fSphere(R, RS1, RS2, RS3);
 

`+`(`*`(`/`(1, 9), `*`(`^`(`+`(`*`(`/`(1, 2), `*`(x)), `*`(`/`(1, 4), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(y)))), `*`(`/`(1, 4), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(z))))), ...
`+`(`*`(`/`(1, 9), `*`(`^`(`+`(`*`(`/`(1, 2), `*`(x)), `*`(`/`(1, 4), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(y)))), `*`(`/`(1, 4), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(z))))), ...
(3.1.3.4)
 

> fS := expand(fS);
 

`+`(`*`(`/`(31, 144), `*`(`^`(x, 2))), `-`(`*`(`/`(5, 144), `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(y)))))), `-`(`*`(`/`(5, 144), `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), ...
`+`(`*`(`/`(31, 144), `*`(`^`(x, 2))), `-`(`*`(`/`(5, 144), `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(y)))))), `-`(`*`(`/`(5, 144), `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), ...
(3.1.3.5)
 

Determine explicit representation in local coordinates and transform it to global frame 

> sS := C . sSphere(phi, theta, RS1, RS2, RS3);
 

Typesetting:-mrow(Typesetting:-mi( (3.1.3.6)
 

Set cylinder radius 

> RC := 3/2;
 

`/`(3, 2) (3.1.3.7)
 

Determine implicit representation of cylinder 

> fC := fCylinder([x, y, z], RC);
 

`+`(`*`(`^`(x, 2)), `*`(`^`(y, 2)), `-`(`/`(9, 4))) (3.1.3.8)
 

Determine explicit representation of cylinder 

> sC := sCylinder(psi, h, RC);
 

Typesetting:-mrow(Typesetting:-mi( (3.1.3.9)
 

 

 

 

 

> ALI := .35: # Set ambient light intensity for rendering two surfaces
 

> plotS := plot3d(convert(sS, 'list'), phi = 0 .. Pi, theta = 0 .. 2*Pi, axes = boxed, color = red, scaling = constrained, style = patch, glossiness = .9, light = ([45, 45, 1, 1, 1]), ambientlight = ([ALI, ALI, ALI])):
 

> plotC := plot3d(convert(sC, 'list'), psi = 0 .. 2*Pi, h = -3.5 .. 3.5, axes = boxed, color = blue, scaling = constrained, style = patch, glossiness = .9, light = ([45, 45, 1, 1, 1]), ambientlight = ([ALI, ALI, ALI])):
 

> plots[display]({plotC, plotS}, scaling = constrained, title = "two example surfaces : ellipsoid and cylinder");
 

Plot
 

 

 

Implicit-Implicit Case 

Define implicit equations for intersection of two surfaces. There are two scalar equations Typesetting:-mrow(Typesetting:-mi(in three variables Typesetting:-mrow(Typesetting:-mi( 

> IIsystem := [fS, fC];
 

[`+`(`*`(`/`(31, 144), `*`(`^`(x, 2))), `-`(`*`(`/`(5, 144), `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(y)))))), `-`(`*`(`/`(5, 144), `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)),...
[`+`(`*`(`/`(31, 144), `*`(`^`(x, 2))), `-`(`*`(`/`(5, 144), `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(y)))))), `-`(`*`(`/`(5, 144), `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)),...
(3.2.1)
 

Typesetting:-mrow(Typesetting:-mo( 

Compute Jacobian (~ gradients augmented) 

> J := VectorCalculus[Jacobian](IIsystem, [x, y, z]);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.2.2)
 

Add basis vector symbols to compute perpendicular direction 

> K := Matrix([[Matrix([ex, ey, ez])], [J]]);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.2.3)
 

> OrthogonalVector := LinearAlgebra[Determinant](K);
 

`+`(`*`(`/`(5, 72), `*`(ex, `*`(y, `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)))))))), `*`(`/`(17, 600), `*`(ex, `*`(`^`(y, 2)))), `-`(`*`(`/`(367, 600), `*`(ex, `*`(y, `*`(z))))), `*`(`/`(449,...
`+`(`*`(`/`(5, 72), `*`(ex, `*`(y, `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)))))))), `*`(`/`(17, 600), `*`(ex, `*`(`^`(y, 2)))), `-`(`*`(`/`(367, 600), `*`(ex, `*`(y, `*`(z))))), `*`(`/`(449,...
`+`(`*`(`/`(5, 72), `*`(ex, `*`(y, `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)))))))), `*`(`/`(17, 600), `*`(ex, `*`(`^`(y, 2)))), `-`(`*`(`/`(367, 600), `*`(ex, `*`(y, `*`(z))))), `*`(`/`(449,...
(3.2.4)
 

equivalent computation using minor of Jacobian matrix 

> seq((-1)^(i+1)*(LinearAlgebra[Minor])(K, 1, i), i = 1 .. 3);
 

`+`(`-`(`*`(2, `*`(`+`(`-`(`*`(`/`(5, 144), `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2))))))), `-`(`*`(`/`(17, 1200), `*`(y))), `*`(`/`(367, 1200), `*`(z))), `*`(y))))), `+`(`*`(2, `*`(`+`(`-`(...
`+`(`-`(`*`(2, `*`(`+`(`-`(`*`(`/`(5, 144), `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2))))))), `-`(`*`(`/`(17, 1200), `*`(y))), `*`(`/`(367, 1200), `*`(z))), `*`(y))))), `+`(`*`(2, `*`(`+`(`-`(...
(3.2.5)
 

> OrthogonalVector, RHS := LinearAlgebra[GenerateMatrix]([OrthogonalVector], [ex, ey, ez]);
 

Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
(3.2.6)
 

> StateDerivatives := subs([x = x(t), y = y(t), z = z(t)], OrthogonalVector);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.2.7)
 

>
 

> StateDerivatives := LinearAlgebra:-Row(StateDerivatives, 1);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.2.8)
 

> LinearAlgebra:-Dimensions(%);
 

3 (3.2.9)
 

Define ODE-IVP description of continuation problem 

> System := map(diff, <x(t), y(t), z(t)>, t)-LinearAlgebra:-Transpose(StateDerivatives);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.2.10)
 

To determine initial condition fix one of the variables  Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi( 

> IIsystemFixed := subs(y = 0, IIsystem);
 

[`+`(`*`(`/`(31, 144), `*`(`^`(x, 2))), `-`(1), `-`(`*`(`/`(5, 144), `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(z)))))), `*`(`/`(367, 2400), `*`(`^`(z, 2)))), `+`(`*`(`^`(x, 2)), `-`(`/`... (3.2.11)
 

and solve for others Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi( 

> solution := solve(IIsystemFixed, {z, x});
 

{z = `+`(`*`(5, `*`(RootOf(`+`(`-`(99), `-`(`*`(50, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(_Z))))), `*`(734, `*`(`^`(_Z, 2)))), label = _L2)))), x = `/`(3, 2)}, {z = `+`(`*`(5, `*`(RootOf(`...
{z = `+`(`*`(5, `*`(RootOf(`+`(`-`(99), `-`(`*`(50, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(_Z))))), `*`(734, `*`(`^`(_Z, 2)))), label = _L2)))), x = `/`(3, 2)}, {z = `+`(`*`(5, `*`(RootOf(`...
(3.2.12)
 

> allsolution := allvalues(solution[1]);
 

{x = `/`(3, 2), z = `+`(`*`(`/`(125, 734), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2))))), `*`(`/`(20, 367), `*`(`^`(1194, `/`(1, 2)))))}, {x = `/`(3, 2), z = `+`(`*`(`/`(125, 734), `*`(`^`(2, `/`(1,...
{x = `/`(3, 2), z = `+`(`*`(`/`(125, 734), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2))))), `*`(`/`(20, 367), `*`(`^`(1194, `/`(1, 2)))))}, {x = `/`(3, 2), z = `+`(`*`(`/`(125, 734), `*`(`^`(2, `/`(1,...
(3.2.13)
 

define initial condition 

> IC := eval([x, y, z], `union`(allsolution[1], {y = 0}));
 

[`/`(3, 2), 0, `+`(`*`(`/`(125, 734), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2))))), `*`(`/`(20, 367), `*`(`^`(1194, `/`(1, 2)))))] (3.2.14)
 

Define ODE-IVP  

> System0 := [op(convert(System, 'list')), x(0) = IC[1], y(0) = IC[2], z(0) = IC[3]];
 

[`+`(diff(x(t), t), `-`(`*`(`/`(17, 600), `*`(`^`(y(t), 2)))), `*`(`/`(367, 600), `*`(y(t), `*`(z(t)))), `-`(`*`(`/`(5, 72), `*`(x(t), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(y(t)))))))), `+...
[`+`(diff(x(t), t), `-`(`*`(`/`(17, 600), `*`(`^`(y(t), 2)))), `*`(`/`(367, 600), `*`(y(t), `*`(z(t)))), `-`(`*`(`/`(5, 72), `*`(x(t), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(y(t)))))))), `+...
[`+`(diff(x(t), t), `-`(`*`(`/`(17, 600), `*`(`^`(y(t), 2)))), `*`(`/`(367, 600), `*`(y(t), `*`(z(t)))), `-`(`*`(`/`(5, 72), `*`(x(t), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(y(t)))))))), `+...
[`+`(diff(x(t), t), `-`(`*`(`/`(17, 600), `*`(`^`(y(t), 2)))), `*`(`/`(367, 600), `*`(y(t), `*`(z(t)))), `-`(`*`(`/`(5, 72), `*`(x(t), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(y(t)))))))), `+...
(3.2.15)
 

Solve numerically 

> IIsolution := dsolve(System0, {x(t), y(t), z(t)}, 'numeric', method = rkf45, abserr = 0.1e-8, relerr = 0.1e-8);
 

proc (x_rkf45) local res, data, vars, solnproc, outpoint, ndsol, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; `:=`(_EnvDSNumericSaveDigits, Digits); `:=`(Digits, 14); if... (3.2.16)
 

plot variables against the ODE independent variable 

> plots[odeplot](IIsolution, [t, x(t)], t = 0 .. 8, numpoints = 256,axes=frame);
 

Plot_2d
 

> plots[odeplot](IIsolution, [t, y(t)], t = 0 .. 8, numpoints = 256,axes=frame);
 

Plot_2d
 

> plots[odeplot](IIsolution, [t, z(t)], t = 0 .. 8, numpoints = 256,axes=frame);
 

Plot_2d
 

plot solutions in the space of variables 

> plots[odeplot](IIsolution, [x(t), y(t)], t = 0 .. 8, numpoints = 256, axes = boxed);
 

Plot_2d
 

> plots[odeplot](IIsolution, [x(t), z(t)], t = 0 .. 8, numpoints = 256, axes = boxed);
 

Plot_2d
 

> plots[odeplot](IIsolution, [y(t), z(t)], t = 0 .. 8, numpoints = 256, axes = boxed);
 

Plot_2d
 

> intersectionPlot := plots[odeplot](IIsolution, [x(t), y(t), z(t)], t = 0 .. 8, numpoints = 256, thickness = 3, color = green):
 

> plots[display]({plotS, plotC, intersectionPlot});
 

Plot
 

Define the residuals 

> resS := unapply(fS,[x,y,z])(x(t),y(t),z(t));
 

`+`(`*`(`/`(31, 144), `*`(`^`(x(t), 2))), `-`(`*`(`/`(5, 144), `*`(x(t), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(y(t))))))), `-`(`*`(`/`(5, 144), `*`(x(t), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, ...
`+`(`*`(`/`(31, 144), `*`(`^`(x(t), 2))), `-`(`*`(`/`(5, 144), `*`(x(t), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(y(t))))))), `-`(`*`(`/`(5, 144), `*`(x(t), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, ...
(3.2.17)
 

> resC := unapply(fC,[x,y,z])(x(t),y(t),z(t));
 

`+`(`*`(`^`(x(t), 2)), `*`(`^`(y(t), 2)), `-`(`/`(9, 4))) (3.2.18)
 

Plot residuals 

> plots[odeplot](IIsolution, [t,resS], t = 0 .. 8, numpoints = 256, axes = boxed);
 

Plot_2d
 

> plots[odeplot](IIsolution, [t,resC], t = 0 .. 8, numpoints = 256, axes = boxed);
 

Plot_2d
 

>
 

Explicit-Explicit Case 

 

> EEsystem := sS-sC;
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.3.1)
 

> J := VectorCalculus[Jacobian](EEsystem, [phi, theta, psi, h]);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.3.2)
 

> K := Matrix([[Matrix([ephi, etheta, epsi, eh])], [J]]);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.3.3)
 

> OrthogonalVector := LinearAlgebra[Determinant](K);
 

`+`(`*`(`/`(3, 4), `*`(ephi, `*`(sin(psi), `*`(`^`(2, `/`(1, 2)), `*`(sin(phi), `*`(cos(theta))))))), `-`(`*`(3, `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(epsi, `*`(`^`(2, `/`(1, 2)), `*`(sin(phi)))))...
`+`(`*`(`/`(3, 4), `*`(ephi, `*`(sin(psi), `*`(`^`(2, `/`(1, 2)), `*`(sin(phi), `*`(cos(theta))))))), `-`(`*`(3, `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(epsi, `*`(`^`(2, `/`(1, 2)), `*`(sin(phi)))))...
`+`(`*`(`/`(3, 4), `*`(ephi, `*`(sin(psi), `*`(`^`(2, `/`(1, 2)), `*`(sin(phi), `*`(cos(theta))))))), `-`(`*`(3, `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(epsi, `*`(`^`(2, `/`(1, 2)), `*`(sin(phi)))))...
`+`(`*`(`/`(3, 4), `*`(ephi, `*`(sin(psi), `*`(`^`(2, `/`(1, 2)), `*`(sin(phi), `*`(cos(theta))))))), `-`(`*`(3, `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(epsi, `*`(`^`(2, `/`(1, 2)), `*`(sin(phi)))))...
`+`(`*`(`/`(3, 4), `*`(ephi, `*`(sin(psi), `*`(`^`(2, `/`(1, 2)), `*`(sin(phi), `*`(cos(theta))))))), `-`(`*`(3, `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(epsi, `*`(`^`(2, `/`(1, 2)), `*`(sin(phi)))))...
`+`(`*`(`/`(3, 4), `*`(ephi, `*`(sin(psi), `*`(`^`(2, `/`(1, 2)), `*`(sin(phi), `*`(cos(theta))))))), `-`(`*`(3, `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(epsi, `*`(`^`(2, `/`(1, 2)), `*`(sin(phi)))))...
`+`(`*`(`/`(3, 4), `*`(ephi, `*`(sin(psi), `*`(`^`(2, `/`(1, 2)), `*`(sin(phi), `*`(cos(theta))))))), `-`(`*`(3, `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(epsi, `*`(`^`(2, `/`(1, 2)), `*`(sin(phi)))))...
`+`(`*`(`/`(3, 4), `*`(ephi, `*`(sin(psi), `*`(`^`(2, `/`(1, 2)), `*`(sin(phi), `*`(cos(theta))))))), `-`(`*`(3, `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(epsi, `*`(`^`(2, `/`(1, 2)), `*`(sin(phi)))))...
`+`(`*`(`/`(3, 4), `*`(ephi, `*`(sin(psi), `*`(`^`(2, `/`(1, 2)), `*`(sin(phi), `*`(cos(theta))))))), `-`(`*`(3, `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(epsi, `*`(`^`(2, `/`(1, 2)), `*`(sin(phi)))))...
`+`(`*`(`/`(3, 4), `*`(ephi, `*`(sin(psi), `*`(`^`(2, `/`(1, 2)), `*`(sin(phi), `*`(cos(theta))))))), `-`(`*`(3, `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(epsi, `*`(`^`(2, `/`(1, 2)), `*`(sin(phi)))))...
(3.3.4)
 

> OrthogonalVector, RHS := LinearAlgebra[GenerateMatrix]([OrthogonalVector], [ephi, etheta, epsi, eh]);
 

Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
(3.3.5)
 

> StateDerivatives := subs([phi = phi(t), theta = theta(t), psi = psi(t), h = h(t)], OrthogonalVector);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.3.6)
 

>
 

> StateDerivatives := LinearAlgebra:-Row(StateDerivatives, 1);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.3.7)
 

>
 

> System := map(diff, <phi(t), theta(t), psi(t), h(t)>, t)-LinearAlgebra:-Transpose(StateDerivatives);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.3.8)
 

>
 

> EEsystemFixed := subs(psi = 0, EEsystem);
 

Typesetting:-mrow(Typesetting:-mi( (3.3.9)
 

> solution := solve(convert(EEsystemFixed, 'list'), {theta, phi, h});
 

{phi = arctan(RootOf(`+`(`*`(134689, `*`(`^`(_Z, 4))), `-`(`*`(189212, `*`(`^`(_Z, 2)))), 64324)), `+`(`-`(`*`(`/`(1, 150), `*`(`^`(3, `/`(1, 2)), `*`(`+`(`*`(367, `*`(`^`(RootOf(`+`(`*`(134689, `*`(`...
{phi = arctan(RootOf(`+`(`*`(134689, `*`(`^`(_Z, 4))), `-`(`*`(189212, `*`(`^`(_Z, 2)))), 64324)), `+`(`-`(`*`(`/`(1, 150), `*`(`^`(3, `/`(1, 2)), `*`(`+`(`*`(367, `*`(`^`(RootOf(`+`(`*`(134689, `*`(`...
{phi = arctan(RootOf(`+`(`*`(134689, `*`(`^`(_Z, 4))), `-`(`*`(189212, `*`(`^`(_Z, 2)))), 64324)), `+`(`-`(`*`(`/`(1, 150), `*`(`^`(3, `/`(1, 2)), `*`(`+`(`*`(367, `*`(`^`(RootOf(`+`(`*`(134689, `*`(`...
{phi = arctan(RootOf(`+`(`*`(134689, `*`(`^`(_Z, 4))), `-`(`*`(189212, `*`(`^`(_Z, 2)))), 64324)), `+`(`-`(`*`(`/`(1, 150), `*`(`^`(3, `/`(1, 2)), `*`(`+`(`*`(367, `*`(`^`(RootOf(`+`(`*`(134689, `*`(`...
{phi = arctan(RootOf(`+`(`*`(134689, `*`(`^`(_Z, 4))), `-`(`*`(189212, `*`(`^`(_Z, 2)))), 64324)), `+`(`-`(`*`(`/`(1, 150), `*`(`^`(3, `/`(1, 2)), `*`(`+`(`*`(367, `*`(`^`(RootOf(`+`(`*`(134689, `*`(`...
{phi = arctan(RootOf(`+`(`*`(134689, `*`(`^`(_Z, 4))), `-`(`*`(189212, `*`(`^`(_Z, 2)))), 64324)), `+`(`-`(`*`(`/`(1, 150), `*`(`^`(3, `/`(1, 2)), `*`(`+`(`*`(367, `*`(`^`(RootOf(`+`(`*`(134689, `*`(`...
{phi = arctan(RootOf(`+`(`*`(134689, `*`(`^`(_Z, 4))), `-`(`*`(189212, `*`(`^`(_Z, 2)))), 64324)), `+`(`-`(`*`(`/`(1, 150), `*`(`^`(3, `/`(1, 2)), `*`(`+`(`*`(367, `*`(`^`(RootOf(`+`(`*`(134689, `*`(`...
(3.3.10)
 

> allsolution := allvalues(solution);
 

{theta = `+`(`-`(arctan(`+`(`/`(`*`(`/`(1, 2832828960), `*`(`^`(3, `/`(1, 2)), `*`(`^`(`+`(94606, `-`(`*`(1200, `*`(`^`(199, `/`(1, 2)))))), `/`(1, 2)), `*`(`+`(3383520, `-`(`*`(106800, `*`(`^`(199, `...
{theta = `+`(`-`(arctan(`+`(`/`(`*`(`/`(1, 2832828960), `*`(`^`(3, `/`(1, 2)), `*`(`^`(`+`(94606, `-`(`*`(1200, `*`(`^`(199, `/`(1, 2)))))), `/`(1, 2)), `*`(`+`(3383520, `-`(`*`(106800, `*`(`^`(199, `...
{theta = `+`(`-`(arctan(`+`(`/`(`*`(`/`(1, 2832828960), `*`(`^`(3, `/`(1, 2)), `*`(`^`(`+`(94606, `-`(`*`(1200, `*`(`^`(199, `/`(1, 2)))))), `/`(1, 2)), `*`(`+`(3383520, `-`(`*`(106800, `*`(`^`(199, `...
{theta = `+`(`-`(arctan(`+`(`/`(`*`(`/`(1, 2832828960), `*`(`^`(3, `/`(1, 2)), `*`(`^`(`+`(94606, `-`(`*`(1200, `*`(`^`(199, `/`(1, 2)))))), `/`(1, 2)), `*`(`+`(3383520, `-`(`*`(106800, `*`(`^`(199, `...
{theta = `+`(`-`(arctan(`+`(`/`(`*`(`/`(1, 2832828960), `*`(`^`(3, `/`(1, 2)), `*`(`^`(`+`(94606, `-`(`*`(1200, `*`(`^`(199, `/`(1, 2)))))), `/`(1, 2)), `*`(`+`(3383520, `-`(`*`(106800, `*`(`^`(199, `...
{theta = `+`(`-`(arctan(`+`(`/`(`*`(`/`(1, 2832828960), `*`(`^`(3, `/`(1, 2)), `*`(`^`(`+`(94606, `-`(`*`(1200, `*`(`^`(199, `/`(1, 2)))))), `/`(1, 2)), `*`(`+`(3383520, `-`(`*`(106800, `*`(`^`(199, `...
{theta = `+`(`-`(arctan(`+`(`/`(`*`(`/`(1, 2832828960), `*`(`^`(3, `/`(1, 2)), `*`(`^`(`+`(94606, `-`(`*`(1200, `*`(`^`(199, `/`(1, 2)))))), `/`(1, 2)), `*`(`+`(3383520, `-`(`*`(106800, `*`(`^`(199, `...
{theta = `+`(`-`(arctan(`+`(`/`(`*`(`/`(1, 2832828960), `*`(`^`(3, `/`(1, 2)), `*`(`^`(`+`(94606, `-`(`*`(1200, `*`(`^`(199, `/`(1, 2)))))), `/`(1, 2)), `*`(`+`(3383520, `-`(`*`(106800, `*`(`^`(199, `...
{theta = `+`(`-`(arctan(`+`(`/`(`*`(`/`(1, 2832828960), `*`(`^`(3, `/`(1, 2)), `*`(`^`(`+`(94606, `-`(`*`(1200, `*`(`^`(199, `/`(1, 2)))))), `/`(1, 2)), `*`(`+`(3383520, `-`(`*`(106800, `*`(`^`(199, `...
{theta = `+`(`-`(arctan(`+`(`/`(`*`(`/`(1, 2832828960), `*`(`^`(3, `/`(1, 2)), `*`(`^`(`+`(94606, `-`(`*`(1200, `*`(`^`(199, `/`(1, 2)))))), `/`(1, 2)), `*`(`+`(3383520, `-`(`*`(106800, `*`(`^`(199, `...
{theta = `+`(`-`(arctan(`+`(`/`(`*`(`/`(1, 2832828960), `*`(`^`(3, `/`(1, 2)), `*`(`^`(`+`(94606, `-`(`*`(1200, `*`(`^`(199, `/`(1, 2)))))), `/`(1, 2)), `*`(`+`(3383520, `-`(`*`(106800, `*`(`^`(199, `...
{theta = `+`(`-`(arctan(`+`(`/`(`*`(`/`(1, 2832828960), `*`(`^`(3, `/`(1, 2)), `*`(`^`(`+`(94606, `-`(`*`(1200, `*`(`^`(199, `/`(1, 2)))))), `/`(1, 2)), `*`(`+`(3383520, `-`(`*`(106800, `*`(`^`(199, `...
{theta = `+`(`-`(arctan(`+`(`/`(`*`(`/`(1, 2832828960), `*`(`^`(3, `/`(1, 2)), `*`(`^`(`+`(94606, `-`(`*`(1200, `*`(`^`(199, `/`(1, 2)))))), `/`(1, 2)), `*`(`+`(3383520, `-`(`*`(106800, `*`(`^`(199, `...
{theta = `+`(`-`(arctan(`+`(`/`(`*`(`/`(1, 2832828960), `*`(`^`(3, `/`(1, 2)), `*`(`^`(`+`(94606, `-`(`*`(1200, `*`(`^`(199, `/`(1, 2)))))), `/`(1, 2)), `*`(`+`(3383520, `-`(`*`(106800, `*`(`^`(199, `...
{theta = `+`(`-`(arctan(`+`(`/`(`*`(`/`(1, 2832828960), `*`(`^`(3, `/`(1, 2)), `*`(`^`(`+`(94606, `-`(`*`(1200, `*`(`^`(199, `/`(1, 2)))))), `/`(1, 2)), `*`(`+`(3383520, `-`(`*`(106800, `*`(`^`(199, `...
{theta = `+`(`-`(arctan(`+`(`/`(`*`(`/`(1, 2832828960), `*`(`^`(3, `/`(1, 2)), `*`(`^`(`+`(94606, `-`(`*`(1200, `*`(`^`(199, `/`(1, 2)))))), `/`(1, 2)), `*`(`+`(3383520, `-`(`*`(106800, `*`(`^`(199, `...
(3.3.11)
 

> IC := eval([phi, theta, psi, h], `union`(allsolution[1], {psi = 0}));
 

[`+`(`-`(arctan(`+`(`/`(`*`(`/`(50, 367), `*`(`^`(`+`(94606, `-`(`*`(1200, `*`(`^`(199, `/`(1, 2)))))), `/`(1, 2)), `*`(`^`(3, `/`(1, 2))))), `*`(`+`(`-`(`/`(3750, 367)), `-`(`*`(`/`(1200, 367), `*`(`...
[`+`(`-`(arctan(`+`(`/`(`*`(`/`(50, 367), `*`(`^`(`+`(94606, `-`(`*`(1200, `*`(`^`(199, `/`(1, 2)))))), `/`(1, 2)), `*`(`^`(3, `/`(1, 2))))), `*`(`+`(`-`(`/`(3750, 367)), `-`(`*`(`/`(1200, 367), `*`(`...
[`+`(`-`(arctan(`+`(`/`(`*`(`/`(50, 367), `*`(`^`(`+`(94606, `-`(`*`(1200, `*`(`^`(199, `/`(1, 2)))))), `/`(1, 2)), `*`(`^`(3, `/`(1, 2))))), `*`(`+`(`-`(`/`(3750, 367)), `-`(`*`(`/`(1200, 367), `*`(`...
[`+`(`-`(arctan(`+`(`/`(`*`(`/`(50, 367), `*`(`^`(`+`(94606, `-`(`*`(1200, `*`(`^`(199, `/`(1, 2)))))), `/`(1, 2)), `*`(`^`(3, `/`(1, 2))))), `*`(`+`(`-`(`/`(3750, 367)), `-`(`*`(`/`(1200, 367), `*`(`...
(3.3.12)
 

> evalf(IC);
 

[.8624230220, -.3255623079, 0., 2.300215834] (3.3.13)
 

> System0 := [op(convert(System, 'list')), phi(0) = IC[1], theta(0) = IC[2], psi(0) = IC[3], h(0) = IC[4]];
 

[`+`(diff(phi(t), t), `*`(`/`(9, 4), `*`(cos(psi(t)), `*`(sin(phi(t)), `*`(sin(theta(t)))))), `*`(`/`(3, 2), `*`(cos(psi(t)), `*`(`^`(3, `/`(1, 2)), `*`(sin(phi(t)), `*`(cos(theta(t))))))), `*`(`/`(9,...
[`+`(diff(phi(t), t), `*`(`/`(9, 4), `*`(cos(psi(t)), `*`(sin(phi(t)), `*`(sin(theta(t)))))), `*`(`/`(3, 2), `*`(cos(psi(t)), `*`(`^`(3, `/`(1, 2)), `*`(sin(phi(t)), `*`(cos(theta(t))))))), `*`(`/`(9,...
[`+`(diff(phi(t), t), `*`(`/`(9, 4), `*`(cos(psi(t)), `*`(sin(phi(t)), `*`(sin(theta(t)))))), `*`(`/`(3, 2), `*`(cos(psi(t)), `*`(`^`(3, `/`(1, 2)), `*`(sin(phi(t)), `*`(cos(theta(t))))))), `*`(`/`(9,...
[`+`(diff(phi(t), t), `*`(`/`(9, 4), `*`(cos(psi(t)), `*`(sin(phi(t)), `*`(sin(theta(t)))))), `*`(`/`(3, 2), `*`(cos(psi(t)), `*`(`^`(3, `/`(1, 2)), `*`(sin(phi(t)), `*`(cos(theta(t))))))), `*`(`/`(9,...
[`+`(diff(phi(t), t), `*`(`/`(9, 4), `*`(cos(psi(t)), `*`(sin(phi(t)), `*`(sin(theta(t)))))), `*`(`/`(3, 2), `*`(cos(psi(t)), `*`(`^`(3, `/`(1, 2)), `*`(sin(phi(t)), `*`(cos(theta(t))))))), `*`(`/`(9,...
[`+`(diff(phi(t), t), `*`(`/`(9, 4), `*`(cos(psi(t)), `*`(sin(phi(t)), `*`(sin(theta(t)))))), `*`(`/`(3, 2), `*`(cos(psi(t)), `*`(`^`(3, `/`(1, 2)), `*`(sin(phi(t)), `*`(cos(theta(t))))))), `*`(`/`(9,...
[`+`(diff(phi(t), t), `*`(`/`(9, 4), `*`(cos(psi(t)), `*`(sin(phi(t)), `*`(sin(theta(t)))))), `*`(`/`(3, 2), `*`(cos(psi(t)), `*`(`^`(3, `/`(1, 2)), `*`(sin(phi(t)), `*`(cos(theta(t))))))), `*`(`/`(9,...
[`+`(diff(phi(t), t), `*`(`/`(9, 4), `*`(cos(psi(t)), `*`(sin(phi(t)), `*`(sin(theta(t)))))), `*`(`/`(3, 2), `*`(cos(psi(t)), `*`(`^`(3, `/`(1, 2)), `*`(sin(phi(t)), `*`(cos(theta(t))))))), `*`(`/`(9,...
[`+`(diff(phi(t), t), `*`(`/`(9, 4), `*`(cos(psi(t)), `*`(sin(phi(t)), `*`(sin(theta(t)))))), `*`(`/`(3, 2), `*`(cos(psi(t)), `*`(`^`(3, `/`(1, 2)), `*`(sin(phi(t)), `*`(cos(theta(t))))))), `*`(`/`(9,...
[`+`(diff(phi(t), t), `*`(`/`(9, 4), `*`(cos(psi(t)), `*`(sin(phi(t)), `*`(sin(theta(t)))))), `*`(`/`(3, 2), `*`(cos(psi(t)), `*`(`^`(3, `/`(1, 2)), `*`(sin(phi(t)), `*`(cos(theta(t))))))), `*`(`/`(9,...
[`+`(diff(phi(t), t), `*`(`/`(9, 4), `*`(cos(psi(t)), `*`(sin(phi(t)), `*`(sin(theta(t)))))), `*`(`/`(3, 2), `*`(cos(psi(t)), `*`(`^`(3, `/`(1, 2)), `*`(sin(phi(t)), `*`(cos(theta(t))))))), `*`(`/`(9,...
[`+`(diff(phi(t), t), `*`(`/`(9, 4), `*`(cos(psi(t)), `*`(sin(phi(t)), `*`(sin(theta(t)))))), `*`(`/`(3, 2), `*`(cos(psi(t)), `*`(`^`(3, `/`(1, 2)), `*`(sin(phi(t)), `*`(cos(theta(t))))))), `*`(`/`(9,...
[`+`(diff(phi(t), t), `*`(`/`(9, 4), `*`(cos(psi(t)), `*`(sin(phi(t)), `*`(sin(theta(t)))))), `*`(`/`(3, 2), `*`(cos(psi(t)), `*`(`^`(3, `/`(1, 2)), `*`(sin(phi(t)), `*`(cos(theta(t))))))), `*`(`/`(9,...
[`+`(diff(phi(t), t), `*`(`/`(9, 4), `*`(cos(psi(t)), `*`(sin(phi(t)), `*`(sin(theta(t)))))), `*`(`/`(3, 2), `*`(cos(psi(t)), `*`(`^`(3, `/`(1, 2)), `*`(sin(phi(t)), `*`(cos(theta(t))))))), `*`(`/`(9,...
[`+`(diff(phi(t), t), `*`(`/`(9, 4), `*`(cos(psi(t)), `*`(sin(phi(t)), `*`(sin(theta(t)))))), `*`(`/`(3, 2), `*`(cos(psi(t)), `*`(`^`(3, `/`(1, 2)), `*`(sin(phi(t)), `*`(cos(theta(t))))))), `*`(`/`(9,...
[`+`(diff(phi(t), t), `*`(`/`(9, 4), `*`(cos(psi(t)), `*`(sin(phi(t)), `*`(sin(theta(t)))))), `*`(`/`(3, 2), `*`(cos(psi(t)), `*`(`^`(3, `/`(1, 2)), `*`(sin(phi(t)), `*`(cos(theta(t))))))), `*`(`/`(9,...
(3.3.14)
 

> EEsolution := dsolve(System0, {phi(t), theta(t), psi(t), h(t)}, 'numeric', method = rkf45, abserr = 0.1e-8, relerr = 0.1e-8);
 

proc (x_rkf45) local res, data, vars, solnproc, outpoint, ndsol, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; `:=`(_EnvDSNumericSaveDigits, Digits); `:=`(Digits, 14); if... (3.3.15)
 

> rhs(EEsolution(1)[2]);
 

2.00711434079428308 (3.3.16)
 

> plots[odeplot](EEsolution, [t, h(t)], t = 0 .. 4, numpoints = 256,axes=frame);
 

Plot_2d
 

> plots[odeplot](EEsolution, [t, phi(t)], t = 0 .. 4, numpoints = 256,axes=frame);
 

Plot_2d
 

> plots[odeplot](EEsolution, [h(t), 180*phi(t)/Pi], t = 0 .. 4, numpoints = 256, axes = boxed);
 

Plot_2d
 

> plots[odeplot](EEsolution, [t, theta(t)], t = 0 .. 4, numpoints = 256,axes=frame);
 

Plot_2d
 

> plots[odeplot](EEsolution, [t, psi(t)], t = 0 .. 4, numpoints = 256,axes=frame);
 

Plot_2d
 

> plots[odeplot](EEsolution, [h(t), psi(t)], t = 0 .. 4, numpoints = 512, axes = boxed);
 

Plot_2d
 

> plots[odeplot](EEsolution, [phi(t), theta(t)], t = 0 .. 4, numpoints = 512, axes = boxed);
 

Plot_2d
 

>
 

> intersectionPlot := plots[spacecurve](convert(subs(psi = ''rhs(EEsolution(t)[4])'', h = ''rhs(EEsolution(t)[2])'', sC), 'list'), t = 0 .. 4, numpoints = 245, color = green, thickness = 3);
 

PLOT3D(CURVES([[1.500000000, 0., 2.300215833], [1.497892529, -0.7948566530e-1, 2.278022687], [1.491809456, -.1565392828, 2.256454343], [1.482096728, -.2310612261, 2.235698137], [1.469081909, -.3029824... (3.3.17)
 

> plots[display]({plotS, plotC, intersectionPlot}, title = "intersection of ellipsoid and from explicit (parametric) representations");
 

Plot
 

Define the residuals 

> resSC := unapply(EEsystem,[phi,theta,psi,h])(phi(t),theta(t),psi(t),h(t));
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.3.18)
 

> plots[odeplot](EEsolution, [t,resSC[1]], t = 0 .. 4, numpoints = 512, axes = boxed);
plots[odeplot](EEsolution, [t,resSC[2]], t = 0 .. 4, numpoints = 512, axes = boxed);
plots[odeplot](EEsolution, [t,resSC[3]], t = 0 .. 4, numpoints = 512, axes = boxed);
 

 

 

Plot_2d
Plot_2d
Plot_2d
 

 

 

>
 

>
 

Explicit-Implicit Case 

 

> EIsystem1 := [op(convert(sS-<x,y,z>,'list')),fC];
 

[`+`(`*`(`/`(3, 2), `*`(sin(phi), `*`(cos(theta)))), `-`(`*`(`^`(3, `/`(1, 2)), `*`(sin(phi), `*`(sin(theta))))), `-`(x)), `+`(`*`(`/`(3, 4), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(sin(phi)...
[`+`(`*`(`/`(3, 2), `*`(sin(phi), `*`(cos(theta)))), `-`(`*`(`^`(3, `/`(1, 2)), `*`(sin(phi), `*`(sin(theta))))), `-`(x)), `+`(`*`(`/`(3, 4), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(sin(phi)...
[`+`(`*`(`/`(3, 2), `*`(sin(phi), `*`(cos(theta)))), `-`(`*`(`^`(3, `/`(1, 2)), `*`(sin(phi), `*`(sin(theta))))), `-`(x)), `+`(`*`(`/`(3, 4), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(sin(phi)...
(3.4.1)
 

>
 

> EIsystem2 := [op(convert(sC-<x,y,z>,'list')),fS];
 

[`+`(`*`(`/`(3, 2), `*`(cos(psi))), `-`(x)), `+`(`*`(`/`(3, 2), `*`(sin(psi))), `-`(y)), `+`(h, `-`(z)), `+`(`*`(`/`(31, 144), `*`(`^`(x, 2))), `-`(`*`(`/`(5, 144), `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`...
[`+`(`*`(`/`(3, 2), `*`(cos(psi))), `-`(x)), `+`(`*`(`/`(3, 2), `*`(sin(psi))), `-`(y)), `+`(h, `-`(z)), `+`(`*`(`/`(31, 144), `*`(`^`(x, 2))), `-`(`*`(`/`(5, 144), `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`...
(3.4.2)
 

> J1 := VectorCalculus[Jacobian](Vector[column](EIsystem1), [phi, theta, x,y,z]);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.4.3)
 

> J2 := VectorCalculus[Jacobian](Vector[column](EIsystem2), [psi, h, x,y,z]);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.4.4)
 

> K1 := Matrix([[Matrix([ephi, etheta, ex, ey,ez])], [J1]]);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.4.5)
 

> K2 := Matrix([[Matrix([epsi, eh, ex, ey,ez])], [J2]]);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.4.6)
 

> OrthogonalVector1 := LinearAlgebra[Determinant](K1);
 

`+`(`*`(6, `*`(`^`(2, `/`(1, 2)), `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(sin(phi), `*`(ex, `*`(y))))))), `-`(`*`(6, `*`(`^`(2, `/`(1, 2)), `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(sin(phi), `*`(x,...
`+`(`*`(6, `*`(`^`(2, `/`(1, 2)), `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(sin(phi), `*`(ex, `*`(y))))))), `-`(`*`(6, `*`(`^`(2, `/`(1, 2)), `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(sin(phi), `*`(x,...
`+`(`*`(6, `*`(`^`(2, `/`(1, 2)), `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(sin(phi), `*`(ex, `*`(y))))))), `-`(`*`(6, `*`(`^`(2, `/`(1, 2)), `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(sin(phi), `*`(x,...
`+`(`*`(6, `*`(`^`(2, `/`(1, 2)), `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(sin(phi), `*`(ex, `*`(y))))))), `-`(`*`(6, `*`(`^`(2, `/`(1, 2)), `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(sin(phi), `*`(x,...
`+`(`*`(6, `*`(`^`(2, `/`(1, 2)), `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(sin(phi), `*`(ex, `*`(y))))))), `-`(`*`(6, `*`(`^`(2, `/`(1, 2)), `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(sin(phi), `*`(x,...
`+`(`*`(6, `*`(`^`(2, `/`(1, 2)), `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(sin(phi), `*`(ex, `*`(y))))))), `-`(`*`(6, `*`(`^`(2, `/`(1, 2)), `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(sin(phi), `*`(x,...
`+`(`*`(6, `*`(`^`(2, `/`(1, 2)), `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(sin(phi), `*`(ex, `*`(y))))))), `-`(`*`(6, `*`(`^`(2, `/`(1, 2)), `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(sin(phi), `*`(x,...
`+`(`*`(6, `*`(`^`(2, `/`(1, 2)), `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(sin(phi), `*`(ex, `*`(y))))))), `-`(`*`(6, `*`(`^`(2, `/`(1, 2)), `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(sin(phi), `*`(x,...
`+`(`*`(6, `*`(`^`(2, `/`(1, 2)), `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(sin(phi), `*`(ex, `*`(y))))))), `-`(`*`(6, `*`(`^`(2, `/`(1, 2)), `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(sin(phi), `*`(x,...
`+`(`*`(6, `*`(`^`(2, `/`(1, 2)), `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(sin(phi), `*`(ex, `*`(y))))))), `-`(`*`(6, `*`(`^`(2, `/`(1, 2)), `*`(cos(phi), `*`(`^`(cos(theta), 2), `*`(sin(phi), `*`(x,...
(3.4.7)
 

> OrthogonalVector2 := LinearAlgebra[Determinant](K2);
 

`+`(`-`(`*`(`/`(5, 144), `*`(epsi, `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)))))))), `-`(`*`(`/`(17, 1200), `*`(epsi, `*`(y)))), `*`(`/`(367, 1200), `*`(epsi, `*`(z))), `*`(`/`(31, 48), `*`(s...
`+`(`-`(`*`(`/`(5, 144), `*`(epsi, `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)))))))), `-`(`*`(`/`(17, 1200), `*`(epsi, `*`(y)))), `*`(`/`(367, 1200), `*`(epsi, `*`(z))), `*`(`/`(31, 48), `*`(s...
`+`(`-`(`*`(`/`(5, 144), `*`(epsi, `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)))))))), `-`(`*`(`/`(17, 1200), `*`(epsi, `*`(y)))), `*`(`/`(367, 1200), `*`(epsi, `*`(z))), `*`(`/`(31, 48), `*`(s...
`+`(`-`(`*`(`/`(5, 144), `*`(epsi, `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)))))))), `-`(`*`(`/`(17, 1200), `*`(epsi, `*`(y)))), `*`(`/`(367, 1200), `*`(epsi, `*`(z))), `*`(`/`(31, 48), `*`(s...
`+`(`-`(`*`(`/`(5, 144), `*`(epsi, `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)))))))), `-`(`*`(`/`(17, 1200), `*`(epsi, `*`(y)))), `*`(`/`(367, 1200), `*`(epsi, `*`(z))), `*`(`/`(31, 48), `*`(s...
`+`(`-`(`*`(`/`(5, 144), `*`(epsi, `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)))))))), `-`(`*`(`/`(17, 1200), `*`(epsi, `*`(y)))), `*`(`/`(367, 1200), `*`(epsi, `*`(z))), `*`(`/`(31, 48), `*`(s...
(3.4.8)
 

> OrthogonalVector1, RHS1 := LinearAlgebra[GenerateMatrix]([OrthogonalVector1], [ephi, etheta, ex, ey,ez]);
 

Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
(3.4.9)
 

> OrthogonalVector2, RHS2 := LinearAlgebra[GenerateMatrix]([OrthogonalVector2], [epsi, eh, ex, ey,ez]);
 

Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
(3.4.10)
 

> StateDerivatives1 := subs([phi = phi(t), theta = theta(t), x = x(t), y = y(t), z=z(t)], OrthogonalVector1);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.4.11)
 

> StateDerivatives2 := subs([psi = psi(t), h = h(t), x = x(t), y = y(t), z=z(t)], OrthogonalVector2);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.4.12)
 

>
 

> StateDerivatives1 := LinearAlgebra:-Row(StateDerivatives1, 1);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.4.13)
 

> StateDerivatives2 := LinearAlgebra:-Row(StateDerivatives2, 1);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.4.14)
 

> System1 := map(diff, <phi(t), theta(t), x(t), y(t), z(t)>, t)-LinearAlgebra:-Transpose(StateDerivatives1);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.4.15)
 

> System2 := map(diff, <psi(t), h(t), x(t), y(t), z(t)>, t)-LinearAlgebra:-Transpose(StateDerivatives2);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(3.4.16)
 

> EIsystem2;
 

[`+`(`*`(`/`(3, 2), `*`(cos(psi))), `-`(x)), `+`(`*`(`/`(3, 2), `*`(sin(psi))), `-`(y)), `+`(h, `-`(z)), `+`(`*`(`/`(31, 144), `*`(`^`(x, 2))), `-`(`*`(`/`(5, 144), `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`...
[`+`(`*`(`/`(3, 2), `*`(cos(psi))), `-`(x)), `+`(`*`(`/`(3, 2), `*`(sin(psi))), `-`(y)), `+`(h, `-`(z)), `+`(`*`(`/`(31, 144), `*`(`^`(x, 2))), `-`(`*`(`/`(5, 144), `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`...
(3.4.17)
 

> EIsystem1Fixed := eval(EIsystem1,[phi = Pi/6]);
 

[`+`(`*`(`/`(3, 4), `*`(cos(theta))), `-`(`*`(`/`(1, 2), `*`(`^`(3, `/`(1, 2)), `*`(sin(theta))))), `-`(x)), `+`(`*`(`/`(3, 8), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(cos(theta))))), `*`(`/...
[`+`(`*`(`/`(3, 4), `*`(cos(theta))), `-`(`*`(`/`(1, 2), `*`(`^`(3, `/`(1, 2)), `*`(sin(theta))))), `-`(x)), `+`(`*`(`/`(3, 8), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(cos(theta))))), `*`(`/...
(3.4.18)
 

> EIsystem2Fixed := eval(EIsystem2,psi =0);
 

[`+`(`/`(3, 2), `-`(x)), `+`(`-`(y)), `+`(h, `-`(z)), `+`(`*`(`/`(31, 144), `*`(`^`(x, 2))), `-`(`*`(`/`(5, 144), `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(y)))))), `-`(`*`(`/`(5, 144),...
[`+`(`/`(3, 2), `-`(x)), `+`(`-`(y)), `+`(h, `-`(z)), `+`(`*`(`/`(31, 144), `*`(`^`(x, 2))), `-`(`*`(`/`(5, 144), `*`(x, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(y)))))), `-`(`*`(`/`(5, 144),...
(3.4.19)
 

> solution1 := solve(convert(EIsystem1Fixed, 'list'), {theta,x,y,z});
 

{y = `+`(`-`(`/`(`*`(`/`(3, 16), `*`(`^`(2, `/`(1, 2)), `*`(`+`(`*`(34, `*`(`^`(3, `/`(1, 2)))), `*`(3, `*`(`^`(3, `/`(1, 2)), `*`(`^`(RootOf(`+`(`-`(5796), `*`(7236, `*`(`^`(_Z, 2))), `-`(`*`(4080, `...
{y = `+`(`-`(`/`(`*`(`/`(3, 16), `*`(`^`(2, `/`(1, 2)), `*`(`+`(`*`(34, `*`(`^`(3, `/`(1, 2)))), `*`(3, `*`(`^`(3, `/`(1, 2)), `*`(`^`(RootOf(`+`(`-`(5796), `*`(7236, `*`(`^`(_Z, 2))), `-`(`*`(4080, `...
{y = `+`(`-`(`/`(`*`(`/`(3, 16), `*`(`^`(2, `/`(1, 2)), `*`(`+`(`*`(34, `*`(`^`(3, `/`(1, 2)))), `*`(3, `*`(`^`(3, `/`(1, 2)), `*`(`^`(RootOf(`+`(`-`(5796), `*`(7236, `*`(`^`(_Z, 2))), `-`(`*`(4080, `...
{y = `+`(`-`(`/`(`*`(`/`(3, 16), `*`(`^`(2, `/`(1, 2)), `*`(`+`(`*`(34, `*`(`^`(3, `/`(1, 2)))), `*`(3, `*`(`^`(3, `/`(1, 2)), `*`(`^`(RootOf(`+`(`-`(5796), `*`(7236, `*`(`^`(_Z, 2))), `-`(`*`(4080, `...
{y = `+`(`-`(`/`(`*`(`/`(3, 16), `*`(`^`(2, `/`(1, 2)), `*`(`+`(`*`(34, `*`(`^`(3, `/`(1, 2)))), `*`(3, `*`(`^`(3, `/`(1, 2)), `*`(`^`(RootOf(`+`(`-`(5796), `*`(7236, `*`(`^`(_Z, 2))), `-`(`*`(4080, `...
{y = `+`(`-`(`/`(`*`(`/`(3, 16), `*`(`^`(2, `/`(1, 2)), `*`(`+`(`*`(34, `*`(`^`(3, `/`(1, 2)))), `*`(3, `*`(`^`(3, `/`(1, 2)), `*`(`^`(RootOf(`+`(`-`(5796), `*`(7236, `*`(`^`(_Z, 2))), `-`(`*`(4080, `...
{y = `+`(`-`(`/`(`*`(`/`(3, 16), `*`(`^`(2, `/`(1, 2)), `*`(`+`(`*`(34, `*`(`^`(3, `/`(1, 2)))), `*`(3, `*`(`^`(3, `/`(1, 2)), `*`(`^`(RootOf(`+`(`-`(5796), `*`(7236, `*`(`^`(_Z, 2))), `-`(`*`(4080, `...
{y = `+`(`-`(`/`(`*`(`/`(3, 16), `*`(`^`(2, `/`(1, 2)), `*`(`+`(`*`(34, `*`(`^`(3, `/`(1, 2)))), `*`(3, `*`(`^`(3, `/`(1, 2)), `*`(`^`(RootOf(`+`(`-`(5796), `*`(7236, `*`(`^`(_Z, 2))), `-`(`*`(4080, `...
{y = `+`(`-`(`/`(`*`(`/`(3, 16), `*`(`^`(2, `/`(1, 2)), `*`(`+`(`*`(34, `*`(`^`(3, `/`(1, 2)))), `*`(3, `*`(`^`(3, `/`(1, 2)), `*`(`^`(RootOf(`+`(`-`(5796), `*`(7236, `*`(`^`(_Z, 2))), `-`(`*`(4080, `...
{y = `+`(`-`(`/`(`*`(`/`(3, 16), `*`(`^`(2, `/`(1, 2)), `*`(`+`(`*`(34, `*`(`^`(3, `/`(1, 2)))), `*`(3, `*`(`^`(3, `/`(1, 2)), `*`(`^`(RootOf(`+`(`-`(5796), `*`(7236, `*`(`^`(_Z, 2))), `-`(`*`(4080, `...
{y = `+`(`-`(`/`(`*`(`/`(3, 16), `*`(`^`(2, `/`(1, 2)), `*`(`+`(`*`(34, `*`(`^`(3, `/`(1, 2)))), `*`(3, `*`(`^`(3, `/`(1, 2)), `*`(`^`(RootOf(`+`(`-`(5796), `*`(7236, `*`(`^`(_Z, 2))), `-`(`*`(4080, `...
{y = `+`(`-`(`/`(`*`(`/`(3, 16), `*`(`^`(2, `/`(1, 2)), `*`(`+`(`*`(34, `*`(`^`(3, `/`(1, 2)))), `*`(3, `*`(`^`(3, `/`(1, 2)), `*`(`^`(RootOf(`+`(`-`(5796), `*`(7236, `*`(`^`(_Z, 2))), `-`(`*`(4080, `...
{y = `+`(`-`(`/`(`*`(`/`(3, 16), `*`(`^`(2, `/`(1, 2)), `*`(`+`(`*`(34, `*`(`^`(3, `/`(1, 2)))), `*`(3, `*`(`^`(3, `/`(1, 2)), `*`(`^`(RootOf(`+`(`-`(5796), `*`(7236, `*`(`^`(_Z, 2))), `-`(`*`(4080, `...
(3.4.20)
 

> solution2 := solve(convert(EIsystem2Fixed, 'list'), {h,x,y,z});
 

{x = `/`(3, 2), y = 0, h = `+`(`*`(5, `*`(RootOf(`+`(`-`(99), `-`(`*`(50, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(_Z))))), `*`(734, `*`(`^`(_Z, 2)))), label = _L10)))), z = `+`(`*`(5, `*`(Ro...
{x = `/`(3, 2), y = 0, h = `+`(`*`(5, `*`(RootOf(`+`(`-`(99), `-`(`*`(50, `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)), `*`(_Z))))), `*`(734, `*`(`^`(_Z, 2)))), label = _L10)))), z = `+`(`*`(5, `*`(Ro...
(3.4.21)
 

> allsolution1 := allvalues(solution1):
 

> allsolution2 := allvalues(solution2);
 

{x = `/`(3, 2), y = 0, h = `+`(`*`(`/`(125, 734), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2))))), `*`(`/`(20, 367), `*`(`^`(1194, `/`(1, 2))))), z = `+`(`*`(`/`(125, 734), `*`(`^`(2, `/`(1, 2)), `*`(...
{x = `/`(3, 2), y = 0, h = `+`(`*`(`/`(125, 734), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2))))), `*`(`/`(20, 367), `*`(`^`(1194, `/`(1, 2))))), z = `+`(`*`(`/`(125, 734), `*`(`^`(2, `/`(1, 2)), `*`(...
{x = `/`(3, 2), y = 0, h = `+`(`*`(`/`(125, 734), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2))))), `*`(`/`(20, 367), `*`(`^`(1194, `/`(1, 2))))), z = `+`(`*`(`/`(125, 734), `*`(`^`(2, `/`(1, 2)), `*`(...
(3.4.22)
 

> IC1 := eval([phi, theta, x, y, z], `union`(allsolution1[1], {phi = Pi/6})):
 

> IC2 := eval([psi, h, x, y, z], `union`(allsolution2[1], {psi = 0})):
 

> evalf(IC1);
 

[.5235987758, 1.603342940, -.8899724126, -1.207455633, 1.854406544] (3.4.23)
 

> evalf(IC2);
 

[0., 2.300215833, 1.500000000, 0., 2.300215833] (3.4.24)
 

> System10 := [op(convert(System1, 'list')), phi(0) = IC1[1], theta(0) = IC1[2], x(0) = IC1[3], y(0) = IC1[4], z(0)=IC1[5]]:
 

> System20 := [op(convert(System2, 'list')), psi(0) = IC2[1], h(0) = IC2[2], x(0) = IC2[3], y(0) = IC2[4], z(0)=IC2[5]]:
 

> EI1solution := dsolve(System10, [phi(t), theta(t), x(t), y(t),z(t)], 'numeric', method = rkf45, abserr = 0.1e-8, relerr = 0.1e-8);
 

proc (x_rkf45) local res, data, vars, solnproc, outpoint, ndsol, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; `:=`(_EnvDSNumericSaveDigits, Digits); `:=`(Digits, 14); if... (3.4.25)
 

> EI2solution := dsolve(System20, [psi(t), h(t), x(t), y(t),z(t)], 'numeric', method = rkf45, abserr = 0.1e-8, relerr = 0.1e-8);
 

proc (x_rkf45) local res, data, vars, solnproc, outpoint, ndsol, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; `:=`(_EnvDSNumericSaveDigits, Digits); `:=`(Digits, 14); if... (3.4.26)
 

> rhs(EI1solution(1)[2]);
rhs(EI2solution(1)[2]);
 

 

.130257303444753281
.609500441738861974 (3.4.27)
 

> plots[odeplot](EI1solution, [t, phi(t)], t = 0 .. 4, numpoints = 256);
 

Plot_2d
 

> plots[odeplot](EI1solution, [t, theta(t)], t = 0 .. 4, numpoints = 256);
 

Plot_2d
 

> plots[odeplot](EI1solution, [t, x(t)], t = 0 .. 4, numpoints = 256);
 

Plot_2d
 

> plots[odeplot](EI1solution, [t, y(t)], t = 0 .. 4, numpoints = 256);
 

Plot_2d
 

> plots[odeplot](EI1solution, [t, z(t)], t = 0 .. 4, numpoints = 256);
 

Plot_2d
 

> plots[odeplot](EI1solution, [phi(t)*180/Pi, 180*theta(t)/Pi], t = 0 .. 4, numpoints = 256, axes = boxed);
 

Plot_2d
 

>
 

> plots[odeplot](EI2solution, [psi(t)*180/Pi, h(t)], t = 0 .. 12, numpoints = 256, axes = boxed);
 

Plot_2d
 

> EI2solution(3);
 

[t = 3., psi(t) = 1.89608157033613378, h(t) = 1.88736395389776068, x(t) = -.479368625648809998, y(t) = 1.42133941196403857, z(t) = 1.88736395389776068]
[t = 3., psi(t) = 1.89608157033613378, h(t) = 1.88736395389776068, x(t) = -.479368625648809998, y(t) = 1.42133941196403857, z(t) = 1.88736395389776068]
(3.4.28)
 

> intersectionPlot1 := plots[spacecurve](convert(subs(phi = ''rhs(EI1solution(t)[2])'', theta = ''rhs(EI1solution(t)[3])'', sS), 'list'), t = 0 .. 4, numpoints = 245, color = green, thickness = 3);
 

PLOT3D(CURVES([[-.8899724119, -1.207455634, 1.854406544], [-.9894153660, -1.127411740, 1.821548931], [-1.090021407, -1.030462678, 1.782866147], [-1.188454446, -.9151917994, 1.738382991], [-1.280590723... (3.4.29)
 

> intersectionPlot2 := plots[spacecurve](convert(subs(psi = ''rhs(EI2solution(t)[2])'', h = ''rhs(EI2solution(t)[3])'', sC), 'list'), t = 0 .. 14, numpoints = 245, color = green, thickness = 3);
 

PLOT3D(CURVES([[1.500000000, 0., 2.300215833], [1.499176094, 0.4970955002e-1, 2.313986920], [1.496684509, 0.9967687774e-1, 2.327691032], [1.492495797, .1498542477, 2.341266292], [1.486581245, .2001904... (3.4.30)
 

> plots[display]({plotS, plotC, intersectionPlot1}, title = "intersection of ellipsoid and from explicit sphere - implicit cylinder representations");
 

Plot
 

> plots[display]({plotS, plotC, intersectionPlot2}, title = "intersection of ellipsoid and from explicit cylinder - implicit sphere representations");
 

Plot
 

Define the residuals 

> res1 := unapply(EIsystem1,[phi,theta,x,y,z])(phi(t),theta(t),x(t),y(t),z(t));
 

[`+`(`*`(`/`(3, 2), `*`(sin(phi(t)), `*`(cos(theta(t))))), `-`(`*`(`^`(3, `/`(1, 2)), `*`(sin(phi(t)), `*`(sin(theta(t)))))), `-`(x(t))), `+`(`*`(`/`(3, 4), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)...
[`+`(`*`(`/`(3, 2), `*`(sin(phi(t)), `*`(cos(theta(t))))), `-`(`*`(`^`(3, `/`(1, 2)), `*`(sin(phi(t)), `*`(sin(theta(t)))))), `-`(x(t))), `+`(`*`(`/`(3, 4), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)...
[`+`(`*`(`/`(3, 2), `*`(sin(phi(t)), `*`(cos(theta(t))))), `-`(`*`(`^`(3, `/`(1, 2)), `*`(sin(phi(t)), `*`(sin(theta(t)))))), `-`(x(t))), `+`(`*`(`/`(3, 4), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)...
[`+`(`*`(`/`(3, 2), `*`(sin(phi(t)), `*`(cos(theta(t))))), `-`(`*`(`^`(3, `/`(1, 2)), `*`(sin(phi(t)), `*`(sin(theta(t)))))), `-`(x(t))), `+`(`*`(`/`(3, 4), `*`(`^`(2, `/`(1, 2)), `*`(`^`(3, `/`(1, 2)...
(3.4.31)
 

> res2 := unapply(EIsystem2,[psi,h,x,y,z])(psi(t),h(t),x(t),y(t),z(t));
 

[`+`(`*`(`/`(3, 2), `*`(cos(psi(t)))), `-`(x(t))), `+`(`*`(`/`(3, 2), `*`(sin(psi(t)))), `-`(y(t))), `+`(h(t), `-`(z(t))), `+`(`*`(`/`(31, 144), `*`(`^`(x(t), 2))), `-`(`*`(`/`(5, 144), `*`(x(t), `*`(...
[`+`(`*`(`/`(3, 2), `*`(cos(psi(t)))), `-`(x(t))), `+`(`*`(`/`(3, 2), `*`(sin(psi(t)))), `-`(y(t))), `+`(h(t), `-`(z(t))), `+`(`*`(`/`(31, 144), `*`(`^`(x(t), 2))), `-`(`*`(`/`(5, 144), `*`(x(t), `*`(...
[`+`(`*`(`/`(3, 2), `*`(cos(psi(t)))), `-`(x(t))), `+`(`*`(`/`(3, 2), `*`(sin(psi(t)))), `-`(y(t))), `+`(h(t), `-`(z(t))), `+`(`*`(`/`(31, 144), `*`(`^`(x(t), 2))), `-`(`*`(`/`(5, 144), `*`(x(t), `*`(...
(3.4.32)
 

> plots[odeplot](EI1solution, [t,res1[1]], t = 0 .. 4, numpoints = 512, axes = boxed);
plots[odeplot](EI1solution, [t,res1[2]], t = 0 .. 4, numpoints = 512, axes = boxed);
plots[odeplot](EI1solution, [t,res1[3]], t = 0 .. 4, numpoints = 512, axes = boxed);
plots[odeplot](EI1solution, [t,res1[4]], t = 0 .. 4, numpoints = 512, axes = boxed);
 

 

 

 

Plot_2d
Plot_2d
Plot_2d
Plot_2d
 

> plots[odeplot](EI2solution, [t,res2[1]], t = 0 .. 4, numpoints = 512, axes = boxed);
plots[odeplot](EI2solution, [t,res2[2]], t = 0 .. 4, numpoints = 512, axes = boxed);
plots[odeplot](EI2solution, [t,res2[3]], t = 0 .. 4, numpoints = 512, axes = boxed);
plots[odeplot](EI2solution, [t,res2[4]], t = 0 .. 4, numpoints = 512, axes = boxed);
 

 

 

 

Plot_2d
Plot_2d
Plot_2d
Plot_2d
 

 

 

>
 

>
 

 

Application to Fourbar Mechanism 

A fourbar mechanism consists of 4 rigid links connected to each other by revolute joints (wikipedia). One technique is to solve.the so-called Loop-Closure-Equation. In this technique each link is represented by its length Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi(and orientation in fixed frameTypesetting:-mrow(Typesetting:-mo( thus displacement between two successive revolute joints is given by Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi(which vanishes when summed for all links Typesetting:-mrow(Typesetting:-munderover(Typesetting:-mo( . For fourbar Loop-Closure-Equation (LCE) is given by following 

> LCE := a1*exp(I*theta1)+a2*exp(I*theta2)+a3*exp(I*theta3)-a4;
 

`+`(`*`(a1, `*`(exp(`*`(I, `*`(theta1))))), `*`(a2, `*`(exp(`*`(I, `*`(theta2))))), `*`(a3, `*`(exp(`*`(I, `*`(theta3))))), `-`(a4)) (4.1)
 

When x and y components are evaluated 

> LCEx := evalc(Re(LCE));
LCEy := evalc(Im(LCE));
 

 

`+`(`*`(a1, `*`(cos(theta1))), `*`(a2, `*`(cos(theta2))), `*`(a3, `*`(cos(theta3))), `-`(a4))
`+`(`*`(a1, `*`(sin(theta1))), `*`(a2, `*`(sin(theta2))), `*`(a3, `*`(sin(theta3)))) (4.2)
 

it is  noted that there are 2 equations Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi( and 3(=2+1) variables Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi( so continuation method described above can be applied to this problem  

> LCE := [LCEx,LCEy]:
 

> sol := solve({LCEx,LCEy},[theta2,theta3]):
 

> whattype(sol); nops(sol);
 

 

list
1 (4.3)
 

> allsol := allvalues(sol):
 

> whattype(allsol); nops([allsol]);
 

 

exprseq
2 (4.4)
 

> J := VectorCalculus:-Jacobian(LCE, [theta1,theta2,theta3]);
 

Typesetting:-mrow(Typesetting:-mi( (4.5)
 

> K := Matrix([[Matrix([e1,e2,e3])],[J]]);
 

Typesetting:-mrow(Typesetting:-mi( (4.6)
 

> OrthogonalVector := LinearAlgebra[Determinant](K);
 

`+`(`-`(`*`(e1, `*`(a2, `*`(sin(theta2), `*`(a3, `*`(cos(theta3))))))), `*`(e1, `*`(a3, `*`(sin(theta3), `*`(a2, `*`(cos(theta2)))))), `-`(`*`(a1, `*`(sin(theta1), `*`(a2, `*`(cos(theta2), `*`(e3)))))...
`+`(`-`(`*`(e1, `*`(a2, `*`(sin(theta2), `*`(a3, `*`(cos(theta3))))))), `*`(e1, `*`(a3, `*`(sin(theta3), `*`(a2, `*`(cos(theta2)))))), `-`(`*`(a1, `*`(sin(theta1), `*`(a2, `*`(cos(theta2), `*`(e3)))))...
(4.7)
 

> OrthogonalVector, RHS := LinearAlgebra[GenerateMatrix]([OrthogonalVector], [e1,e2,e3]);
 

Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
(4.8)
 

> StateDerivatives := subs([theta1 = theta1(t), theta2 = theta2(t), theta3 = theta3(t)], OrthogonalVector);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(4.9)
 

> LinearAlgebra:-Dimensions(%);
 

1, 3 (4.10)
 

> StateDerivatives := LinearAlgebra:-Row(StateDerivatives, 1);
 

Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mi(
(4.11)
 

> LinearAlgebra:-Dimensions(%);
 

3 (4.12)
 

> System := map(diff, <theta1(t), theta2(t), theta3(t)>, t)-LinearAlgebra:-Transpose(StateDerivatives);
 

Typesetting:-mrow(Typesetting:-mi( (4.13)
 

> LCE;
 

[`+`(`*`(a1, `*`(cos(theta1))), `*`(a2, `*`(cos(theta2))), `*`(a3, `*`(cos(theta3))), `-`(a4)), `+`(`*`(a1, `*`(sin(theta1))), `*`(a2, `*`(sin(theta2))), `*`(a3, `*`(sin(theta3))))] (4.14)
 

> kinematicDimensions := [a1=1,a2=2,a3=3/2,a4=2];
 

[a1 = 1, a2 = 2, a3 = `/`(3, 2), a4 = 2] (4.15)
 

> LCE0 := subs(kinematicDimensions,LCE);
 

[`+`(cos(theta1), `*`(2, `*`(cos(theta2))), `*`(`/`(3, 2), `*`(cos(theta3))), `-`(2)), `+`(sin(theta1), `*`(2, `*`(sin(theta2))), `*`(`/`(3, 2), `*`(sin(theta3))))] (4.16)
 

> eval(subs(theta1=0,LCE0));
 

[`+`(`-`(1), `*`(2, `*`(cos(theta2))), `*`(`/`(3, 2), `*`(cos(theta3)))), `+`(`*`(2, `*`(sin(theta2))), `*`(`/`(3, 2), `*`(sin(theta3))))] (4.17)
 

> sol := solve( eval(LCE0,[theta1=0]), {theta2,theta3});
 

{theta3 = `+`(Pi, `-`(arccos(`/`(1, 4)))), theta2 = `+`(`-`(arctan(`+`(`*`(`/`(3, 11), `*`(`^`(15, `/`(1, 2))))))))} (4.18)
 

> IC := eval([theta1,theta2,theta3], `union`(sol, {theta1=0}));
 

[0, `+`(`-`(arctan(`+`(`*`(`/`(3, 11), `*`(`^`(15, `/`(1, 2)))))))), `+`(Pi, `-`(arccos(`/`(1, 4))))] (4.19)
 

> System0 := [op(convert(subs(kinematicDimensions,System), 'list')), theta1(0) = IC[1], theta2(0) = IC[2], theta3(0) = IC[3]];
 

[`+`(diff(theta1(t), t), `*`(3, `*`(sin(theta2(t)), `*`(cos(theta3(t))))), `-`(`*`(3, `*`(sin(theta3(t)), `*`(cos(theta2(t))))))), `+`(diff(theta2(t), t), `*`(`/`(3, 2), `*`(cos(theta1(t)), `*`(sin(th...
[`+`(diff(theta1(t), t), `*`(3, `*`(sin(theta2(t)), `*`(cos(theta3(t))))), `-`(`*`(3, `*`(sin(theta3(t)), `*`(cos(theta2(t))))))), `+`(diff(theta2(t), t), `*`(`/`(3, 2), `*`(cos(theta1(t)), `*`(sin(th...
[`+`(diff(theta1(t), t), `*`(3, `*`(sin(theta2(t)), `*`(cos(theta3(t))))), `-`(`*`(3, `*`(sin(theta3(t)), `*`(cos(theta2(t))))))), `+`(diff(theta2(t), t), `*`(`/`(3, 2), `*`(cos(theta1(t)), `*`(sin(th...
(4.20)
 

> FourbarSolution := dsolve(System0, {theta1(t), theta2(t), theta3(t)}, 'numeric', method = rkf45, abserr = 0.1e-8, relerr = 0.1e-8);
 

proc (x_rkf45) local res, data, vars, solnproc, outpoint, ndsol, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; `:=`(_EnvDSNumericSaveDigits, Digits); `:=`(Digits, 14); if... (4.21)
 

> FourbarSolution(1);
 

[t = 1., theta1(t) = 2.28447302653109442, theta2(t) = -.834995279784028766, theta3(t) = .505697420418090404] (4.22)
 

> plots[odeplot](FourbarSolution, [t, theta1(t)], t = 0 .. 7, numpoints = 256);
 

Plot_2d
 

> plots[odeplot](FourbarSolution, [t, theta2(t)], t = 0 .. 7, numpoints = 256);
 

Plot_2d
 

> plots[odeplot](FourbarSolution, [t, theta3(t)], t = 0 .. 7, numpoints = 256);
 

Plot_2d
 

> plots[odeplot](FourbarSolution, [theta2(t), theta3(t)], t = 0 .. 7, numpoints = 256);
 

Plot_2d
 

> eval([theta1(t),theta2(t),theta3(t)], FourbarSolution(1));
 

[2.28447302653109442, -.834995279784028766, .505697420418090404] (4.23)
 

> plotFourbar := proc(KD,T)
local t123,t1,t2,t3,X,Y,XY,sol;
sol := FourbarSolution(T);
t123 := eval([theta1(t),theta2(t),theta3(t)], sol);
t1 := t123[1];
t2 := t123[2];
t3 := t123[3];
X := [0, a1*cos(t1), a1*cos(t1)+a2*cos(t2),a4];
Y := [0, a1*sin(t1), a1*sin(t1)+a2*sin(t2),0];
X := subs(KD, X);
Y := subs(KD, Y);
XY := zip( (a,b) -> [a,b], X,Y );
plots[listplot]( XY, color=blue );
end proc:
 

> #plotFourbar(kinematicDimensions,0.2);
 

> plots[animate]( plotFourbar, [kinematicDimensions ,T] ,T=0..5, frames=128, scaling=constrained,axes=boxed);
 

Plot_2d
 

Define the residuals 

> res := unapply(LCE0,[theta1,theta2,theta3])(theta1(t),theta2(t),theta3(t));
 

[`+`(cos(theta1(t)), `*`(2, `*`(cos(theta2(t)))), `*`(`/`(3, 2), `*`(cos(theta3(t)))), `-`(2)), `+`(sin(theta1(t)), `*`(2, `*`(sin(theta2(t)))), `*`(`/`(3, 2), `*`(sin(theta3(t)))))] (4.24)
 

> plots[odeplot](FourbarSolution, [t,res[1]], t = 0 .. 4, numpoints = 512, axes = boxed);
plots[odeplot](FourbarSolution, [t,res[2]], t = 0 .. 4, numpoints = 512, axes = boxed);
 

 

Plot_2d
Plot_2d
 

>
 

Conclusions 

In this worksheet Numerical Continuation Method is applied to surface-surface intersection problem and kinematic analysis of mechanisms. For all 3 (explicit-explicit, explicit-implicit, implicit-implicit) representations of surfaces and LCE formulation of fourbar mechanism , method is verified by graphical means.  One important advantage of  the method described seems to be possibility of handling singular cases in a simple manner. In this respect, method is similar to Adjoint-Jacobian approach for (differential) inverse kinematics of serial manipulators. 

 

In literature, some other applications of numerical continuation methods can be found. Examples of application of the method include determination of trim point of an aircraft (for one selected varying parameter like speed, pitch angle, flight path angle, thrust, &c), envelope of moving planar shapes (for checking collision/interference of objects) and  inverse kinematics of serial manipulators.

Usual Numerical Continuation techniques include a corrector (step) to compensate for deviations from solution curve caused by finite steps taken by prediction step. A candidate to embed such correction to continous ODE-IVP approach is to define total residual scalar
 

 

Typesetting:-mrow(Typesetting:-mi( 

 

from which a direction for the minimization of residual is obtained by the gradient of Typesetting:-mrow(Typesetting:-mi(, viz. 

 

Typesetting:-mrow(Typesetting:-mi( 

 

so that nominal direction Typesetting:-mrow(Typesetting:-mi( is bended towards the Typesetting:-mrow(Typesetting:-mi(minimizing direction by  

 

Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mrow(Typesetting:-mi( 

 

with possibly a heurustic selection of suitable Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi(pairs 

References 

 

Eugene L. Allgower, Kurt Georg. Introduction to Numerical Continuation Methods, SIAM, 1987 

 

Numerical Continuation, Wikipedia 

 


Legal Notice: The copyright for this application is owned by the author(s). Neither Maplesoft nor the author are responsible for any errors contained within and are not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact the author for permission if you wish to use this application in for-profit activities.
 

 

Image