Hydrodynamic ball with Kalman filtering capabilities.
KalmanHydroBall inherits from both HydroBall and KalmanObject, so that it is applicable for Kalman filtering. It has all the setup HydroBall has, with additional inputs and parameters defined below.
- Author
- Joakim Haugen
Example configuration excerpt
<Lib
LibName = "fhsim_base"
SimObject = "Kalman/Example/HydroBall"
Name = "Ball"
Radius = "1"
Density = "2000"
MeasurementNoise = "1"
PositionUncertainty = "5e-4"
VelocityUncertainty = "1e-6"
InitialDiagP = "1e-3,1e-3,1e-3,1e-4,1e-4,1e-4"
/>
<Connection
Ball.ExternForce = "Cable.ForceB"
Ball.Current = "Current.State"
/>
<Connection
Ball.MeasuredPosition = "0,0,18.8"
/>
<InitialCondition
Ball.Position = "0,19,0"
Ball.Velocity = "0,0,0"
/>
Input Ports
Name | Width | Description |
ExternForce | 3 | External forces acting on the ball, e.g. from other SimObjects. |
Current | 3 | The uniform current of the surrounding water. |
MeasuredPosition | 3 | The measurement of its position. |
Output Ports
Name | Width | Description |
Position | 3 | The position of the centroid of the ball. |
Velocity | 3 | The linear velocity of the ball. |
Configuration parameters
Name | Width | Description |
Radius | 1 | Radius of the ball [meter]. |
Density | 1 | Density of the ball [kg/m^3]. |
MeasurementNoise | 1 | Noise variance for the position measurement [m^2]. |
PositionUncertainty | 1 | Variance of the position [m^2]. |
VelocityUncertainty | 1 | Variance of the velocity [(m/s)^2]. |
InitialDiagP | 6 | Estimation error variance at initial time [diag([m^2, m^2, m^2], (m/s)^2, (m/s)^2, (m/s)^2])]. |
Initial conditions
Name | Width | Description |
Position | 3 | -. |
Velocity | 3 | -. |
Full example file
<Contents>
<OBJECTS>
<Lib
LibName = "fhsim_base"
SimObject = "Kalman/ZeroDynamics"
Name = "Current"
Dimension = "3"
P0 = "5e-2,5e-2,1e-4"
Q = "1e-4,1e-4,1e-5"
/>
<Lib
LibName = "fhsim_base"
SimObject = "Kalman/Example/HydroBall"
Name = "Ball"
Radius = "1.0"
Density = "1100"
MeasurementNoise = "1"
PositionUncertainty = "5e-4"
VelocityUncertainty = "1e-6"
InitialDiagP = "1e-3,1e-3,1e-3,1e-3,1e-3,1e-3"
/>
<Lib
LibName = "fhsim_base"
SimObject = "Kalman/Example/HydroCable"
Name = "Cable"
Diameter = "0.02"
Density = "2000"
Modulus = "20"
Length = "20"
InternalPoints = "2"
ElementPositionUncertainty = "5e-4"
ElementVelocityUncertainty = "1e-6"
ElementInitialDiagP = "1e-3,1e-3,1e-3,1e-3,1e-3,1e-3"
/>
</OBJECTS>
<INTERCONNECTIONS>
<Connection
Ball.ExternForce = "Cable.ForceB"
Ball.Current = "Current.State"
/>
<Connection
Cable.PositionA = "0,0,0"
Cable.PositionB = "Ball.Position"
Cable.VelocityA = "0,0,0"
Cable.VelocityB = "Ball.Velocity"
Cable.Current = "Current.State"
/>
<Connection
Ball.MeasuredPosition = "0,0,18.8"
/>
</INTERCONNECTIONS>
<INITIALIZATION>
<InitialCondition
Ball.Position = "0,19,0"
Ball.Velocity = "0,0,0"
Current.State = "0,0,0"
/>
</INITIALIZATION>
<INTEGRATION>
<Engine
IntegratorMethod="0"
NumCores="1"
TOutput="0, 0:1e-1:Inf, 150"
stepsize ="2e-4"
HMin="0.5"
FileOutput="objects:ports"
/>
</INTEGRATION>
</Contents>
This SimObject is referred to as Kalman/Example/HydroBall