modelica - Optimal control of a boiler: using Fluid Library w. the DynamicPipe component using JModelica -


im interested in using jmodelica model have constructed in dymola.

specifically, have model of boiler using dynamicpipe component, , transfer heat pipe warm water inside it, , employ pump component control pressure difference on entire boiler. model compiles fine fmu using jmodelica , able simulate without problems.

however, wan't find optimal control sequence bring boiler operating point , here things stop working.

i have written .mop file optimization problem, when call transfer_optimization_problem, following error:

warning: ignored enumeration typed variable: eval parameter modelica.fluid.types.modelstructure boiler.boilerfmu.boiler.pipe.modelstructure = modelica.fluid.types.modelstructure.av_b "determines whether flow or volume models present @ ports" /* modelica.fluid.types.modelstructure.av_b */ java error occurred: exception in thread "main" java.lang.unsupportedoperationexception: cannot convert expression mx: size(a, 1) @ org.jmodelica.optimica.compiler.fexp.tomx(fexp.java:4516) @ org.jmodelica.optimica.compiler.fmaxexp.tomx(fmaxexp.java:560) @ org.jmodelica.optimica.compiler.fexp.tomxvector(fexp.java:4497) @ org.jmodelica.optimica.compiler.fassignstmt.updateexpressionsaccordingtostatement(fassignstmt.java:385) @ org.jmodelica.optimica.compiler.ffunctiondecl.generatefinalexpressionvector(ffunctiondecl.java:1365) @ org.jmodelica.optimica.compiler.ffunctiondecl.tomxfunction_compute(ffunctiondecl.java:2878) @ org.jmodelica.optimica.compiler.ffunctiondecl.tomxfunction(ffunctiondecl.java:2865) @ org.jmodelica.optimica.compiler.ffunctioncall.tomxvector(ffunctioncall.java:1578) @ org.jmodelica.optimica.compiler.ffunctioncallstmt.updateexpressionsaccordingtostatement(ffunctioncallstmt.java:391) @ org.jmodelica.optimica.compiler.ffunctiondecl.generatefinalexpressionvector(ffunctiondecl.java:1365) @ org.jmodelica.optimica.compiler.ffunctiondecl.tomxfunction_compute(ffunctiondecl.java:2878) @ org.jmodelica.optimica.compiler.ffunctiondecl.tomxfunction(ffunctiondecl.java:2865) @ org.jmodelica.optimica.compiler.ffunctioncall.tomxvector(ffunctioncall.java:1578) @ org.jmodelica.optimica.compiler.ffunctioncallstmt.updateexpressionsaccordingtostatement(ffunctioncallstmt.java:391) @ org.jmodelica.optimica.compiler.ffunctiondecl.generatefinalexpressionvector(ffunctiondecl.java:1365) @ org.jmodelica.optimica.compiler.ffunctiondecl.tomxfunction_compute(ffunctiondecl.java:2878) @ org.jmodelica.optimica.compiler.ffunctiondecl.tomxfunction(ffunctiondecl.java:2865) @ org.jmodelica.optimica.compiler.ffunctioncall.tomxvector(ffunctioncall.java:1578) @ org.jmodelica.optimica.compiler.ffunctioncall.tomx(ffunctioncall.java:1562) @ org.jmodelica.optimica.compiler.fdotsubexp.tomx(fdotsubexp.java:544) @ org.jmodelica.optimica.compiler.fvariable.parameterequationtomxbindingexpression(fvariable.java:3807) @ org.jmodelica.optimica.compiler.fvariable.findmxbindingexpressionifpresent(fvariable.java:3770) traceback (most recent call last): file "boiler_opt.py", line 89, in <module> op = transfer_optimization_problem("boileroptimization.opt", paths, compiler_log_level='error') file "/opt/jmodelica/python/pyjmi/casadi_interface.py", line 171, in transfer_optimization_problem accept_model=accept_model) file "/opt/jmodelica/python/modelicacasadi_transfer/modelica_casadi_transfer_wrapper.py", line 156, in transfer_optimization_problem _get_options(compiler_options), compiler_log_level) file "/opt/jmodelica/python/modelicacasadi_transfer/modelica_casadi_transfer_wrapper.py", line 179, in _transfer_optimica return modelicacasadi_wrapper._transferoptimizationproblem(ocp, class_name, files, options, log_level) file "/opt/jmodelica/python/modelicacasadi_wrapper/modelicacasadi_wrapper.py", line 3417, in _transferoptimizationproblem return _modelicacasadi_wrapper._transferoptimizationproblem(*args) runtimeerror: java error occurred; details printed 

apparently, not happy enumerate type in dynamicpipe model specifies model structure.

to check indeed model problem, linearized , used linearised version in optimization problem; this ran perfectly.

any idea on how handle this? :-)

regards,

joakim

update: asked same question on jmodelica forums, following response. however, have not yet found solution circumvent errors: http://www.jmodelica.org/27776#comment-6467

so acceptable answer provided on jmodelica forums fredrik: http://www.jmodelica.org/27776#comment-6468

simply put: the msl media library not supported.

my solution instead built own small fluid library use case - no-brainer in case of single-phase water, , works perfectly. must admit, have been nice able use msl fluid library, not lock myself in own fluid interface.


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -