<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: The Answer for Large Scale Modeling: Model Reference</title>
	<atom:link href="http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/</link>
	<description>This blog is about Simulink.</description>
	<lastBuildDate>Tue, 14 Feb 2012 17:41:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Guy Rouleau</title>
		<link>http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/#comment-1550</link>
		<dc:creator>Guy Rouleau</dc:creator>
		<pubDate>Mon, 22 Aug 2011 16:59:11 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/#comment-1550</guid>
		<description>@SteveH - This is a good question. We have a function called Simulink.SubSystem.convertToModelReference to convert an atomic subsystem into a referenced model, which is the opposite of what you are looking for.

In your case, I recommend using Simulink.BlockDiagram.copyContentsToSubSystem to copy the content of your referenced model into a new subsystem.

http://www.mathworks.com/help/releases/R2011a/toolbox/simulink/slref/simulink.blockdiagram.copycontentstosubsystem.html

You can then replace the Model Reference block by this subsystem using replace_block

http://www.mathworks.com/help/releases/R2011a/toolbox/simulink/slref/replace_block.html</description>
		<content:encoded><![CDATA[<p>@SteveH &#8211; This is a good question. We have a function called Simulink.SubSystem.convertToModelReference to convert an atomic subsystem into a referenced model, which is the opposite of what you are looking for.</p>
<p>In your case, I recommend using Simulink.BlockDiagram.copyContentsToSubSystem to copy the content of your referenced model into a new subsystem.</p>
<p><a href="http://www.mathworks.com/help/releases/R2011a/toolbox/simulink/slref/simulink.blockdiagram.copycontentstosubsystem.html" rel="nofollow">http://www.mathworks.com/help/releases/R2011a/toolbox/simulink/slref/simulink.blockdiagram.copycontentstosubsystem.html</a></p>
<p>You can then replace the Model Reference block by this subsystem using replace_block</p>
<p><a href="http://www.mathworks.com/help/releases/R2011a/toolbox/simulink/slref/replace_block.html" rel="nofollow">http://www.mathworks.com/help/releases/R2011a/toolbox/simulink/slref/replace_block.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SteveH</title>
		<link>http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/#comment-1549</link>
		<dc:creator>SteveH</dc:creator>
		<pubDate>Mon, 22 Aug 2011 15:19:19 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/#comment-1549</guid>
		<description>Is there a script available that allows one to convert a model reference subsystem into a virtual subsystem?</description>
		<content:encoded><![CDATA[<p>Is there a script available that allows one to convert a model reference subsystem into a virtual subsystem?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J.r</title>
		<link>http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/#comment-884</link>
		<dc:creator>J.r</dc:creator>
		<pubDate>Sat, 31 Oct 2009 03:55:19 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/#comment-884</guid>
		<description>@ Guy - Example sent to your account.  Thank you.</description>
		<content:encoded><![CDATA[<p>@ Guy &#8211; Example sent to your account.  Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guy</title>
		<link>http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/#comment-883</link>
		<dc:creator>Guy</dc:creator>
		<pubDate>Sat, 31 Oct 2009 00:15:51 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/#comment-883</guid>
		<description>@ J.r - The ability for atomic subsystems and Model Reference to remove the &quot;fake algebraic loop&quot; due to their atomic property depends on where inside the atomic unit the non-directfeedthrough block is.

If you send me a simplified example that demonstrates what you describe, I would be interested to give it a look and try to explain or find a workaround for this behavior.</description>
		<content:encoded><![CDATA[<p>@ J.r &#8211; The ability for atomic subsystems and Model Reference to remove the &#8220;fake algebraic loop&#8221; due to their atomic property depends on where inside the atomic unit the non-directfeedthrough block is.</p>
<p>If you send me a simplified example that demonstrates what you describe, I would be interested to give it a look and try to explain or find a workaround for this behavior.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J.r</title>
		<link>http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/#comment-882</link>
		<dc:creator>J.r</dc:creator>
		<pubDate>Fri, 30 Oct 2009 16:13:05 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/#comment-882</guid>
		<description>Sorry to hit an old thread, but this seems like the best place to solicit help on this topic.

Is there supposed to be subtle differences between &#039;Minimize algebraic loop occurrences&#039; for atomic systems and model references.  I have created a simple model which exhibits different behavior between the two (in both 2007b and 2009b).  I am ultimately trying to determine if I can help Simulink resolve the generic algebraic loop case with model references for those systems which don&#039;t actually have loops.  This is for users who have little experience with the subtleties of model references.

My model is a simple loop of subsystems of a control system.  The plant has no direct pass-through paths.  Here are the two behaviors:

Atomic subsystems: Highlights the loop at update diagram time and does not allow simulation since update diagram fails.  Setting &#039;MALO&#039; on the block which is not direct pass-through caused the block order to change to make this block first and the algebraic loop is no longer detected.  Viola.  Changing the block order through &#039;Priority&#039; also succeeds in clearing up the false loop detection.

Model references: Throws warnings about the false algebraic loop, but allows update diagram to complete.  Simulation is possible, but the algebraic loop algorithm is occurring at each time step, slowing the simulation and causing additional IC headaches.  Setting &#039;MALO&#039; in the model which is not direct pass-through does nothing except throw additional &#039;Unable to remove algebraic loops&#039; warnings.  Block order remains unchanged and &#039;Priority&#039; is also unable to change Simulink&#039;s mind.

I can send you my example if you are interested.</description>
		<content:encoded><![CDATA[<p>Sorry to hit an old thread, but this seems like the best place to solicit help on this topic.</p>
<p>Is there supposed to be subtle differences between &#8216;Minimize algebraic loop occurrences&#8217; for atomic systems and model references.  I have created a simple model which exhibits different behavior between the two (in both 2007b and 2009b).  I am ultimately trying to determine if I can help Simulink resolve the generic algebraic loop case with model references for those systems which don&#8217;t actually have loops.  This is for users who have little experience with the subtleties of model references.</p>
<p>My model is a simple loop of subsystems of a control system.  The plant has no direct pass-through paths.  Here are the two behaviors:</p>
<p>Atomic subsystems: Highlights the loop at update diagram time and does not allow simulation since update diagram fails.  Setting &#8216;MALO&#8217; on the block which is not direct pass-through caused the block order to change to make this block first and the algebraic loop is no longer detected.  Viola.  Changing the block order through &#8216;Priority&#8217; also succeeds in clearing up the false loop detection.</p>
<p>Model references: Throws warnings about the false algebraic loop, but allows update diagram to complete.  Simulation is possible, but the algebraic loop algorithm is occurring at each time step, slowing the simulation and causing additional IC headaches.  Setting &#8216;MALO&#8217; in the model which is not direct pass-through does nothing except throw additional &#8216;Unable to remove algebraic loops&#8217; warnings.  Block order remains unchanged and &#8216;Priority&#8217; is also unable to change Simulink&#8217;s mind.</p>
<p>I can send you my example if you are interested.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: S.S. KIRAN</title>
		<link>http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/#comment-669</link>
		<dc:creator>S.S. KIRAN</dc:creator>
		<pubDate>Tue, 27 Jan 2009 09:15:09 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/#comment-669</guid>
		<description>May i know the how model referencing is different from library linking.
Advantages of model referencing compared to library linking.</description>
		<content:encoded><![CDATA[<p>May i know the how model referencing is different from library linking.<br />
Advantages of model referencing compared to library linking.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin L.</title>
		<link>http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/#comment-659</link>
		<dc:creator>Kevin L.</dc:creator>
		<pubDate>Tue, 13 Jan 2009 16:11:55 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/#comment-659</guid>
		<description>Seth,

I just mean that unpacking goes slowly with log.unpack(&#039;all&#039;) when signals logged out are in deep models. e.g., 6 or more layer. If sinals logged out are in shallow models, e.g. 2 layer or 1 layer, unpacking may be fast. 
I wonder if you understand exactly my question. 

Thanks</description>
		<content:encoded><![CDATA[<p>Seth,</p>
<p>I just mean that unpacking goes slowly with log.unpack(&#8216;all&#8217;) when signals logged out are in deep models. e.g., 6 or more layer. If sinals logged out are in shallow models, e.g. 2 layer or 1 layer, unpacking may be fast.<br />
I wonder if you understand exactly my question. </p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Seth</title>
		<link>http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/#comment-658</link>
		<dc:creator>Seth</dc:creator>
		<pubDate>Mon, 12 Jan 2009 14:23:04 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/#comment-658</guid>
		<description>@Kevin L. - Do you mean they are slow because you have to type the full path to the logging variable, or do you mean that performance of unpacking goes slowly?  Have you tried &lt;a href=&quot;http://www.mathworks.com/access/helpdesk/help/toolbox/simulink/slref/unpack.html&quot; rel=&quot;nofollow&quot;&gt;log.unpack(&#039;all&#039;)&lt;/a&gt;?</description>
		<content:encoded><![CDATA[<p>@Kevin L. &#8211; Do you mean they are slow because you have to type the full path to the logging variable, or do you mean that performance of unpacking goes slowly?  Have you tried <a href="http://www.mathworks.com/access/helpdesk/help/toolbox/simulink/slref/unpack.html" rel="nofollow">log.unpack(&#8216;all&#8217;)</a>?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin L.</title>
		<link>http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/#comment-643</link>
		<dc:creator>Kevin L.</dc:creator>
		<pubDate>Tue, 30 Dec 2008 05:38:55 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/#comment-643</guid>
		<description>Mike,

Thanks for the reply.
I have try log out signals in referenced models. Signals can be logged out, but the unpacking is so slow when the signals logged out are in deep models. e.g., 6 or more layer. 
Can you give me some suggestions on making unpacking faster.

Thanks and happy new year:)</description>
		<content:encoded><![CDATA[<p>Mike,</p>
<p>Thanks for the reply.<br />
I have try log out signals in referenced models. Signals can be logged out, but the unpacking is so slow when the signals logged out are in deep models. e.g., 6 or more layer.<br />
Can you give me some suggestions on making unpacking faster.</p>
<p>Thanks and happy new year:)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Tocci</title>
		<link>http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/#comment-639</link>
		<dc:creator>Mike Tocci</dc:creator>
		<pubDate>Tue, 16 Dec 2008 03:07:16 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2008/12/05/the-answer-for-large-scale-modeling-model-reference/#comment-639</guid>
		<description>Hi, my name&#039;s Mike Tocci and I&#039;m a developer at The MathWorks working on Model Reference.  Here&#039;s a few answers to some of the questions asked so far:

@Paul - there haven&#039;t been any changes to model arguments as of R2008b, but we are currently working on allowing structures to be passed as model arguments.  

@Kevin L - One thing you can do to make changing the SimulationMode easier is to script it.  set_param accepts a cell array of blocks, and find_mdlrefs and find_system will return a cell array of blocks.  For example, to change the SimulationMode of all the Model blocks contained in a model and all of its referenced models, you could use something like,

&gt;&gt; [refMdls, mdlBlks] = find_mdlrefs(model);
&gt;&gt; set_param(mdlBlks, &#039;SimulationMode&#039;,&#039;Normal&#039;);

One caveat is that find_mdlrefs doesn&#039;t load all the referenced models, so you may have to load those models before doing a set_param. 

@Kevin L - signals can be logged in referenced models by right-clicking on the Model block and selecting &quot;Log Referenced Signals&quot;.  Let me know if you need any more information on this feature.

@Kevin L - we currently don&#039;t support the Simulink debugger in referenced models, but this is a feature we&#039;re working on for a future release.

Thanks for the comments and questions so far, please keep them coming.</description>
		<content:encoded><![CDATA[<p>Hi, my name&#8217;s Mike Tocci and I&#8217;m a developer at The MathWorks working on Model Reference.  Here&#8217;s a few answers to some of the questions asked so far:</p>
<p>@Paul &#8211; there haven&#8217;t been any changes to model arguments as of R2008b, but we are currently working on allowing structures to be passed as model arguments.  </p>
<p>@Kevin L &#8211; One thing you can do to make changing the SimulationMode easier is to script it.  set_param accepts a cell array of blocks, and find_mdlrefs and find_system will return a cell array of blocks.  For example, to change the SimulationMode of all the Model blocks contained in a model and all of its referenced models, you could use something like,</p>
<p>&gt;&gt; [refMdls, mdlBlks] = find_mdlrefs(model);<br />
&gt;&gt; set_param(mdlBlks, &#8216;SimulationMode&#8217;,'Normal&#8217;);</p>
<p>One caveat is that find_mdlrefs doesn&#8217;t load all the referenced models, so you may have to load those models before doing a set_param. </p>
<p>@Kevin L &#8211; signals can be logged in referenced models by right-clicking on the Model block and selecting &#8220;Log Referenced Signals&#8221;.  Let me know if you need any more information on this feature.</p>
<p>@Kevin L &#8211; we currently don&#8217;t support the Simulink debugger in referenced models, but this is a feature we&#8217;re working on for a future release.</p>
<p>Thanks for the comments and questions so far, please keep them coming.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

