図のようにコンポーネントのOutputにout2を追加。
以下、ソースコードの中にあるコメント文で探してね。
(1)!Do All of the "Very First Call of the Simulation Manipulations" Here
Call SetNumberofOutputs(1)の数字を変更します。
数はOutputsの総数を設定します。
例:
Call SetNumberofOutputs(2)
(2)!Do All of the First Timestep Manipulations Hereの箇所にある
!Set the Initial Values of the Outputs (#,Value)
プロフォルマのアウトプット#番目に、初期値Valueを設定します。
例:
Call SetOutputValue(1, 0) ! Out1
Call SetOutputValue(2, 0) ! Out2 ! ←追加
(3)!Set the Outputs from this Model (#,Value)
(2)と同じものをひとまず追加しておけばOK
例:
Call SetOutputValue(1, 0) ! Out1
Call SetOutputValue(2, 0) ! Out2 ! ←追加
ちなみに、デフォルトでOutputは宣言されません。
Outputの値を自分で宣言して引き渡してあげたほうが式を組み立てやすいです。
例: ! INPUTS
DOUBLE PRECISION Inp1
DOUBLE PRECISION Inp2
DOUBLE PRECISION Out1 ! ←追加
DOUBLE PRECISION Out2 ! ←追加
・・・
out1=inp1+inp2
out2=inp1*inp2
Call SetOutputValue(1, Out1) ! Out1
Call SetOutputValue(2, Out2) ! Out2
こんな感じー。
以上、Over !!