Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.8K Views
|
5 Replies
|
8 Total Likes
View groups...
Share
Share this post:

Model a basic mechanical system: 1 spring with 2 hanging masses connected?

Posted 6 years ago
POSTED BY: Mor Bo
5 Replies

One other thought I just had is maybe the reason my initialize to steady state does not work is that our initial position is too far from the steady solution. You can try moving the masses close and then try it.

POSTED BY: Neil Singer
POSTED BY: Neil Singer

Here is the model with the bar and mass flying off.

enter image description here

Attachments:
POSTED BY: Neil Singer
Posted 6 years ago
POSTED BY: Mor Bo

Mor,

The way to model a detaching mass is as a lineforce combined with a stiff spring representing the rigid translation. By editing a spring component, you can make the spring "give up" and apply no force when a boolean variable changes.

Here is an example system:

enter image description here

The detachable spring is coded:

model DetachableSpring
  import SI = Modelica.SIunits;
  extends Modelica.Mechanics.Translational.Interfaces.PartialCompliant;
  parameter SI.TranslationalSpringConstant c(final min = 0, start = 1) "spring constant ";
  parameter SI.Distance s_rel0 = 0 "unstretched spring length";
  Modelica.Blocks.Interfaces.BooleanInput attached annotation(Placement(visible = true, transformation(origin = {-100.0, 68.0}, extent = {{-20.0, -20.0}, {20.0, 20.0}}, rotation = 0), iconTransformation(origin = {0.0, 120.0}, extent = {{-20.0, -20.0}, {20.0, 20.0}}, rotation = -90)));
equation
  f = if attached then c * (s_rel - s_rel0) else 0;
end DetachableSpring;

The simulation looks like this (note the distance between the masses is plotted in the background showing the release at 3.5 seconds.

The full model is attached.

enter image description here

Regards,

Neil

Attachments:
POSTED BY: Neil Singer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard