バックナンバーはこちら。
https://www.simulationroom999.com/blog/model-based-of-minimum-2-backnumber/
はじめに
前回、DCモータモデルのモデル宣言部を確認。
OpenModelica Connection Editorと同様のモデルが配置されているはず・・・。
と思いきや、DcPermanentMagnetDataがモデル宣言部にいなかった。
さらに、モデル初期値にもDcPermanentMagnetDataのメンバ変数が依存しており、
DcPermanentMagnetDataの説明をしなければモデル宣言部の説明ができない状態に陥る。
今回は、DcPermanentMagnetDataについて説明していく。
実は、OpenModelica Connection Editor上での使い勝手を良くするような…。
登場人物
博識フクロウのフクさん

イラスト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
DcPermanentMagnetData

DcPermanentMagnetDataってなにさー?!

ま、簡単に言うとDC_PermanentMagnetモデルに必要且つおおよそ妥当なパラメータをOpenModelica Connection Editorで編集するためのブロックだね。

へ?
OpenModelica Connection Editorで編集??

うん。
OpenModelica Connection Editor上でDcPermanentMagnetDataをダブルクリックしてみな。

こんなん出てきた。



DcPermanentMagnetDataパラメータの渡し先

そして、DcPermanentMagnetDataのパラメータがどこにわたっているかと言うと・・・

DC_PermanentMagnetに渡してるのか!
Machines.BasicMachines.DCMachines.DC_PermanentMagnet dcpm(
VaNominal=dcpmData.VaNominal,
IaNominal=dcpmData.IaNominal,
wNominal=dcpmData.wNominal,
TaNominal=dcpmData.TaNominal,
Ra=dcpmData.Ra,
TaRef=dcpmData.TaRef,
La=dcpmData.La,
Jr=dcpmData.Jr,
useSupport=false,
Js=dcpmData.Js,
frictionParameters=dcpmData.frictionParameters,
coreParameters=dcpmData.coreParameters,
strayLoadParameters=dcpmData.strayLoadParameters,
brushParameters=dcpmData.brushParameters,
TaOperational=293.15,
alpha20a=dcpmData.alpha20a,
phiMechanical(fixed=true),
wMechanical(fixed=true),
ia(fixed=true)) annotation (Placement(transformation(extent={{-20,-50},
{0,-30}})));

そうそう。
どんなパラメータが必要そうかをDcPermanentMagnetDataである程度設定できれば、
それをDC_PermanentMagnetに渡せばOKって構造になってる。

でも、これ、DC_PermanentMagnet側に直接指定すればいいんじゃない?

それでも良いが、同じ特性のモータが6個とか並んでたら?

あ、いちいち設定するのがメンドクサイ!

というわけでパラメータの複製を目的としているのがDcPermanentMagnetDataとなる。

これもサボりポイントってやつか。

そうだねー。
振る舞いの複製はModelicaのオブジェクト指向的特性でなんとかなるが、
パラメータの複製は専用のブロックがあると楽ができる。
あと、ある程度デフォルト値が最初から埋まってるんで、
とりあえず何も考えず繋いで動かしたい場合も結構有用。

意外と欲しいものが揃ってるって感じだねー。

まぁこの手のツールを使う人達ってめんどくさがり屋が多いからね。
サボるためには労力を惜しまないのだろう。
我々はその労力もかけずに有難く使わせてもらってるって寸法だ。

うーん、そういう言い方されると僕たちが悪いヤツみたいになっちゃうなー。

いやいや、全力でサボらせてもらう方が礼儀ってもんだよー。

そんなもんかー。
まとめ

まとめだよ。
- DcPermanentMagnetDataをOpenModelica Connection Editorで確認。
- UI上で様々なパラメータを設定可能。
- さらにそのパラメータをDC_PermanentMagnetに渡すことでモデル初期化している。
- 初期化するモデルが一個だとあまり意味がないかもだが、同特性モデルが複数あるとサボれる。
バックナンバーはこちら。
コメント