バックナンバーはこちら。
https://www.simulationroom999.com/blog/model-based-of-minimum-2-backnumber/
はじめに
前回、信号入力を可変にするためにソースブロックについて簡単に説明。
いままでのmassモデルを流用することを想定し、forceとtrapezoidを使ってみることに。
ただ、Modelicaの既存ブロックは大量にあるためにどこにあるやら。
尚、forceとtrapezoidは全く別のカテゴリに居たりする。
登場人物
博識フクロウのフクさん

イラストACにて公開の「kino_k」さんのイラストを使用しています。
https://www.ac-illust.com/main/profile.php?id=iKciwKA9&area=1
エンジニア歴8年の太郎くん

イラストACにて公開の「しのみ」さんのイラストを使用しています。
https://www.ac-illust.com/main/profile.php?id=uCKphAW2&area=1
forceブロックはどこ?

まずはforceブロックがどこにあるか。

いままで使ってたmassモデルのconstant forceと同じとこにあるね。

constant forceの話が出たところって・・・。

ここか!

ふんふん。
Modelica→Mechanics→Translational→Sources
で潜っていけばいいのね。


これをドラッグしてくれば良いね。
trapezoidブロックはどこ?

次はtrapezoidブロックだけど・・・。
どこにあるんだ?
これもconstant forceの近くにあるのかな?

trapezoidは全く別のところだね。

ここにあるよ。
Modelica→Blocks→Sources→Trapezoid


じゃ、これもドラッグして。
OpenModelica Connection Editorで接続

あとは線でつなげばOKだね。

そうそう。

こんな感じ。


うん。
いいんじゃないかな。

あと、Trapezoidに設定値が居るのかな?

そうだね。
デフォルトだと台形波じゃなくて矩形波っぽいのが出るような設定になっていたと思う。
よって、通常であればここで狙った波形になるように修正・・・。
なんだけど、今回はデフォルトのままで行こう。

え?いいの?

いいよ。

まぁそういうなら、そのままにしておこう。
Modelicaコードの修正は必要?

あと、パラメータを簡単に変えられるようにModelicaコードを修正とかいるのかな?
前回のForce1、Force2みたいな感じで。

今回は不要でいいかなー。

え?そこも不要でいいの???

うん。
まぁなぜ不要かは実際に動かしてみると変わると思うよ。

うーん、いままでとはちょっと雰囲気が違うのかー??
まとめ

まとめだよ。
- trapezoidブロックとForceブロックを配置。
- ForceブロックはModelica→Mechanics→Translational→Sourcesにある。
- trapezoidブロックはModelica→Blocks→Sources→Trapezoidにある。
- 本来はtrapezoidを修正する必要があるが今回は不要。
バックナンバーはこちら。
コメント