是否有可能在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
最满意答案
您需要将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 ...
-
Amazon Route53重定向(Amazon Route53 redirection)[2022-08-18]
您当前的证书不适用于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 ... -
AWS Route53将wordpress子目录路由到不同的EC2实例(AWS Route53 routing wordpress subdirectories to different EC2 instances)[2023-04-26]
假设您使用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 ...