0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

OpenModelicaで接触のモデル化

Posted at

作りたいモデル

Modelicaを使用して質量の跳ね返り計算を行いたい。
モデル化方針としては質量がめり込んでいる間(圧縮)は線形バネとして振る舞い、めり込んでいない間(引張)に関しては力を発生しない要素を作成する。

式で表現すると
要素の相対変位を$x$としたとき、以下のような力$f$を発生させる
$$f=
\left\{
\begin{array}{cl}
kx & (x<0) \\
0 & (x\geq0)
\end{array}
\right.$$

アイコンのレイアウト

アイコンビューでFlange_aFlange_bをレイアウトし、わかりやすい見た目にする。
image.png
image.png
image.png

モデルコード作成

全文
model nonlinear_spring
  Modelica.Mechanics.Translational.Interfaces.Flange_a flange_a annotation(
    Placement(transformation(origin = {-100, 0}, extent = {{-10, -10}, {10, 10}}), iconTransformation(origin = {-100, -2}, extent = {{-10, -10}, {10, 10}})));
  Modelica.Mechanics.Translational.Interfaces.Flange_b flange_b annotation(
    Placement(transformation(origin = {100, 0}, extent = {{-10, -10}, {10, 10}}), iconTransformation(origin = {100, 0}, extent = {{-10, -10}, {10, 10}})));
  parameter Real c(final min=0, start=1, unit="N/m") "Spring constant";
  Real disp(unit="m");
  Real f(unit="N");
equation
  disp = flange_b.s - flange_a.s;
  if disp < 0 then
    f = c*disp;
  else
    f = 0;
  end if;
  flange_a.f = -f;
  flange_b.f = f;
  annotation(
    uses(Modelica(version = "4.0.0")),
    Icon(graphics = {Rectangle(fillColor = {255, 255, 127}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -100}}), Text(extent = {{-100, 40}, {100, -40}}, textString = "NonLinear
Spring")}));
end nonlinear_spring;


このモデルの本質となるequation部分の定義。

equation
  disp = flange_b.s - flange_a.s;
  if disp < 0 then
    f = c*disp;
  else
    f = 0;
  end if;
  flange_a.f = -f;
  flange_b.f = f;

dispで各フランジ間の相対変位を計算。dispが負の値となっていれば線形バネとして振る舞い、dispが正の値を取っている場合は力を発生させない。
モデル上はa端からB端に向かう方向を正と考えているため、flange_a.f=-f, flange_b.f = fと定義している。

テストモデルの作成

以下のような系で実験。前セクションで作成したモデルは黄色のNonLinear Springとして配置している。
image.png

flange_aをfixedで拘束し、flange_bにはmass要素を配置している。

NonLinear Springのパラメータ
image.png

massのパラメータ
image.png

解析結果

massにかかる力とmassの速度
massは速度-1で衝突し反力を受けたうえで速度+1として進み続けている。
f2m.png

最後に

このモデルを改造し以下のように応用したい。

  • 減衰特性の追加(反発係数の低減)
  • $p\text{-}\delta$線図のテーブルデータ入力(ブッシュなどの非線形特性を再現)
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?