首页 \ 问答 \ 是否有可能在Modelica中有条件地设置方程属性?(Is it possible to conditionally set equation attributes in Modelica?)

是否有可能在Modelica中有条件地设置方程属性?(Is it possible to conditionally set equation attributes in Modelica?)

我正在研究一个包含多个子系统的大型模型,以及相当多的变量/方程式。 我一直在子系统上使用protected属性,因此在模拟结果中只能看到系统级结果。 这样可以更轻松地在Dymola仿真选项卡或FMU输入/输出中查找系统级结果。 但有些情况下,能够查看子系统的完整详细程度也是很好的。

是否可以基于布尔参数或其他方式有条件地应用受保护的属性?

例如,是否可以执行下面的伪代码?

// Parameter that sets whether or not to use the protected attribute on subsystems.
parameter Boolean useProtected = true;

// Conditionally define the subsystem with or without protected attribute
if (useProtected) then
  protected subsystem subsystem1 = ...
else
  subsystem subsystem1 = ...
end if;

谢谢,贾斯汀


I am working on a large model that includes multiple subsystems, and a fairly large number of variables/equations. I have been using the protected attribute on subystems so that only the system level results are visible in the simulation results. This makes it easier to find system level results in the Dymola simulation tab or in FMU inputs/outputs. But there are cases where it would be nice to be able to see the full level of detail for the subsystems also.

Is it possible to conditionally apply the protected attribute based upon a Boolean parameter, or some other way?

For instance, is it possible to do something like the pseudocode below?

// Parameter that sets whether or not to use the protected attribute on subsystems.
parameter Boolean useProtected = true;

// Conditionally define the subsystem with or without protected attribute
if (useProtected) then
  protected subsystem subsystem1 = ...
else
  subsystem subsystem1 = ...
end if;

Thanks, Justin


原文:https://stackoverflow.com/questions/38710473
更新时间:2023-03-06 16:03

最满意答案

您需要将Elastic IP分配给您的实例,并使用该IP配置DNS A记录。 弹性IP是静态IP的EC2等效物。 我认为只要不留下弹性IP未分配,就不会有任何额外成本。

拥有Elastic IP之后,您可以使用域名注册商(我使用GoDaddy)的DNS工具将域绑定到您的IP。 你不需要Route53来做到这一点,但是如果你愿意,你可以配置Route53来替换你的注册服务器的DNS服务器。 对于只有一台或两台服务器的简单设置,使用Route53并没有太多好处。


You need to assign an Elastic IP to your instance and use that IP to configure the DNS A-record. An Elastic IP is the EC2 equivalent of a static IP. I don't think there is any additional cost to it as long as you don't leave an Elastic IP unassigned.

Once you have your Elastic IP, you can use the DNS tool of your domain registrar (I use GoDaddy) to bind the domain to your IP. You don't need Route53 to do that, but you can configure Route53 to replace your registrar's DNS servers if you prefer. For a simple setup with only one or two servers, I don't see much benefit in using Route53.

相关问答

更多
  • 创建Elastic Load Balancing(ELB)并将实例添加到它。将实例添加到ELB后,您不再需要弹性IP地址(静态IP地址)。 不需要创建任何向上/向下扩展组(您可以手动添加自己/也可以根据需要创建一个)。每次重新启动实例并获取新IP地址时,您的负载均衡器将自动对您的EC2执行运行状况检查实例,仅将流量路由到通过运行状况检查的实例。 最后,将您的DNS更改为您的ELB。 欲了解更多信息,请阅读https://docs.aws.amazon.com/elasticloadbalancing/lat ...
  • 当您创建托管区域时 - 默认情况下会创建SOA记录和NS记录; 不要编辑它们。 现在,您必须先为您的域“invatxxx.com”添加A记录,然后再为其他主机名添加更多的A记录。 请参阅下面的屏幕截图,并注意您必须将“姓名”字段留空 (您会发现它自动以不可编辑的文本invatxxx.com结束): 此时,您的网站应可访问http://invatxxx.com/ 。 如果您希望在http://www.invatxxx.com/上也可以访问您的网站,请添加一条CNAME记录以使“www.invatxxx.com ...
  • 您需要将Elastic IP分配给您的实例,并使用该IP配置DNS A记录。 弹性IP是静态IP的EC2等效物。 我认为只要不留下弹性IP未分配,就不会有任何额外成本。 拥有Elastic IP之后,您可以使用域名注册商(我使用GoDaddy)的DNS工具将域绑定到您的IP。 你不需要Route53来做到这一点,但是如果你愿意,你可以配置Route53来替换你的注册服务器的DNS服务器。 对于只有一台或两台服务器的简单设置,使用Route53并没有太多好处。 You need to assign an El ...
  • 看起来你在这里有一个问题并不完全是技术问题。 $ whois ljagger.com ... Domain Status: clientHold https://icann.org/epp#clientHold 这在域上看起来有点不寻常。 此状态代码告知您的域的注册表不会在DNS中激活您的域,因此无法解析。 这种情况不常见,通常在法律纠纷,不付款或您的域名被删除时颁布。 https://www.icann.org/resources/pages/epp-status-codes-2014-06-16-en ...
  • 您当前的证书不适用于root用户 ,即https://test.com 要么为https://test.com购买备用名称,要么仅使用www.test.com作为您的网站。 到目前为止,您无需在Route53中更改任何内容。 您可能需要在Web服务器/应用程序中添加重定向以仅使用HTTPS,除非您想将其留给用户。 Your current certificate should not work for the root, i.e. https://test.com Either purchase an al ...
  • 假设您使用apache为您的站点提供服务,您可以在托管www.example.com的实例上添加.htaccess规则,以将www.example.com/uk流量重定向到另一个ip地址。 这意味着您依靠www.example.com重定向www.example.com/uk流量。 如果运行www.example.com的实例无法使用,则www.example.com/uk将无法访问。 或者,您可以使用以下条目在Route53设置subdomain uk.example.com 1.2.3.4 这意味着需要 ...
  • 起初,两者都应该是一个记录集。 A site.com EC2 Elastic IP A www.site.com EC2 Elastic IP 如下所示,需要在您的Web服务器(nginx,apache,..)中重定向设置。 (来源: 如何在CentOS 7上使用Nginx将www重定向到非www ) 将非www重定向到www 如果您想将用户从普通的非www域重定向到www域,请添加以下服务器块: server { server_name example.com; return 301 $sche ...
  • 如果您检查域名的WhoIs数据,您会注意到这条奇怪的行: Domain Status: clientHold https://icann.org/epp#clientHold 关注该ICANN网址,您将看到此状态的说明: 客户端状态代码由您的域名注册商设置: clientHold:此状态代码告诉您的域注册表不在DNS中激活您的域,因此无法解析。 这种情况不常见,通常在法律纠纷,不付款或您的域名被删除时颁布。 以及建议的解决方法: 通常,此状态表示您的域需要解决的问题。 如果是这样,您应该联系您的注册商以解 ...
  • 记录解决方案作为答案。 听起来你把一切都搞定了,除了将托管区域名称服务器连接到域名。 这是通过NS Records完成的。 创建新的托管区域时,它会自动为您分配名称服务器。 要将两者链接在一起,您需要在“已注册的域”区域下输入NS记录。 1.首先从托管区域获取NS记录 2.将这些记录复制到“Registered Domains”下的相应域中。 注意:NS Record TTL(生存时间)可能高达72小时(很少),因此可能需要花费大量时间才能将更改反映在dig (或浏览器)等查找工具中。 Documentin ...
  • AFAIK您无法在区域顶点创建A记录,只能创建特定于AWS的别名类型。 Alias可以引用ELB,S3网站,CloudFront分配或其他Route 53记录集。 你有几个选择: a)将您的实例放在ELB后面,并将example.com创建为指向ELB的Alias记录。 要么, b)创建example.com作为指向www.example.com CNAME的别名。 AFAIK you can not create an A record at the zone apex, only an AWS-spec ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)