Click or drag to resize

CalculatorCalculateState Method

Calculates the state at time dt forward from the initial state.

Namespace: Demo3D.Visuals.Motor
Assembly: Demo3D.Core (in Demo3D.Core.dll) Version: 19.00.00
Syntax
C#
public static State CalculateState(
	 in State initial,
	double vd,
	double amax,
	double dmax,
	double smin,
	double smax,
	double dt
)

Parameters

initial  State
The initial state.
vd  Double
The (signed) target velocity.
amax  Double
The (unsigned) maximum acceleration (0 for infinite).
dmax  Double
The (unsigned) maximum deceleration (0 for infinite).
smin  Double
The (signed) minimum position (can be -Inf).
smax  Double
The (signed) maximum position (can be +Inf).
dt  Double
The time to step forward.

Return Value

State
The state at time t0 + dt.
Remarks
This function makes the following assumptions, which the parameters must satisfy: 1. The initial time is positive (>= 0). 2. The time-step dt is positive (>= 0). 3. The maximum acceleration amax is finite and positive (>= 0). 4. The maximum deceleration dmax is finite and positive (>= 0). 5. The maximum position limit is greater than or equal to the minimum position limit. Failure to satisfy the assumptions will likely result in garbage being returned.
See Also