Dymola的实时优化(Realtime Optimization in Dymola)

编程入门 行业动态 更新时间:2024-10-10 19:16:58
Dymola的实时优化(Realtime Optimization in Dymola)

我想知道是否有人使用过Dymola中的优化库而没有使用显式植物本构方程来输入标准函数的RealtimeOptimization函数? 具体来说,我试图使用我的一些模型的状态作为标准函数,但是当我输入y[1] := mymodel.state; 在国家周围有或没有引号,Dymola拒绝这个功能。 任何想法都会非常有帮助。 谢谢。

I was wondering if anyone who has used the Optimization Library in Dymola has been able to utilize the RealtimeOptimization function without having explicit plant constitutive equations to input into the criteriaFunction? Specifically, I am trying to use some of my model's states as the criteria function, but when I input y[1] := mymodel.state; with or without quotes around the state, Dymola rejects the function. Any thoughts would be very helpful. Thank you.

最满意答案

无法访问函数内的模型变量。 您必须通过函数的输入提供变量的值。 RealtimeOptimization任务旨在在模拟Modelica模型期间调用。 条件函数具有定义的输入nTuners,nCriteria,tuners [nTuners]。 您可以添加其他输入变量,请参阅Example Optimization.Tasks.RealtimeOptimization.Examples.Example02.RunSampled以及函数Optimization.Tasks.RealtimeOptimization.Examples.Example02.criteriaFunc02中的记录UserData。 通过这些附加变量,您可以将一些状态变量转移到critiera函数中。

如果您提供有关您的设置的更多信息,也许我们可以为您提供帮助。 我是Dymola优化库的主要开发人员。

It is not possible to have access to model variables inside a function. You have to provide the values of the variables through the inputs to the function. The task RealtimeOptimization is aimed to be called during the simulation of a Modelica model. The criteria function has the defined inputs nTuners, nCriteria, tuners[nTuners]. You can add additional input variables, see the Example Optimization.Tasks.RealtimeOptimization.Examples.Example02.RunSampled and the record UserData in the function Optimization.Tasks.RealtimeOptimization.Examples.Example02.criteriaFunc02. By these additional variables you could transfer some state variables into the critiera function.

Maybe we can assist you, if you provide more information about your setting. I am the main developer of the Optimization library in Dymola.

更多推荐

本文发布于:2023-08-01 03:14:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1354187.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:实时   Dymola   Optimization   Realtime

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!