#

API Docs for: 0.6.1
Show: Inherited Protected Private Deprecated

# Equation Class

Defined in: `src/equations/Equation.js:6`

Equation base class

## Constructor

### `Equation`

(

- `bi`
- `bj`
- `minForce`
- `maxForce`

)

Defined in `src/equations/Equation.js:6`

#### Parameters:

- `bi` Body
- `bj` Body
- `minForce` Number

  Minimum (read: negative max) force to be applied by the constraint.

- `maxForce` Number

  Maximum (read: positive max) force to be applied by the constraint.

- Index
- Methods
- Properties

## Item Index

### Methods

- addToWlambda
- computeB
- computeGiMf
- computeGiMGt
- computeGq
- computeGW
- computeGWlambda
- computeInvC
- setSpookParams

### Properties

- a
- b
- bi
- bj
- enabled
- eps
- jacobianElementA
- jacobianElementB
- maxForce
- minForce

## Methods

### `addToWlambda`

(

- `deltalambda`

)

Defined in `src/equations/Equation.js:228`

Add constraint velocity to the bodies.

#### Parameters:

- `deltalambda` Number

### `computeB`

() Number

Defined in `src/equations/Equation.js:95`

Computes the RHS of the SPOOK equation

#### Returns:

Number:

### `computeGiMf`

() Number

Defined in `src/equations/Equation.js:159`

Computes Ginv(M)f, where M is the mass matrix with diagonal blocks for each body, and f are the forces on the bodies.

#### Returns:

Number:

### `computeGiMGt`

() Number

Defined in `src/equations/Equation.js:191`

Computes Ginv(M)G'

#### Returns:

Number:

### `computeGq`

() Number

Defined in `src/equations/Equation.js:107`

Computes G*q, where q are the generalized body coordinates

#### Returns:

Number:

### `computeGW`

() Number

Defined in `src/equations/Equation.js:124`

Computes G*W, where W are the body velocities

#### Returns:

Number:

### `computeGWlambda`

() Number

Defined in `src/equations/Equation.js:142`

Computes G*Wlambda, where W are the body velocities

#### Returns:

Number:

### `computeInvC`

(

- `eps`

)
Number

Defined in `src/equations/Equation.js:262`

Compute the denominator part of the SPOOK equation: C = Ginv(M)G' + eps

#### Parameters:

- `eps` Number

#### Returns:

Number:

### `setSpookParams`

()

Defined in `src/equations/Equation.js:82`

Recalculates a,b,eps.

## Properties

### `a`

Number

Defined in `src/equations/Equation.js:41`

SPOOK parameter

### `b`

Number

Defined in `src/equations/Equation.js:47`

SPOOK parameter

### `bi`

Body

Defined in `src/equations/Equation.js:29`

### `bj`

Body

Defined in `src/equations/Equation.js:35`

### `enabled`

Boolean

Defined in `src/equations/Equation.js:69`

Default: true

### `eps`

Number

Defined in `src/equations/Equation.js:53`

SPOOK parameter

### `jacobianElementA`

JacobianElement

Defined in `src/equations/Equation.js:59`

### `jacobianElementB`

JacobianElement

Defined in `src/equations/Equation.js:64`

### `maxForce`

Number

Defined in `src/equations/Equation.js:24`

### `minForce`

Number

Defined in `src/equations/Equation.js:19`