Declare a Spring Component
The following diagram shows a network representation of a mass-spring-damper system, consisting of four components (mass, spring, damper, and reference) in a mechanical rotational domain.
The domain is declared in a file named rotational.ssc
(see Declare a Mechanical Rotational Domain).
The following file, named spring.ssc
, declares
a component called spring. The component contains:
Two rotational nodes,
r
andc
(for rod and case, respectively)Parameter
k
, with a default value of10 N*m/rad
, specifying the spring rateThrough and Across variables, torque
t
and angular velocityw
, later to be related to the Through and Across variables of the rotational domainInternal variable
theta
, with a default value of0 rad
, specifying relative angle, that is, deformation of the spring
component spring nodes r = foundation.mechanical.rotational.rotational; c = foundation.mechanical.rotational.rotational; end parameters k = { 10, 'N*m/rad' }; % spring rate end variables theta = { 0, 'rad' }; % introduce new variable for spring deformation t = { 0, 'N*m' }; % torque through w = { 0, 'rad/s' }; % velocity across end % branches here % equations here end
Note
This example shows only the declaration section of the spring component. For a complete file listing of a spring component, see Mechanical Component — Spring.
Related Examples
- Declare Component Variables
- Declare Component Parameters
- Declare Component Nodes
- Declare Component Inputs and Outputs