Main Content

Position-Based Translational Domain

The position-based mechanical translational domain declaration is shown below.

domain translational
% Position-Based Mechanical Translational Domain
% For every node, velocity is the derivative of position.

% Copyright 2023 The MathWorks, Inc.

parameters
    gravity = { 0,    'm/s^2'}; % Downward gravitational acceleration, g
    theta   = { 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 theta, 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 

Related Topics