次のコードを使用して、JModelica から結果を出力しています。
#!/usr/local/jmodelica/bin/jm_python.sh
import pyjmi
op = pyjmi.transfer_optimization_problem("BatchReactor", "model.mop")
opt_opts = op.optimize_options()
opt_opts['n_e'] = 40 # Number of elements
opt_opts['result_file_name'] = '/z/out'
opt_opts['IPOPT_options']['tol'] = 1e-10
opt_opts['IPOPT_options']['print_level'] = 0
res = op.optimize(options=opt_opts)
ファイル/z/out
を調べると、次の構造になっています。
#1
char Aclass(3,11)
Atrajectory
1.1
char name(14,9)
time
S0
F0
a
b
f
h
startTime
finalTime
der(F)
der(S)
F
S
u
char description(14,17)
Time in [s]
Fluid Mass
Solid Mass
int dataInfo(14,4)
0 1 0 -1 # time
1 2 0 -1 # S0
1 3 0 -1 # F0
1 4 0 -1 # a
1 5 0 -1 # b
1 6 0 -1 # f
1 7 0 -1 # h
1 8 0 -1 # startTime
1 9 0 -1 # finalTime
2 2 0 -1 # der(F)
2 3 0 -1 # der(S)
2 4 0 -1 # F
2 5 0 -1 # S
2 6 0 -1 # u
float data_1(2,9)
0.00000000000000E+00 5.10000000000000E+00 0.00000000000000E+00 2.00000000000000E-01 1.00000000000000E+00 5.00000000000000E-02 5.00000000000000E-02 0.00000000000000E+00 2.00000000000000E+01
2.00000000000000E+01 5.10000000000000E+00 0.00000000000000E+00 2.00000000000000E-01 1.00000000000000E+00 5.00000000000000E-02 5.00000000000000E-02 0.00000000000000E+00 2.00000000000000E+01
float data_2(121,6)
0.00000000000000E+00 3.86148766414463E-06 -3.86148766414463E-06 0.00000000000000E+00 5.10000000000000E+00 3.86148766414463E-06
7.75255128608411E-02 2.47477765642993E-06 -2.46259047556037E-06 2.43743619355378E-07 5.09999975693332E+00 2.47477757686100E-06
3.22474487139159E-01 -7.12360587129927E-09 3.14767685363840E-08 4.87063261121143E-07 5.09999951841489E+00 0.00000000000000E+00
5.00000000000000E-01 -2.27821146604573E-09 2.54684613056978E-08 4.63805003867590E-07 5.09999954601731E+00 0.00000000000000E+00
5.77525512860841E-01 -8.07822248879287E-09 3.12397120851912E-08 4.63229798975842E-07 5.09999954838959E+00 0.00000000000000E+00
8.22474487139159E-01 -9.05155979680226E-09 3.21027761722239E-08 4.61024334454370E-07 5.09999955625463E+00 0.00000000000000E+00
1.00000000000000E+00 -6.46538054719305E-09 2.94456844114636E-08 4.59606084166055E-07 5.09999956175866E+00 0.00000000000000E+00
1.07752551286084E+00 -9.03814030251626E-09 3.19848463370596E-08 4.58934127540645E-07 5.09999956421108E+00 0.00000000000000E+00
1.32247448713916E+00 -9.43227406481859E-09 3.22625894212407E-08 4.56606313871655E-07 5.09999957214518E+00 0.00000000000000E+00
1.50000000000000E+00 -7.70752804891954E-09 3.04605248620022E-08 4.55059942934373E-07 5.09999957773756E+00 0.00000000000000E+00
1.57752551286084E+00 -9.35854831586841E-09 3.20762829272391E-08 4.54354698868064E-07 5.09999958020553E+00 0.00000000000000E+00
1.82247448713916E+00 -9.59489214423911E-09 3.21941728450351E-08 4.51985620549206E-07 5.09999958812461E+00 0.00000000000000E+00
2.00000000000000E+00 -8.30366982351327E-09 3.08226050857767E-08 4.50378711706052E-07 5.09999959373626E+00 0.00000000000000E+00
2.07752551286084E+00 -9.51883430217167E-09 3.20016584318585E-08 4.49656489022018E-07 5.09999959620300E+00 0.00000000000000E+00
2.32247448713916E+00 -9.68509482363463E-09 3.20484384547136E-08 4.47266878942693E-07 5.09999960408497E+00 0.00000000000000E+00
...
ここで、 は...
までさらに多くの行があることを意味しfinalTime
ます。
しかし、これはどういう意味ですか?この出力のフォーマットはどこで指定されていますか?