Mechanical Position-Based Translational Domain
The position-based translational domain declaration is shown below.
domain translational
% Mechanical Position-Based Translational Domain
% For every node, velocity is the derivative of position.
% Copyright 2023-2025 The MathWorks, Inc.
parameters
gravity = { 9.81, 'm/s^2'}; % Downward gravitational acceleration, g
beta = { 0, 'deg' }; % Domain positive direction incline angle, β
end
variables
x = { 0, 'm' }; % Position
v = { 0, 'm/s' }; % Velocity
end
variables(Balancing=true)
f = { 0, 'N' }; % Force
end
equations
der(x) == v;
end
end
The domain contains the following variables and parameters:
Across variable x (position), in m
Across variable v (velocity), in m/s
Through variable f (force), in N
Parameter gravity, specifying the downward gravitational acceleration
Parameter beta, specifying the positive direction incline angle
The domain parameters, also accessible through the Mechanical Translational Properties (PB) block, are global parameters that propagate their values to all the blocks in the attached circuit.
The domain has two Across variables (position and velocity) and only one Through
variable (force). Therefore, the equations section contains one
equation that establishes the mathematical relationship between the position and
velocity, der(x) == v. For more information, see Domain Equations.
To refer to this domain in your custom component declarations, use the following syntax:
foundation.translational.translational