<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Guy on Simulink</title>
	<atom:link href="https://blogs.mathworks.com/simulink/feed/" rel="self" type="application/rss+xml" />
	<link>https://blogs.mathworks.com/simulink</link>
	<description>Guy Rouleau is an Application Engineer for MathWorks. He writes here about Simulink and other MathWorks tools used in Model-Based Design.</description>
	<lastBuildDate>Tue, 17 Nov 2026 22:09:54 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>
	<item>
		<title>Debugging Simulation Results with an AI Coding Agent</title>
		<link>https://blogs.mathworks.com/simulink/2026/11/17/debugging-simulation-results-with-an-ai-coding-agent/?s_tid=feedtopost</link>
					<comments>https://blogs.mathworks.com/simulink/2026/11/17/debugging-simulation-results-with-an-ai-coding-agent/#respond</comments>
		
		<dc:creator><![CDATA[Guy Rouleau]]></dc:creator>
		<pubDate>Tue, 17 Nov 2026 22:09:54 +0000</pubDate>
				<category><![CDATA[AI Coding Assistant]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Simulink Tips]]></category>
		<category><![CDATA[Agentic AI]]></category>
		<category><![CDATA[AI coding Agent]]></category>
		<category><![CDATA[parameter tuning]]></category>
		<category><![CDATA[Rapid Accelerator]]></category>
		<guid isPermaLink="false">https://blogs.mathworks.com/simulink/?p=19014</guid>

					<description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/simulink/files/DebuggingSimResultsWithAI.m-11-17-26_7.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" fetchpriority="high" /></div><p>I have to admit, in my day-to-day work, I spend a lot more time debugging Simulink models that produce unexpected results than creating new ones. Since I have access to AI coding agents, I have had a... <a class="read-more" href="https://blogs.mathworks.com/simulink/2026/11/17/debugging-simulation-results-with-an-ai-coding-agent/">read more >></a></p>]]></description>
										<content:encoded><![CDATA[<div class = rtcContent><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><a href = "https://matlab.mathworks.com/open/github/v1?repo=simulink/blog&amp;file=2026_11_16_Debugging_with_AI\matlab.toml"><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/DebuggingSimResultsWithAI.m-11-17-26_1.png" width = "136" height = "21" alt = "" style = "vertical-align: baseline; width: 136px; height: 21px;"></img></a></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I have to admit, in my day-to-day work, I spend a lot more time debugging Simulink models that produce unexpected results than creating new ones. Since I have access to AI coding agents, I have had a lot of success speeding up debugging sessions and getting deeper insights than I could have dreamed of before.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Today I decided to share one example of this kind of debugging.</span></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">The problem</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">A colleague reached out saying they were trying to apply the technique I described in </span><a href = "https://blogs.mathworks.com/simulink/2023/10/05/getting-the-most-out-of-rapid-accelerator-mode-version-r2023b/"><span class="_richTextNode">Getting the most out of Rapid Accelerator mode</span></a><span class="_richTextNode">, but they were getting unexpected results. The model was made of more than 100,000 blocks from many different blocksets and used thousands of parameters. </span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">We offer many tools, diagnostics, and documentation pages to understand and debug this type of issue. Even with all those resources, running into an issue like this one can be intimidating.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">For this blog post, I reproduced the original problem in a smaller project, using a slightly modified version of the Simscape Driveline example </span><a href = "https://www.mathworks.com/help/sdl/ug/series-hybrid-transmission.html"><span class="_richTextNode">Series Hybrid Transmission</span></a><span class="_richTextNode">.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/DebuggingSimResultsWithAI.m-11-17-26_2.png" width = "551" height = "303" alt = "" style = "vertical-align: baseline; width: 551px; height: 303px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I stored most of the variables needed by the model in a data dictionary:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/DebuggingSimResultsWithAI.m-11-17-26_3.png" width = "554" height = "456" alt = "" style = "vertical-align: baseline; width: 554px; height: 456px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Then I created a second parameter set with different values for most variables.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/DebuggingSimResultsWithAI.m-11-17-26_4.png" width = "376" height = "330" alt = "" style = "vertical-align: baseline; width: 376px; height: 330px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I simulated the model with both parameter sets in Normal mode and in Rapid Accelerator mode. For the Rapid Accelerator runs, I set </span><span class="_richTextNode" style=' font-family: monospace;'>RapidAcceleratorUpToDateCheck</span><span class="_richTextNode"> to </span><span class="_richTextNode" style=' font-family: monospace;'>off</span><span class="_richTextNode"> for maximum performance.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >mdl = </span><span style="color: rgb(167, 9, 245);">'SeriesHybridTransmission'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >in = repmat(Simulink.SimulationInput(mdl),4,1);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >Simulink.BlockDiagram.buildRapidAcceleratorTarget(mdl);</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(230, 230, 230) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsTextElement" uid="04F64089" prevent-scroll="true" data-testid="output_0" style="width: 1178px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;" tabindex="-1"><div class="textElement eoOutputContent" tabindex="-1" data-previous-available-width="1141" data-previous-scroll-height="46" data-hashorizontaloverflow="false" role="article" aria-roledescription="Use Browse Mode to explore " aria-description="text output " style="max-height: 261px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">### Searching for referenced models in model 'SeriesHybridTransmission'.
### Total of 1 models to build.
### Starting top model simulation target build for: SeriesHybridTransmission</div></div></div></div><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >in(1) = in(1).setModelParameter(</span><span style="color: rgb(167, 9, 245);">'SimulationMode'</span><span >,</span><span style="color: rgb(167, 9, 245);">'Normal'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >in(2) = in(2).setModelParameter(</span><span style="color: rgb(167, 9, 245);">'SimulationMode'</span><span >,</span><span style="color: rgb(167, 9, 245);">'Normal'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >in(2) = in(2).loadVariablesFromMATFile(</span><span style="color: rgb(167, 9, 245);">'SeriesHybridTransmission_alternate_variables.mat'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >in(3) = in(3).setModelParameter(</span><span style="color: rgb(167, 9, 245);">'SimulationMode'</span><span >,</span><span style="color: rgb(167, 9, 245);">'Rapid'</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(167, 9, 245);">'RapidAcceleratorUpToDateCheck'</span><span >,</span><span style="color: rgb(167, 9, 245);">'off'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >in(4) = in(4).loadVariablesFromMATFile(</span><span style="color: rgb(167, 9, 245);">'SeriesHybridTransmission_alternate_variables.mat'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >in(4) = in(4).setModelParameter(</span><span style="color: rgb(167, 9, 245);">'SimulationMode'</span><span >,</span><span style="color: rgb(167, 9, 245);">'Rapid'</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(167, 9, 245);">'RapidAcceleratorUpToDateCheck'</span><span >,</span><span style="color: rgb(167, 9, 245);">'off'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >out = sim(in,</span><span style="color: rgb(167, 9, 245);">'ShowProgress'</span><span >,</span><span style="color: rgb(167, 9, 245);">'off'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >figure</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >hold </span><span style="color: rgb(167, 9, 245);">on</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >styles = {</span><span style="color: rgb(167, 9, 245);">'-'</span><span >,</span><span style="color: rgb(167, 9, 245);">'-'</span><span >,</span><span style="color: rgb(167, 9, 245);">'o'</span><span >,</span><span style="color: rgb(167, 9, 245);">'o'</span><span >};</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">for </span><span >i=1:4</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;plot(out(i).logsout.get(</span><span style="color: rgb(167, 9, 245);">'Velocity'</span><span >).Values,styles{i})</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >legend({</span><span style="color: rgb(167, 9, 245);">'Normal - Dataset 1'</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(167, 9, 245);">'Normal - Dataset 2'</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(167, 9, 245);">'Rapid Accelerator - Dataset 1'</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(167, 9, 245);">'Rapid Accelerator - Dataset 2'</span><span >},</span><span style="color: rgb(167, 9, 245);">"Location"</span><span >,</span><span style="color: rgb(167, 9, 245);">"northwest"</span><span >);</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(230, 230, 230) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsFigure" uid="B4C739C6" prevent-scroll="true" data-testid="output_1" style="width: 1178px;" tabindex="-1"><div class="outputLayer selectedOutputDecorationLayer doNotExport" aria-hidden="true"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport" aria-hidden="true"></div><div class="outputLayer navigationFocusLayer doNotExport" aria-hidden="false" role="application" tabindex="-1"></div><div class="outputLayer activeOutputDecorationLayer doNotExport" aria-hidden="false" role="application"></div><div class="figureElement eoOutputContent" role="article" aria-roledescription="Use Browse Mode to explore " aria-description="figure output "><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/simulink/files/DebuggingSimResultsWithAI.m-11-17-26_5.png" style="width: 560px;"></div></div></div></div></div><div  style = 'margin: 10px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Looking at the results, we can see that the Normal and Rapid Accelerator results match for parameter set 1. The run in Normal mode with parameter set 2 returns expected results, but the run in Rapid Accelerator mode with parameter set 2 gives unexpected results.</span></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Asking for help</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">A year ago, I would have started manually digging into that. This time, I executed </span><a href = "https://github.com/matlab/matlab-mcp-server/blob/main/matlab/matlab_mcp_toolbox/mcp/shareMATLABSession.m"><span class="_richTextNode">shareMATLABSession</span></a><span class="_richTextNode">, launched the AI agent from the same folder as the MATLAB project and asked:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold; font-style: italic; font-family: monospace;'>See repro.m. It shows unexpected results in Rapid Accelerator for case 4. Explain why and how to fix it. Don't change the model, let me review.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">To begin, the agent loaded relevant skills from the Simulink Agentic Toolkit:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/DebuggingSimResultsWithAI.m-11-17-26_6.png" width = "711" height = "139" alt = "" style = "vertical-align: baseline; width: 711px; height: 139px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The agent ran a few MATLAB commands using the </span><span class="_richTextNode" style=' font-family: monospace;'>evaluate_matlab_code</span><span class="_richTextNode"> tool, loaded the </span><span class="_richTextNode" style=' font-family: monospace;'>matlab-read-documentation</span><span class="_richTextNode"> skill to gather more info and quickly responded with:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/DebuggingSimResultsWithAI.m-11-17-26_7.png" width = "703" height = "265" alt = "" style = "vertical-align: baseline; width: 703px; height: 265px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">To address my request for possible ways to fix the problem, I got this answer:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/DebuggingSimResultsWithAI.m-11-17-26_8.png" width = "694" height = "253" alt = "" style = "vertical-align: baseline; width: 694px; height: 253px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I asked the agent to set the configurability of the vehicle mass parameter to Run-time, as suggested in option 2. I then confirmed that the simulation results matched the expected results.</span></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Learning opportunity</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">When I solve a problem using an AI agent, I like to ask how it diagnosed the issue and which tools I could have used to investigate it myself. So I asked:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold; font-style: italic; font-family: monospace;'>Summarize which tools and techniques I could have used to understand and debug that myself manually</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I also like to ask the agent to generate a Markdown or HTML report of its findings. Here is a screenshot from the HTML report I got:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/DebuggingSimResultsWithAI.m-11-17-26_9.png" width = "703" height = "418" alt = "" style = "vertical-align: baseline; width: 703px; height: 418px;"></img></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Creating a repeatable tool</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">While an AI agent can speed up an investigation like this one where I was not sure what to look for and the scope was large, it's not always the most efficient solution. Once a problematic pattern has been identified, it's usually faster to call a function that does the work efficiently in a repeatable manner. To create this function, I asked the AI agent:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold; font-style: italic; font-family: monospace;'>I would like to write a MATLAB function to detect this situation in the future. The function should take the simulationInput object as input and check the existing build_rtp.mat in slprj. The function should return a table with one entry per variable in the simulationInput identified as non-tunable. It should list the variable name, the default and new values, the blockpath of the block(s) where it's used and a reason. For now, include the Simscape configurability reason and keep a placeholder for other future reasons we might discover.</span><span class="_richTextNode"> </span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Within a few seconds, the function was created. Here is what it returns:</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper outputs"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >T = findNonTunableOverrides(in(4))</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(230, 230, 230) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsVariableTableElement" uid="87220630" prevent-scroll="true" data-testid="output_2" style="width: calc(100% - 5px);" tabindex="-1"><div class="outputLayer selectedOutputDecorationLayer doNotExport" aria-hidden="true"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport" aria-hidden="true"></div><div class="outputLayer navigationFocusLayer doNotExport" aria-hidden="false" role="application" tabindex="-1"></div><div class="outputLayer activeOutputDecorationLayer doNotExport" aria-hidden="false" role="application"></div><div class="ClientDocument veSpecifier table" id="variableeditor_client_Document_0" widgetid="variableeditor_client_Document_0" tabindex="0" aria-labelledby="variableeditor_views_SummaryBar_0"><div class="summaryBar" style="font-size: 12px; font-family: Consolas, Inconsolata, Menlo, monospace;"><span>T = </span><span style="color: rgb(179, 179, 179); font-style: normal;">2×7 table </span></div><div id="variableeditor_TableViewModel_0" widgetid="variableeditor_TableViewModel_0" class="table lightWeightView ClientViewDiv hasSummaryBar" data-viewid="__1" style="width: 100%; overflow: auto;"><table cellspacing="0" style="border-spacing: 0px; border-collapse: collapse;"><thead><tr><th rowspan="1" style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 34px; border: 1px solid rgb(191, 191, 191); text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span> </span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>VariableName</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Workspace</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>DefaultValue</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>NewValue</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>ValueChanged</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>BlockPaths</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Reason</span></th></tr></thead><tbody><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>1</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"VehicleMass"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"global-workspace"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1200</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1500</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: center;"><span>true</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"SeriesHybridTransmission/Vehicle Body/Vehicle Body"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"Non-tunable in build_rtp.mat. Simscape compile-time configurability: SeriesHybridTransmission/Vehicle Body/Vehicle Body [mass = VehicleMass; mass_conf = compiletime]"</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>2</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"MotorTimeConstant"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"global-workspace"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>0.2000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>0.3000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: center;"><span>true</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"SeriesHybridTransmission/Motor/Motor &amp; Drive"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"Non-tunable in build_rtp.mat. Simscape compile-time configurability: SeriesHybridTransmission/Motor/Motor &amp; Drive [Tc = MotorTimeConstant; Tc_conf = compiletime]"</span></td></tr></tbody></table></div></div></div></div></div></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Conclusion</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Simscape parameters need to have their configurability set to Run-time to be tuned in Rapid Accelerator mode and not trigger a rebuild. We have a full </span><a href = "https://www.mathworks.com/help/simscape/run-time-parameters.html"><span class="_richTextNode">documentation section on that topic</span></a><span class="_richTextNode">.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/DebuggingSimResultsWithAI.m-11-17-26_10.png" width = "561" height = "287" alt = "" style = "vertical-align: baseline; width: 561px; height: 287px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The agent was especially useful because the problematic parameter was buried among thousands of others. Investigating manually could have taken considerable time: inspecting parameters, comparing them with simulation results, writing inspection code, and stepping through code in the debugger.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">While digging further, I confirmed that the </span><span class="_richTextNode" style=' font-family: monospace;'>sim</span><span class="_richTextNode"> command issues a warning for this behavior. In the original project, however, it was easy to miss.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/DebuggingSimResultsWithAI.m-11-17-26_11.png" width = "590" height = "187" alt = "" style = "vertical-align: baseline; width: 590px; height: 187px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Once the agent helped me understand the problem, I asked it to create a simple function to detect similar issues before trying to simulate the model.</span></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Now it's your turn</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">What kinds of problems are you debugging with the help of AI agents? Let us know in the comments below.</span></div>
<br>
</div><script type="text/javascript">
{ let css = '._richTextNode {white-space: break-spaces;} /* Copyright 2014-2025 The MathWorks, Inc. *//* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsErrorElement {    min-height: 18px;    max-height: 550px;} .embeddedOutputsErrorElement .diagnosticMessage-errorType {    overflow: auto;} .embeddedOutputsErrorElement.inlineElement {} .embeddedOutputsErrorElement.rightPaneElement {} /* Copyright 2014-2025 The MathWorks, Inc. *//* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsWarningElement {    min-height: 18px;    max-height: 550px;} .embeddedOutputsWarningElement .diagnosticMessage-warningType {    overflow: auto;} .embeddedOutputsWarningElement.inlineElement {} .embeddedOutputsWarningElement.rightPaneElement {} /* Copyright 2015-2025 The MathWorks, Inc. *//* In this file, styles are not scoped to rtcContainer since they could be in the Dojo Tooltip */.diagnosticMessage-wrapper {    /* Since this selector may be used outside RTC Container without RTC semantic variables, a    default value is used. An example here is the App Designers alert tooltip. */    font-family: var(--rtc-output-font-family, Menlo, Monaco, Consolas, "Courier New", monospace);    font-size: var(--rtc-output-font-size, 12px);} .diagnosticMessage-wrapper.diagnosticMessage-warningType {    /*This fallback value will be used for appdesigner warnings*/    color: var(--rtc-warning-output-color, var(--mw-color-matlabWarning));} .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    /*This fallback value will be used for appdesigner warnings*/    color: var(--rtc-warning-output-color, var(--mw-color-matlabWarning));    text-decoration: underline;} .rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-warningType,.rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: var(--mw-color-matlabWarning) !important;} .diagnosticMessage-wrapper.diagnosticMessage-errorType {    /*This fallback value will be used in appdesigner error tooltip text*/    color: var(--rtc-error-output-color, var(--mw-color-matlabErrors));} .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    /*This fallback value will be used in appdesigner error tooltip text*/    color: var(--rtc-error-output-color, var(--mw-color-matlabErrors));    text-decoration: underline;} .rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-errorType,.rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: var(--mw-color-matlabErrors) !important;} .diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {    white-space: pre-wrap;} .diagnosticMessage-wrapper .diagnosticMessage-stackPart {    white-space: pre;} /* Copyright 2014-2025 The MathWorks, Inc. */.embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {    white-space: pre;    word-wrap:  initial;    min-height: 18px;    max-height: 550px;} .embeddedOutputsTextElement .textElement,.embeddedOutputsVariableStringElement .textElement {    overflow: auto;} .textElement,.rtcDataTipElement .textElement {    padding-top: 2px;} .embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {} .inlineElement .textElement {} .embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .textElement {    padding-top: 2px;    padding-left: 9px;} .embeddedOutputsVariableStringElement { width: initial !important; } /* Copyright 2017-2025 The MathWorks, Inc. */.embeddedOutputsVariableTableElement .ClientViewDiv  table tr {  height: 22px;  white-space: nowrap;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr td,.embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {  background-color:white;  text-overflow: ellipsis;  font-family: Arial, sans-serif;  overflow : hidden;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr span {  text-overflow: ellipsis;  padding: 3px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {    color: rgba(0,0,0,0.5);  padding: 3px;  font-size: 9px;} /* ClientDocument has a summary bar child that takes up 17px, this clashes with overflow on the view which allots space for scrollbars. On print preview, this causes headers from <thead> to overlap on subsequent pages. Displaying Document as flex renders summarybar and view in column format and fixes the issue g2788485 */.embeddedOutputsVariableTableElement .ClientDocument {  display: flex;  flex-direction: column;}';
let head = document.head || document.getElementsByTagName('head')[0];
let style = document.createElement('style');
head.appendChild(style);
style.type = 'text/css';
if (style.styleSheet) {
    style.styleSheet.cssText = css;
} else {
    style.appendChild(document.createTextNode(css));
}


}</script>]]></content:encoded>
					
					<wfw:commentRss>https://blogs.mathworks.com/simulink/2026/11/17/debugging-simulation-results-with-an-ai-coding-agent/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Behavioral Models with Agentic-AI-powered MBSE</title>
		<link>https://blogs.mathworks.com/simulink/2026/10/30/behavioral-models-with-agentic-ai-powered-mbse/?s_tid=feedtopost</link>
					<comments>https://blogs.mathworks.com/simulink/2026/10/30/behavioral-models-with-agentic-ai-powered-mbse/#respond</comments>
		
		<dc:creator><![CDATA[Guy Rouleau]]></dc:creator>
		<pubDate>Fri, 30 Oct 2026 22:52:15 +0000</pubDate>
				<category><![CDATA[AI Coding Assistant]]></category>
		<category><![CDATA[Guest Blogger]]></category>
		<category><![CDATA[Model-Based Systems Engineering]]></category>
		<category><![CDATA[Agentic AI]]></category>
		<category><![CDATA[MBSE]]></category>
		<guid isPermaLink="false">https://blogs.mathworks.com/simulink/?p=18913</guid>

					<description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/simulink/files/MBSE_Behavioral_Models.m-11-02-26_13.jpg" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" /></div><p> Today I am happy to welcome back Sarah Dagen from MathWorks Consulting Services for another visit to the Galactic Soup Factory!.When we left off using agentic AI and MBSE to design an intergalactic... <a class="read-more" href="https://blogs.mathworks.com/simulink/2026/10/30/behavioral-models-with-agentic-ai-powered-mbse/">read more >></a></p>]]></description>
										<content:encoded><![CDATA[<div class = rtcContent><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> </span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><a href = "https://matlab.mathworks.com/open/github/v1?repo=simulink/blog&amp;project=2026_04_27_MBSE_GenAI/MBSE_and_GenAI.prj"><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Behavioral_Models.m-11-02-26_1.png" width = "136" height = "21" alt = "" style = "vertical-align: baseline; width: 136px; height: 21px;"></img></a></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-style: italic;'>Today I am happy to welcome back</span><span class="_richTextNode"> </span><a href = "https://www.linkedin.com/in/sarah-dagen/"><span class="_richTextNode">Sarah Dagen</span></a><span class="_richTextNode"> </span><span class="_richTextNode" style=' font-style: italic;'>from</span><span class="_richTextNode"> </span><a href = "https://www.mathworks.com/services/consulting.html"><span class="_richTextNode">MathWorks Consulting Services</span></a><span class="_richTextNode"> </span><span class="_richTextNode" style=' font-style: italic;'>for another visit to the Galactic Soup Factory!</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-style: italic;'>.</span><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Behavioral_Models.m-11-02-26_2.png" width = "134" height = "188" alt = "" style = "vertical-align: baseline; width: 134px; height: 188px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">When we left off using agentic AI and MBSE to design an intergalactic soup factory, we were evaluating 3 physical design variants. I am continuing the trade study in this article, but this time it is based on dynamic simulations rather than static analysis. </span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Behavioral_Models.m-11-02-26_3.png" width = "209" height = "315" alt = "" style = "vertical-align: baseline; width: 209px; height: 315px;"></img></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">A reminder of what happened so far </span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I started by using a coding agent along with the </span><a href = "https://github.com/matlab/simulink-agentic-toolkit"><span class="_richTextNode">Simulink Agentic Toolkit</span></a><span class="_richTextNode"> and </span><a href = "https://www.mathworks.com/products/system-composer.html"><span class="_richTextNode">System Composer</span></a><span class="_richTextNode"> to </span><a href = "https://blogs.mathworks.com/simulink/2026/04/26/model-based-systems-engineering-and-agentic-ai/"><span class="_richTextNode">import and analyze system requirements and develop functional, logical, and physical architectures</span></a><span class="_richTextNode">. </span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Then, I had the agent propose three different physical architecture variants that could meet the requirements, and developed </span><a href = "https://blogs.mathworks.com/simulink/2026/08/12/trade-studies-with-agentic-ai-powered-mbse/"><span class="_richTextNode">architectural analysis and a trade study</span></a><span class="_richTextNode"> to evaluate the variants against each other. </span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">These are our three architecture candidates: </span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>HyperCook</span><span class="_richTextNode"> prioritizes throughput with four parallel continuous cook lines.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><a href = "https://github.com/sdagen/symmetrical-fiesta/blob/main/blog/images/variant_schematic_hypercook.png"><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Behavioral_Models.m-11-02-26_4.png" width = "624" height = "169" alt = "" style = "vertical-align: baseline; width: 624px; height: 169px;"></img></a></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>LeanBroth</span><span class="_richTextNode"> prioritizes budget margin with two batch kettles and one prep station.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><a href = "https://github.com/sdagen/symmetrical-fiesta/blob/main/blog/images/variant_schematic_leanbroth.png"><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Behavioral_Models.m-11-02-26_5.png" width = "624" height = "154" alt = "" style = "vertical-align: baseline; width: 624px; height: 154px;"></img></a></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>EverSimmer</span><span class="_richTextNode"> prioritizes robustness: three fully independent production cells, each a complete prep-cook-quality control-pack chain. You can still produce soup even if one or two entire cells fail.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> </span><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Behavioral_Models.m-11-02-26_6.png" width = "624" height = "187" alt = "" style = "vertical-align: baseline; width: 624px; height: 187px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Using architectural analysis and trade study techniques, EverSimmer emerged a strong choice. It had the highest score in the majority of weighting scenarios. </span></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Let’s add behaviors!</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">All of the analysis up to this point was based on static calculations and spec-sheet type data. To get a deeper understanding of how these different factories would actually work, I used the agent to help build some behavioral models. These are models that have executable semantics, like our static architectures, but also time-dependent equations. </span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">When I originally designed these variants, I aimed to reuse as many architectural sub-components as possible. There are differences in peripheral details, but fundamentally they are all doing the same thing with different combinations of the same components – things like preparing ingredients, cooking, quality control and packaging. So when it came to modeling the behaviors, I asked the agent to create parameterized reference models that could be reused in all the architectures. </span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">To start to get a feeling of how those factories operate, I worked with the agent and made the following component models: </span></div><table  style = 'margin: 3px 3px 3px 25px; border: 1px solid rgb(191, 191, 191); border-collapse: collapse; '><col/><col/><tr  style = 'background-color: rgb(245, 245, 245); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Component model</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>What it models</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Storage</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Storage buffer, starvation, and overflow</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Prep Unit</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Preparation with rate limits and startup lag</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Cook Line</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Continuous cooking and power consumption</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Cooking Vat</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Batch cooking and thermal dynamics</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Quality Control Station</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Inspection, contamination detection, and calibration</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Packager</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Rate-limited packaging with backlog</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Production Supervisor</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Production modes and failed-line control</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Production Cell</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Integrated preparation through packaging</span></div></td></tr></table><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> </span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I didn’t give the agent much direction on </span><span class="_richTextNode" style=' font-style: italic;'>how</span><span class="_richTextNode"> to model anything. It made some technical decisions that I might not have made myself, but it generally got the job done and was good enough to bring insights. I told the agent to use the whole spectrum of modeling tools at its disposal. For example, for the cooking vat, the agent decided on its own to use Stateflow to implement the control mode logic and Simscape for the physical systems. </span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Behavioral_Models.m-11-02-26_7.png" width = "625" height = "293" alt = "" style = "vertical-align: baseline; width: 625px; height: 293px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Behavioral_Models.m-11-02-26_8.png" width = "625" height = "266" alt = "" style = "vertical-align: baseline; width: 625px; height: 266px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">These are good choices, but for a real project I would have spent more time planning with the agent before letting it build to make sure those decisions were my own. </span></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">The architecture is the model</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">One of the most powerful features of System Composer is its simulation capabilities, which is very different from many other MBSE tools.  You can add Simulink models and behaviors directly in System Composer architecture models! </span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Here’s an animation showing how you can navigate directly from a system-level architecture down into behavioral models – a state chart in Stateflow, in this case: </span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Behavioral_Models.m-11-02-26_9.gif" width = "568" height = "515" alt = "" style = "vertical-align: baseline; width: 568px; height: 515px;"></img></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Simulating the dynamics</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Once I had my architectures elaborated with behaviors, I needed to build simulation scenarios and test cases to observe the system dynamics. </span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Working with the agent, I created several suites of tests to simulate different operational scenarios. The scenarios are based on the system requirements, and include traceability to the requirements.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> </span><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Behavioral_Models.m-11-02-26_10.png" width = "483" height = "381" alt = "" style = "vertical-align: baseline; width: 483px; height: 381px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"></span></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Simulate!</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Right away I can see interesting results. In the nominal operation case, I can see that the output of each factory varies over time even after it reaches nominal production, and sometimes has very large dips. Here’s the factory output rate of each variant from a cold start:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> </span><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Behavioral_Models.m-11-02-26_11.png" width = "624" height = "409" alt = "" style = "vertical-align: baseline; width: 624px; height: 409px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I wanted to dig in to what is causing the production rate changes, and I was especially interested in what is happening with LeanBroth at around 7,500 seconds. </span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Behavioral_Models.m-11-02-26_12.png" width = "624" height = "376" alt = "" style = "vertical-align: baseline; width: 624px; height: 376px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">At first, I started doing what I would usually do: log signals I suspect are involved and start overplotting data until I find a relationship… but then I remembered: I have an agent! I asked that agent to explore the results and create plots that would explain the observations, and it came up with this: </span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">First, the periodic dips in factory output:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> </span><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Behavioral_Models.m-11-02-26_13.jpg" width = "624" height = "441" alt = "" style = "vertical-align: baseline; width: 624px; height: 441px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">And next, what’s going on at around 7,500 seconds:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> </span><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Behavioral_Models.m-11-02-26_14.jpg" width = "624" height = "449" alt = "" style = "vertical-align: baseline; width: 624px; height: 449px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Those are interesting behaviors that I could only learn about with dynamic simulations, and it was very convenient to have the agent as a partner to investigate this. </span></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">System-level Insights</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">After running through different simulated operational scenarios, I was able to learn new things about my design variants. I asked the agent to summarize insights that were discovered after running both the static analyses and the dynamics simulations: </span></div><table  style = 'margin: 3px 3px 3px 25px; border: 1px solid rgb(191, 191, 191); border-collapse: collapse; '><col/><col/><col/><col/><tr  style = 'background-color: rgb(245, 245, 245); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Observation</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>HyperCook</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>LeanBroth</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>EverSimmer</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Static → simulated throughput (bowls/hour)</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">320 → 308.4</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">210 → 196.8</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">240 → 231.9</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Time to first packaged output</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">2.0 minutes</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">57.3 minutes</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">57.3 minutes</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Time to sustained nominal production</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">13.6 minutes</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">62.6 minutes</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">62.6 minutes</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Energy per bowl (kWh)</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">1.562</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">0.822</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">1.216</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Production retained after worst single fault</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">~ 0%</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">~ 0%</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">67.3%</span></div></td></tr></table><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Summary</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Adding behaviors brought the trade study beyond spec-sheet comparisons, revealing differences in operational behaviors including startup time, energy use, and fault resilience. The agent helped me build reusable models and explore these scenarios cheaply. Now, the choice of soup factory rests not just on its architecture, but on how it behaves in operation.</span></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Now it's your turn</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The whole project is on GitHub as a runnable reference example: models, requirements, analysis, tests, and the documentation set. You can open the project and </span><a href = "https://github.com/mathworks/system-composer-rflp-reference-example/blob/main/GuidedTour.m"><span class="_richTextNode">open this guided tour</span></a><span class="_richTextNode">. </span></div>
<br>
</div><script type="text/javascript">
{ let css = '._richTextNode {white-space: break-spaces;}';
let head = document.head || document.getElementsByTagName('head')[0];
let style = document.createElement('style');
head.appendChild(style);
style.type = 'text/css';
if (style.styleSheet) {
    style.styleSheet.cssText = css;
} else {
    style.appendChild(document.createTextNode(css));
}


}</script>]]></content:encoded>
					
					<wfw:commentRss>https://blogs.mathworks.com/simulink/2026/10/30/behavioral-models-with-agentic-ai-powered-mbse/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Best Practices for Large Simscape Models</title>
		<link>https://blogs.mathworks.com/simulink/2026/10/21/best-practices-for-large-simscape-models/?s_tid=feedtopost</link>
					<comments>https://blogs.mathworks.com/simulink/2026/10/21/best-practices-for-large-simscape-models/#comments</comments>
		
		<dc:creator><![CDATA[Guy Rouleau]]></dc:creator>
		<pubDate>Wed, 21 Oct 2026 17:01:16 +0000</pubDate>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Physical Modeling]]></category>
		<category><![CDATA[Simulink Tips]]></category>
		<category><![CDATA[Simscape]]></category>
		<guid isPermaLink="false">https://blogs.mathworks.com/simulink/?p=18898</guid>

					<description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/simulink/files/SimscapeBestPractices.m-10-21-26_15.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" /></div><p>I have been supporting users of Simulink and Simscape for many years. During this time, I built up in my head a list of best practices that I systematically go through when I receive new Simscape... <a class="read-more" href="https://blogs.mathworks.com/simulink/2026/10/21/best-practices-for-large-simscape-models/">read more >></a></p>]]></description>
										<content:encoded><![CDATA[<div class = rtcContent><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><a href = "https://matlab.mathworks.com/open/github/v1?repo=simulink/blog&amp;project=SimscapeBestPractices/SimscapeBestPractices.prj"><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeBestPractices.m-10-21-26_1.png" width = "136" height = "21" alt = "" style = "vertical-align: baseline; width: 136px; height: 21px;"></img></a></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I have been supporting users of Simulink and Simscape for many years. During this time, I built up in my head a list of best practices that I systematically go through when I receive new Simscape models from colleagues and customers.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In this post, I will share that checklist, with examples.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Before getting started, a few disclaimers:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">It's not a must to follow all those practices 100% of the time. Many small and medium scale Simscape networks can simulate successfully and efficiently even if you do not follow my recommended best practices. Based on my experience, following those best practices is especially important for large Simscape simulations where, at scale, any small issue gets amplified.</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Most of my experience with Simscape is with the mechanical and isothermal liquid domains, so what I am describing has been learned with those domains.</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Many of those best practices are targeted at Simulink variable step solvers, to avoid unnecessarily small time steps that can slow the simulation unnecessarily.</span></li></ul><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Let's get started.</span></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Initialization</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">When configured properly, Simscape networks usually initialize quickly. When variables do not converge on the first attempt, the Simscape initialization falls back to more advanced modes that require more computation and can take time. When that happens, you will see this warning:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-family: monospace;'>Warning: First solve for initial conditions failed to converge. Trying again with all high priorities relaxed to low.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">You really want to avoid this warning.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The tool I like to use to investigate this issue is the </span><a href = "https://www.mathworks.com/help/simscape/ug/variable-viewer.html"><span class="_richTextNode">Simscape Variable Viewer</span></a></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeBestPractices.m-10-21-26_2.png" width = "621" height = "303" alt = "" style = "vertical-align: baseline; width: 621px; height: 303px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">What I recommend is to enable the </span><span class="_richTextNode" style=' font-weight: bold;'>Advanced</span><span class="_richTextNode"> configuration so you can see the column titled </span><span class="_richTextNode" style=' font-weight: bold;'>Differential</span><span class="_richTextNode">.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeBestPractices.m-10-21-26_3.png" width = "971" height = "434" alt = "" style = "vertical-align: baseline; width: 971px; height: 434px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Differential variables are the actual degrees of freedom in the system, the variables that will be integrated by the Simulink solver. Because of that, the general advice I typically give is:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-style: italic;'>Set the priority of</span><span class="_richTextNode"> </span><span class="_richTextNode" style=' font-weight: bold; font-style: italic;'>all</span><span class="_richTextNode"> </span><span class="_richTextNode" style=' font-style: italic;'>differential variables and</span><span class="_richTextNode"> </span><span class="_richTextNode" style=' font-weight: bold; font-style: italic;'>only</span><span class="_richTextNode"> </span><span class="_richTextNode" style=' font-style: italic;'>the differential variables to</span><span class="_richTextNode"> </span><span class="_richTextNode" style=' font-weight: bold; font-style: italic;'>High</span><span class="_richTextNode">, set all other priorities to </span><span class="_richTextNode" style=' font-weight: bold; font-style: italic;'>none</span><span class="_richTextNode">. Never use Low priority.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">This comes with three exceptions:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Simscape Multibody: Low priority should be used only with Simscape Multibody joints. For example, a low priority can be used to guide a closed loop mechanism that has two valid configurations of type "elbow-up vs elbow-down", like this </span><a href = "https://www.mathworks.com/help/sm/ug/assembling-parts-into-a-four-bar-mechanism.html"><span class="_richTextNode">four bar mechanism</span></a><span class="_richTextNode">.</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Some shipping Simscape components have variables that will end up being differential for which the user does not have control. Those typically have a priority of None and are fine like that, no worries.</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">When you can manually swap a differential variable for an equivalent algebraic variable.</span></li></ul><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Let's look at an example.</span></div><h3  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 20.4px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; '><span class="_richTextNode">Conflicting Initial Conditions</span></h3><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >mdl = </span><span style="color: rgb(167, 9, 245);">'GasChargedAccumulatorTestRig'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >open_system(mdl);</span></span></div></div></div><div  style = 'margin: 10px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeBestPractices.m-10-21-26_4.png" width = "397" height = "149" alt = "" style = "vertical-align: baseline; width: 397px; height: 149px;"></img></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper outputs"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >out = sim(mdl);</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(217, 217, 217) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsWarningElement" uid="011334A1" prevent-scroll="true" data-testid="output_0" style="width: 1178px; white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;" tabindex="-1"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType eoOutputContent" tabindex="-1" data-previous-available-width="1141" data-previous-scroll-height="19" data-hashorizontaloverflow="false" role="article" aria-roledescription="Use Browse Mode to explore " aria-description="warning output " style="max-height: 261px; white-space: normal; font-style: normal; color: rgb(179, 98, 5); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(179, 98, 5); font-size: 12px;">Warning: First solve for initial conditions failed to converge. Trying again with all high priorities relaxed to low.</div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(179, 98, 5); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsWarningElement" uid="CBAD524F" prevent-scroll="true" data-testid="output_1" style="width: 1178px; white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;" tabindex="-1"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType eoOutputContent" tabindex="-1" data-previous-available-width="1141" data-previous-scroll-height="93" data-hashorizontaloverflow="false" role="article" aria-roledescription="Use Browse Mode to explore " aria-description="warning output " style="max-height: 261px; white-space: normal; font-style: normal; color: rgb(179, 98, 5); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(179, 98, 5); font-size: 12px;">Warning: Unable to satisfy all initial conditions. The variables involved are listed below.<br style="white-space: pre-wrap; font-style: normal; color: rgb(179, 98, 5); font-size: 12px;"><br style="white-space: pre-wrap; font-style: normal; color: rgb(179, 98, 5); font-size: 12px;">The following variables' targets could not be honored:<br style="white-space: pre-wrap; font-style: normal; color: rgb(179, 98, 5); font-size: 12px;"><br style="white-space: pre-wrap; font-style: normal; color: rgb(179, 98, 5); font-size: 12px;">'Gas_Charged_Accumulator.p_I' (Pressure of liquid volume)<br style="white-space: pre-wrap; font-style: normal; color: rgb(179, 98, 5); font-size: 12px;">'Gas_Charged_Accumulator.liquid_volume' (Volume of liquid)<br style="white-space: pre-wrap; font-style: normal; color: rgb(179, 98, 5); font-size: 12px;"></div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(179, 98, 5); font-size: 12px;"></div></div></div></div></div></div><div  style = 'margin: 10px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In this case, the </span><a href = "https://www.mathworks.com/help/releases/R2025b/hydro/ref/gaschargedaccumulatoril.html"><span class="_richTextNode">Gas Charged Accumulator</span></a><span class="_richTextNode"> specifies both an initial pressure and initial volume. Those two variables are not independent and only one should be specified with High Priority.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeBestPractices.m-10-21-26_5.png" width = "553" height = "260" alt = "" style = "vertical-align: baseline; width: 553px; height: 260px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The Simscape Variable Viewer shows that the Pressure is the differential variable, so I would set the Volume of Liquid priority to None to make the warning go away.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeBestPractices.m-10-21-26_6.png" width = "957" height = "242" alt = "" style = "vertical-align: baseline; width: 957px; height: 242px;"></img></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Algebraic Loops</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The </span><a href = "https://www.mathworks.com/help/simscape/ug/limitations.html#bqqjdvg-4"><span class="_richTextNode">Simscape documentation</span></a><span class="_richTextNode"> states it clearly: </span><span class="_richTextNode" style=' font-weight: bold; font-style: italic;'>A Simscape physical network should not exist within a Simulink algebraic loop</span><span class="_richTextNode">*.*</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">However this is not enforced, because it can work in some cases. Based on my experience, even if it works for your model today, fix it, this will likely cause you trouble as your model grows.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">To avoid algebraic loops, I can recommend two approaches:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">If the algorithm is relatively simple, instead of going out to Simulink and back into Simscape, stay in Simscape and use the blocks from the Physical Signals section of the library. For example, see these posts where I described how to create custom valves for Simscape (</span><a href = "https://blogs.mathworks.com/simulink/2015/05/26/creating-custom-valve-in-simscape"><span class="_richTextNode">Custom hydraulic valve</span></a><span class="_richTextNode">, </span><a href = "https://blogs.mathworks.com/simulink/2017/08/17/creating-your-own-check-valve-for-the-simscape-gas-domain"><span class="_richTextNode">Custom Gas valve</span></a><span class="_richTextNode">)</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">If the algorithm is too complex to be implemented using the Simscape Physical Signals blocks, use a </span><a href = "https://www.mathworks.com/help/simulink/slref/transferfcn.html"><span class="_richTextNode">Transfer Function</span></a><span class="_richTextNode"> to break the algebraic loop. See this post for more details:  </span><a href = "https://blogs.mathworks.com/simulink/2015/07/18/why-you-should-never-break-an-algebraic-loop-with-with-a-memory-block/"><span class="_richTextNode">Why you should never break a continuous algebraic loop with a Memory block</span></a></li></ul><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">DAE Failures</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">DAE stands for </span><a href = "https://www.mathworks.com/help/simscape/ug/how-simscape-models-represent-physical-systems.html#bsjpdmk"><span class="_richTextNode">Differential Algebraic Equations</span></a><span class="_richTextNode"> and is key to how Simscape solve equations.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">You really want to avoid this warning:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-family: monospace;'>Warning:Solver is encountering difficulty in simulating model 'modelname' at time 1.0000000000000036. Simulink will continue to simulate with warnings. Please check the model for errors.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-family: monospace;'>Caused by:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> </span><span class="_richTextNode" style=' font-family: monospace;'>Solver was unable to reduce the step size without violating the minimum step size value of 3.55271E-15 for 1 consecutive times at time 1. This usually may be caused by violating algebraic constraints in the differential-algebraic system or by the high stiffness of the system. Try tightening the error tolerances, and/or the tolerances for computing consistent conditions. If the problem persists, please check the system or increase the solver Number of consecutive min steps violation parameter.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> </span><span class="_richTextNode" style=' font-family: monospace;'>Suggested Actions:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> </span><span class="_richTextNode" style=' font-family: monospace;'>Open Solver Profiler to explore such issues</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I wrote about this topic a long time ago here: </span><a href = "https://blogs.mathworks.com/simulink/2015/07/06/identifying-the-root-cause-of-an-algebraic-constraint-violation/"><span class="_richTextNode">Identifying the root cause of an algebraic constraint violation</span></a><span class="_richTextNode" style=' text-decoration: underline;'>.</span><span class="_richTextNode"> While the core issue is the same, the tools to investigate those have improved a lot.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">If you have only one or two instances of this warning and the simulation completes successfully, you can probably ignore it, but it's a sign of bad numerical robustness. Typically, this kind of warning is related to the fact that the system is modeled too ideally.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">To illustrate this situation, I made this simple model using the Isothermal Liquid domain. On the right of the diagram, I used two </span><a href = "https://www.mathworks.com/help/releases/R2025b/simscape/ref/capil.html"><span class="_richTextNode">Cap (IL)</span></a><span class="_richTextNode"> blocks. This block is an ideal component that allows zero flow.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >mdl = </span><span style="color: rgb(167, 9, 245);">'dae_example'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >open_system(mdl);</span></span></div></div></div><div  style = 'margin: 10px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeBestPractices.m-10-21-26_7.png" width = "504" height = "244" alt = "" style = "vertical-align: baseline; width: 504px; height: 244px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">If I try simulating this model, it will hang with an infinite number of the above warnings, so I will run it with the </span><span class="_richTextNode" style=' font-family: monospace;'>TimeOut</span><span class="_richTextNode"> option.</span></div><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; text-indent: 0px; '><span style="white-space: pre"><span >out = sim(mdl,</span><span style="color: rgb(167, 9, 245);">'TimeOut'</span><span >,2);</span></span></div></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeBestPractices.m-10-21-26_8.png" width = "879" height = "306" alt = "" style = "vertical-align: baseline; width: 879px; height: 306px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">As mentioned in the Suggested Action, let's run the model through the Solver Profiler.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeBestPractices.m-10-21-26_9.png" width = "467" height = "332" alt = "" style = "vertical-align: baseline; width: 467px; height: 332px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In the configure section, I always enable logging for these three options:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Continuous States</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Simscape States</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Zero Crossing</span></li></ul><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeBestPractices.m-10-21-26_10.png" width = "541" height = "196" alt = "" style = "vertical-align: baseline; width: 541px; height: 196px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I click run, wait for a few seconds that many instances of the diagnostic are triggered, and stop it. What we can see here is that the solver step size "stalls", taking very small step of only 1e-15sec. </span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeBestPractices.m-10-21-26_11.png" width = "867" height = "536" alt = "" style = "vertical-align: baseline; width: 867px; height: 536px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In the Solver Profiler Solver Exceptions table, we try sorting the states such that the most likely culprits are at the top of the list. Any non-zero value in the DAE column should be addressed.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In the Solver Profiler, try opening the State Explorer and/or the Simscape Results Explorer. </span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeBestPractices.m-10-21-26_12.png" width = "284" height = "94" alt = "" style = "vertical-align: baseline; width: 284px; height: 94px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">These two tools present similar results in different ways:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode" style=' font-weight: bold;'>State Explorer:</span><span class="_richTextNode"> Visualize the states integrated by the Simulink solver. States are listed in a table and sorted based on different criteria. I like to start here, sort the states by Newton/DAE Exception and look for anything unexpected or nonphysical, like sudden jumps. This helps me identify which blocks in the model are the most likely culprits.</span></li></ul><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeBestPractices.m-10-21-26_13.png" width = "795" height = "405" alt = "" style = "vertical-align: baseline; width: 795px; height: 405px;"></img></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode" style=' font-weight: bold;'>Simscape Results Explorer:</span><span class="_richTextNode"> Displays all Simscape variables (a subset of these become states and are shown in the State Explorer). This allows me to "zoom in" the culprit area identified in the previous step and see all variables and get a better understanding of the problem.</span></li></ul><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeBestPractices.m-10-21-26_14.png" width = "593" height = "396" alt = "" style = "vertical-align: baseline; width: 593px; height: 396px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">For the example we are looking into today, the first block listed in the solver profiler is the pressure at port B of the upper Check Valve. The problem is that this node is "dry", or too ideal. The Check Valve is trying to open, but the fluid has nowhere to go. In the real system, there is most likely a volume of fluid between the check valve and the 4-way valve.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">To avoid the problem, the simplest trick is usually to insert a </span><a href = "https://www.mathworks.com/help/simscape/ref/constantvolumechamberil.html"><span class="_richTextNode">Constant Volume Chamber</span></a><span class="_richTextNode"> on the node to allow the fluid to go somewhere.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeBestPractices.m-10-21-26_15.png" width = "507" height = "280" alt = "" style = "vertical-align: baseline; width: 507px; height: 280px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In terms of equations, this happens when many variables are linked together by complex algebraic constraints. Adding a volume of fluid on that node breaks the algebraic constraint and the variables involved become independent degrees of freedom.</span></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Solver Resets</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I covered this concept in this post: </span><a href = "https://blogs.mathworks.com/simulink/2020/01/17/a-new-first-order-hold/"><span class="_richTextNode">A New First Order Hold! » Guy on Simulink - MATLAB &amp; Simulink</span></a></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">When a block with continuous states (Integrator, State-Space, a Simscape network, etc) is driven by a signal with a discrete sample time, the Simulink solver needs to reset. When the model contains Simscape blocks and uses an implicit solver (ode15s, ode23t, daessc), a solver reset systematically triggers a recomputation of the solver Jacobian. This is an expensive operation that scales exponentially with the size of the model, so you want to avoid that as much as possible.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Here are my tips to avoid that:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">When looping out to Simulink and back into Simscape, avoid introducing Fixed-In-Minor sample times. See this post for more details: </span><a href = "https://blogs.mathworks.com/simulink/2015/07/18/why-you-should-never-break-an-algebraic-loop-with-with-a-memory-block/"><span class="_richTextNode">Why you should never break a continuous algebraic loop with a Memory block</span></a></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">When the Simscape network is connected in a loop with a fixed-step discrete controller, insert First Order Hold blocks on the discrete signal. See this </span><a href = "https://blogs.mathworks.com/simulink/2020/01/17/a-new-first-order-hold/"><span class="_richTextNode">blog post</span></a><span class="_richTextNode"> for more details on how to use this block properly.</span></li></ul><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Zero-Crossing Events</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The other type of events that forces the Simulink solver to recompute its Jacobian is zero-crossing. If you are not familiar with the concept of zero-crossing detection, I recommend starting with the Simulink documentation: </span><a href = "https://www.mathworks.com/help/simulink/ug/zero-crossing-detection.html"><span class="_richTextNode">Zero-Crossing Detection - MATLAB &amp; Simulink</span></a></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Once you are familiar with zero-crossing detection in Simulink, see this Simscape-specifics guidance:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://www.mathworks.com/help/releases/R2025b/simscape/ug/how-simscape-models-represent-physical-systems.html#bviqsqd-1"><span class="_richTextNode">Managing Zero Crossings in Simscape Models</span></a></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://www.mathworks.com/help/releases/R2025b/simscape/ug/reduce-zero-crossings.html"><span class="_richTextNode">Reduce Zero Crossings</span></a></li></ul><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Here is my take on that.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">With Simulink variable-step solvers, zero-crossing detection is necessary to accurately capture discontinuities. However, you don't want to capture more than needed.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The first thing to do to determine if zero-crossing is a problem for a simulation is to run it through the Solver Profiler. Look at the zero-crossing tab and use your knowledge of the model to determine if the blocks listed and the number of events seem appropriate. If you see more events than you expect, open the </span><a href = "https://www.mathworks.com/help/simulink/slref/zerocrossingexplorer.html"><span class="_richTextNode">Zero-Crossing Explorer</span></a><span class="_richTextNode">, and look for the following patterns:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">If a variable is chattering around one event, try adding damping to damp out the oscillations faster, or see if you could steer the system to operate slightly on one side or the other of the zero-crossing threshold</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">If a variable crosses its zero level often, but seems continuous and this is a component for which you have control over the Simscape language source code, try disabling zero-crossing. </span></li></ul><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In a similar way as I do with the State Explorer and the Simscape Results Explorer, when investigating zero-crossing events I alternate between the Zero-Crossing Explorer and the Simscape Results Explorer.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Let's illustrate that with a classic: The bouncing ball, which I implemented using a </span><a href = "https://www.mathworks.com/help/simscape/ref/translationalhardstop.html"><span class="_richTextNode">Translational Hard Stop</span></a><span class="_richTextNode">:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeBestPractices.m-10-21-26_16.png" width = "350" height = "171" alt = "" style = "vertical-align: baseline; width: 350px; height: 171px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The Solver Profiler tells me that the zero-crossing events are coming from the Hard Stop block, but not exactly which equation within the Hard Stop block.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeBestPractices.m-10-21-26_17.png" width = "523" height = "516" alt = "" style = "vertical-align: baseline; width: 523px; height: 516px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">If you open the Simscape Results Explorer, you can see that the Hard Stop block has two zero-crossing equations registered. If you select "zc_2", the Node Statistics panel contains a hyperlink to the location.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeBestPractices.m-10-21-26_18.png" width = "777" height = "662" alt = "" style = "vertical-align: baseline; width: 777px; height: 662px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Clicking the location hyperlink opens the source code for the block and puts the cursor on the line generating the zero-crossing event.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeBestPractices.m-10-21-26_19.png" width = "587" height = "187" alt = "" style = "vertical-align: baseline; width: 587px; height: 187px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Knowing exactly which equation triggers the zero-crossing events should help you determine if it is really needed for your application and make appropriate engineering decisions.</span></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Now it's your turn</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In this post, I listed a set of things to look for to keep your Simscape simulations healthy. This includes:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Initial conditions</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Algebraic loops</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">DAE failures and dry nodes</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Solver Resets</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Zero-Crossing events</span></li></ul><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Let us know in the comments below if there are other items you typically look for to assess if your Simscape simulations run efficiently.</span></div>
<br>
</div><script type="text/javascript">
{ let css = '._richTextNode {white-space: break-spaces;} /* Copyright 2014-2025 The MathWorks, Inc. *//* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsErrorElement {    min-height: 18px;    max-height: 550px;} .embeddedOutputsErrorElement .diagnosticMessage-errorType {    overflow: auto;} .embeddedOutputsErrorElement.inlineElement {} .embeddedOutputsErrorElement.rightPaneElement {} /* Copyright 2014-2025 The MathWorks, Inc. *//* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsWarningElement {    min-height: 18px;    max-height: 550px;} .embeddedOutputsWarningElement .diagnosticMessage-warningType {    overflow: auto;} .embeddedOutputsWarningElement.inlineElement {} .embeddedOutputsWarningElement.rightPaneElement {} /* Copyright 2015-2025 The MathWorks, Inc. *//* In this file, styles are not scoped to rtcContainer since they could be in the Dojo Tooltip */.diagnosticMessage-wrapper {    /* Since this selector may be used outside RTC Container without RTC semantic variables, a    default value is used. An example here is the App Designers alert tooltip. */    font-family: var(--rtc-output-font-family, Menlo, Monaco, Consolas, "Courier New", monospace);    font-size: var(--rtc-output-font-size, 12px);} .diagnosticMessage-wrapper.diagnosticMessage-warningType {    /*This fallback value will be used for appdesigner warnings*/    color: var(--rtc-warning-output-color, var(--mw-color-matlabWarning));} .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    /*This fallback value will be used for appdesigner warnings*/    color: var(--rtc-warning-output-color, var(--mw-color-matlabWarning));    text-decoration: underline;} .rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-warningType,.rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: var(--mw-color-matlabWarning) !important;} .diagnosticMessage-wrapper.diagnosticMessage-errorType {    /*This fallback value will be used in appdesigner error tooltip text*/    color: var(--rtc-error-output-color, var(--mw-color-matlabErrors));} .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    /*This fallback value will be used in appdesigner error tooltip text*/    color: var(--rtc-error-output-color, var(--mw-color-matlabErrors));    text-decoration: underline;} .rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-errorType,.rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: var(--mw-color-matlabErrors) !important;} .diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {    white-space: pre-wrap;} .diagnosticMessage-wrapper .diagnosticMessage-stackPart {    white-space: pre;} /* Copyright 2014-2025 The MathWorks, Inc. */.embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {    white-space: pre;    word-wrap:  initial;    min-height: 18px;    max-height: 550px;} .embeddedOutputsTextElement .textElement,.embeddedOutputsVariableStringElement .textElement {    overflow: auto;} .textElement,.rtcDataTipElement .textElement {    padding-top: 2px;} .embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {} .inlineElement .textElement {} .embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .textElement {    padding-top: 2px;    padding-left: 9px;} .embeddedOutputsVariableStringElement { width: initial !important; }';
let head = document.head || document.getElementsByTagName('head')[0];
let style = document.createElement('style');
head.appendChild(style);
style.type = 'text/css';
if (style.styleSheet) {
    style.styleSheet.cssText = css;
} else {
    style.appendChild(document.createTextNode(css));
}


}</script>]]></content:encoded>
					
					<wfw:commentRss>https://blogs.mathworks.com/simulink/2026/10/21/best-practices-for-large-simscape-models/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>What&#8217;s New in R2026b?</title>
		<link>https://blogs.mathworks.com/simulink/2026/09/24/whats-new-in-r2026b/?s_tid=feedtopost</link>
					<comments>https://blogs.mathworks.com/simulink/2026/09/24/whats-new-in-r2026b/#comments</comments>
		
		<dc:creator><![CDATA[Guy Rouleau]]></dc:creator>
		<pubDate>Thu, 24 Sep 2026 17:13:24 +0000</pubDate>
				<category><![CDATA[What's new?]]></category>
		<guid isPermaLink="false">https://blogs.mathworks.com/simulink/?p=18864</guid>

					<description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/simulink/files/WhatsNewR2026b.m-09-24-26_2.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><p>MATLAB R2026b is now available. Here are my favorite enhancements.Published Referenced ModelsIn R2026b, you will notice a new Publish button in the Simulink toolstrip:When publishing a model, a new... <a class="read-more" href="https://blogs.mathworks.com/simulink/2026/09/24/whats-new-in-r2026b/">read more >></a></p>]]></description>
										<content:encoded><![CDATA[<div class = rtcContent><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><a href = "https://matlab.mathworks.com/open/github/v1?repo=simulink/blog&amp;project=2026_09_23_R2026b/matlab.toml"><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/WhatsNewR2026b.m-09-24-26_1.png" width = "136" height = "21" alt = "" style = "vertical-align: baseline; width: 136px; height: 21px;"></img></a></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">MATLAB R2026b is now available. Here are my favorite enhancements.</span></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Published Referenced Models</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In R2026b, you will notice a new </span><span class="_richTextNode" style=' font-weight: bold;'>Publish</span><span class="_richTextNode"> button in the Simulink toolstrip:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/WhatsNewR2026b.m-09-24-26_2.png" width = "550" height = "260" alt = "" style = "vertical-align: baseline; width: 550px; height: 260px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">When publishing a model, a new SLXP file is created. This file contains a precompiled, ready-to-run version of the model. As a result, models that reference a published model can initialize quickly by skipping </span><a href = "https://blogs.mathworks.com/simulink/2023/10/18/accelerator-cache-and-rebuilds-everything-you-need-to-know"><span class="_richTextNode">rebuild checks</span></a><span class="_richTextNode"> and using the precompiled version in the SLXP file.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Publishing can also be done programmatically using </span><a href = "https://www.mathworks.com/help/rtw/ref/publishmodel.html"><span class="_richTextNode" style=' font-family: monospace;'>publishmodel</span></a><span class="_richTextNode">.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">A Model block that references a published model displays a new badge:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/WhatsNewR2026b.m-09-24-26_3.png" width = "414" height = "110" alt = "" style = "vertical-align: baseline; width: 414px; height: 110px;"></img></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">MATLAB Project definition file</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">This enhancement is not specific to Simulink, but I expect many Simulink users to like it. </span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Before R2026b, MATLAB projects stored project definition information in many XML files in a resources folder. This made the metadata difficult to inspect and added noise to source-control diffs. In R2026b, you can instead store this information in a single, human-readable </span><span class="_richTextNode" style=' font-family: monospace;'>matlab.toml</span><span class="_richTextNode"> file at the top level of the project.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/WhatsNewR2026b.m-09-24-26_4.png" width = "774" height = "425" alt = "" style = "vertical-align: baseline; width: 774px; height: 425px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">This is controlled in the MATLAB settings:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/WhatsNewR2026b.m-09-24-26_5.png" width = "646" height = "368" alt = "" style = "vertical-align: baseline; width: 646px; height: 368px;"></img></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">If you want to convert an existing project, you can execute:</span></div><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; text-indent: 0px; '><span style="white-space: pre"><span >matlab.project.convertDefinitionFiles(pwd,matlab.project.DefinitionFiles.Toml)</span></span></div></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Save Simulink Data Dictionaries in JSON format</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Before R2026b, Simulink Data Dictionary files were saved in a binary format. In R2026b, we are adding an option to save data dictionaries as an uncompressed text file in a JSON format. Many users may not notice a difference in their day-to-day workflows, but for teams using Git, this option should help keep repository sizes manageable and simplify diff workflows.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The data dictionary format is also controlled from the MATLAB settings:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/WhatsNewR2026b.m-09-24-26_6.png" width = "912" height = "322" alt = "" style = "vertical-align: baseline; width: 912px; height: 322px;"></img></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Simulink comparison results available at the MATLAB Command Prompt</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">When calling </span><a href = "https://www.mathworks.com/help/matlab/ref/visdiff.html"><span class="_richTextNode" style=' font-family: monospace;'>visdiff</span></a><span class="_richTextNode"> on two Simulink models, the output now contains a table with all the changes.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >result = visdiff(</span><span style="color: rgb(167, 9, 245);">'vdp1.slx'</span><span >,</span><span style="color: rgb(167, 9, 245);">'vdp2.slx'</span><span >);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; text-indent: 0px; '><span style="white-space: pre"><span >result.Result.Matches</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(217, 217, 217) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsVariableTableElement" uid="1CE152DA" prevent-scroll="true" data-testid="output_0" style="width: calc(100% - 5px);" tabindex="-1"><div class="outputLayer selectedOutputDecorationLayer doNotExport" aria-hidden="true"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport" aria-hidden="true"></div><div class="outputLayer navigationFocusLayer doNotExport" aria-hidden="false" role="application" tabindex="-1"></div><div class="outputLayer activeOutputDecorationLayer doNotExport" aria-hidden="false" role="application"></div><div class="ClientDocument veSpecifier table constrictHeight" id="variableeditor_client_Document_0" widgetid="variableeditor_client_Document_0" tabindex="0" aria-labelledby="variableeditor_views_SummaryBar_0"><div class="summaryBar" style="font-size: 12px; font-family: Consolas, Inconsolata, Menlo, monospace;"><span>ans = </span><span style="color: rgb(179, 179, 179); font-style: normal;">14×6 table </span></div><div id="variableeditor_TableViewModel_0" widgetid="variableeditor_TableViewModel_0" class="table lightWeightView ClientViewDiv hasSummaryBar" data-viewid="__1" style="width: 100%; overflow: auto;"><table cellspacing="0" style="border-spacing: 0px; border-collapse: collapse;"><thead><tr><th rowspan="1" style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 34px; border: 1px solid rgb(191, 191, 191); text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span> </span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>LeftPath</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>RightPath</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>ChangeType</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Details</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>LeftObject</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>RightObject</span></th></tr></thead><tbody><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>1</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"Simulink"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"Simulink"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"unchanged"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 struct</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 SimulinkObject (model)</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 SimulinkObject (model)</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>2</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>["Simulink", "Scope"]</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"deleted"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 struct</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 SimulinkObject (Scope Block)</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>3</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>["Simulink", "Out3"]</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"inserted"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 struct</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 SimulinkObject (Outport Block)</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>4</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>["Simulink", "Mu"]</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>["Simulink", "Mu"]</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"modified"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 struct</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 SimulinkObject (SubSystem Block)</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 SimulinkObject (SubSystem Block)</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>5</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>["Simulink", "Product:1 -&gt; Mu:1"]</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>["Simulink", "Product:1 -&gt; 2 Destinations"]</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"modified"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 struct</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>6</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>["Simulink", "Product:1 -&gt; 2 Destinations", "Branch -&gt; Mu:1"]</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"inserted"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 struct</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 SimulinkObject (line)</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>7</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>["Simulink", "Product:1 -&gt; 2 Destinations", "Branch -&gt; Out3:1"]</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"inserted"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 struct</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 SimulinkObject (line)</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>8</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>["Simulink", "Product:1 -&gt; Mu:1", "Product:1 -&gt; Mu:1"]</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>["Simulink", "Product:1 -&gt; 2 Destinations", "Product:1 -&gt; Branch"]</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"modified"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 struct</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 SimulinkObject (line)</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 SimulinkObject (line)</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>9</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>["Simulink", "x1:x1 -&gt; 4 Destinations"]</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>["Simulink", "x1:x1 -&gt; 3 Destinations"]</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"modified"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 struct</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>10</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>["Simulink", "x1:x1 -&gt; 4 Destinations", "Branch -&gt; Branch"]</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"deleted"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 struct</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 SimulinkObject (line)</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>11</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>["Simulink", "x1:x1 -&gt; 4 Destinations", "Branch -&gt; Scope:1"]</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"deleted"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 struct</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 SimulinkObject (line)</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>12</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>["Simulink", "x2:x2 -&gt; 4 Destinations"]</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>["Simulink", "x2:x2 -&gt; 3 Destinations"]</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"modified"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 struct</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>13</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>["Simulink", "x2:x2 -&gt; 4 Destinations", "Branch -&gt; Branch"]</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"deleted"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 struct</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 SimulinkObject (line)</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>14</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>["Simulink", "x2:x2 -&gt; 4 Destinations", "Branch -&gt; Scope:2"]</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>"deleted"</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 struct</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>1×1 SimulinkObject (line)</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;"><span>&lt;missing&gt;</span></td></tr></tbody></table></div></div></div></div></div></div><div  style = 'margin: 10px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">This is especially useful when using a coding agent connected to MATLAB through the MCP server. Here is an example where I asked </span><a href = "https://learn.chatgpt.com/docs/codex/cli"><span class="_richTextNode">Codex CLI</span></a><span class="_richTextNode"> to summarize the above changes:</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/WhatsNewR2026b.m-09-24-26_7.png" width = "716" height = "626" alt = "" style = "vertical-align: baseline; width: 716px; height: 626px;"></img></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Tabs in Simulation Data Inspector</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The Simulation Data Inspector now has tabs, making it easier to organize and view large number of signals.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/WhatsNewR2026b.m-09-24-26_8.gif" width = "954" height = "428" alt = "" style = "vertical-align: baseline; width: 954px; height: 428px;"></img></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Custom Simulink Solvers</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">It is now possible to write your own solver for Simulink models. This can potentially improve speed and/or accuracy when dealing with specialized sets of equations that could be solved more efficiently using special solver algorithms not included with Simulink.</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">See this example: </span><a href = "https://www.mathworks.com/help/simulink/slref/implement-stabilized-variable-step-plugin-solver-using-chebyshev-polynomials.html"><span class="_richTextNode">Implement Stabilized Variable-Step Plugin Solver Using Chebyshev Polynomials - MATLAB &amp; Simulink</span></a></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">This feature is also useful if you want to impress your friends and colleagues by having your name appear in the list of solvers available in Simulink!</span></div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/WhatsNewR2026b.m-09-24-26_9.png" width = "953" height = "456" alt = "" style = "vertical-align: baseline; width: 953px; height: 456px;"></img></div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Now it's your turn</span></h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Go through the </span><a href = "https://www.mathworks.com/help/simulink/release-notes.html"><span class="_richTextNode">Simulink release notes</span></a><span class="_richTextNode"> and let us know your favorite enhancements and which topics you would like to see covered in more detail on this blog.</span></div>
<br>
</div><script type="text/javascript">
{ let css = '._richTextNode {white-space: break-spaces;} /* Copyright 2017-2025 The MathWorks, Inc. */.embeddedOutputsVariableTableElement .ClientViewDiv  table tr {  height: 22px;  white-space: nowrap;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr td,.embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {  background-color:white;  text-overflow: ellipsis;  font-family: Arial, sans-serif;  overflow : hidden;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr span {  text-overflow: ellipsis;  padding: 3px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {    color: rgba(0,0,0,0.5);  padding: 3px;  font-size: 9px;} /* ClientDocument has a summary bar child that takes up 17px, this clashes with overflow on the view which allots space for scrollbars. On print preview, this causes headers from <thead> to overlap on subsequent pages. Displaying Document as flex renders summarybar and view in column format and fixes the issue g2788485 */.embeddedOutputsVariableTableElement .ClientDocument {  display: flex;  flex-direction: column;}';
let head = document.head || document.getElementsByTagName('head')[0];
let style = document.createElement('style');
head.appendChild(style);
style.type = 'text/css';
if (style.styleSheet) {
    style.styleSheet.cssText = css;
} else {
    style.appendChild(document.createTextNode(css));
}


}</script>]]></content:encoded>
					
					<wfw:commentRss>https://blogs.mathworks.com/simulink/2026/09/24/whats-new-in-r2026b/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Trade Studies with Agentic-AI-powered MBSE</title>
		<link>https://blogs.mathworks.com/simulink/2026/08/12/trade-studies-with-agentic-ai-powered-mbse/?s_tid=feedtopost</link>
					<comments>https://blogs.mathworks.com/simulink/2026/08/12/trade-studies-with-agentic-ai-powered-mbse/#respond</comments>
		
		<dc:creator><![CDATA[Guy Rouleau]]></dc:creator>
		<pubDate>Wed, 12 Aug 2026 19:54:33 +0000</pubDate>
				<category><![CDATA[AI Coding Assistant]]></category>
		<category><![CDATA[Guest Blogger]]></category>
		<category><![CDATA[Model-Based Systems Engineering]]></category>
		<guid isPermaLink="false">https://blogs.mathworks.com/simulink/?p=18845</guid>

					<description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/simulink/files/MBSE_Trade_Study_part1.m-08-12-26_3.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><p> Today I am happy to welcome back Sarah Dagen from MathWorks Consulting Services..In my previous post, I used an agentic AI workflow to create an initial system design for an intergalactic soup... <a class="read-more" href="https://blogs.mathworks.com/simulink/2026/08/12/trade-studies-with-agentic-ai-powered-mbse/">read more >></a></p>]]></description>
										<content:encoded><![CDATA[<div class = rtcContent><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><a href = "https://matlab.mathworks.com/open/github/v1?repo=simulink/blog&amp;project=2026_04_27_MBSE_GenAI/MBSE_and_GenAI.prj"><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Trade_Study_part1.m-08-12-26_1.png" width = "136" height = "21" alt = "" style = "vertical-align: baseline; width: 136px; height: 21px;"></img></a></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-style: italic;'>Today I am happy to welcome back</span><span class="_richTextNode"> </span><a href="https://www.linkedin.com/in/sarah-dagen/" target="_blank" rel="noopener"><span class="_richTextNode">Sarah Dagen</span></a><span class="_richTextNode"> </span><span class="_richTextNode" style=' font-style: italic;'>from</span><span class="_richTextNode"> </span><a href = "https://www.mathworks.com/services/consulting.html"><span class="_richTextNode">MathWorks Consulting Services</span></a><span class="_richTextNode">.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-style: italic;'>.</span><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Trade_Study_part1.m-08-12-26_2.png" width = "134" height = "188" alt = "" style = "vertical-align: baseline; width: 134px; height: 188px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In </span><a href = "https://blogs.mathworks.com/simulink/2026/04/26/model-based-systems-engineering-and-agentic-ai"><span class="_richTextNode">my previous post</span></a><span class="_richTextNode">, I used an agentic AI workflow to create an initial system design for an intergalactic soup factory. That first pass produced a single design based on the RFLP (Requirements-Functional-Logical-Physical) methodology. Getting </span><span class="_richTextNode" style=' font-weight: bold; font-style: italic;'>one</span><span class="_richTextNode"> architecture out of an agent is nice, but real systems engineering is about choosing between </span><span class="_richTextNode" style=' font-weight: bold; font-style: italic;'>alternatives</span><span class="_richTextNode">. So, today I am revisiting the soup factory problem and using a cornerstone technique of </span><a href="https://sebokwiki.org/wiki/Decision_Management" target="_blank" rel="noopener"><span class="_richTextNode">decision management</span></a><span class="_richTextNode">: running a trade study. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Inspired by the rapid and significant updates to coding agents since my post back in April, I also tried out a different working style that directly contradicted what I had advocated for back then: I gave the agent a little guidance and let it run without much intervention. I am glad I did this, because it helps validate that my previous approach is still what I would recommend. I have some comments on this towards the end of this article. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">This is the first of two posts. This one stops at the static architecture analysis, relying on System Composer and MATLAB. The second post will add implementations in Simulink, Simscape, and Stateflow to those same System Composer architectures with behavioral models, which changes some answers below. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">You can </span><a href="https://github.com/mathworks/system-composer-rflp-reference-example" target="_blank" rel="noopener"><span class="_richTextNode">access the full project I built here</span></a><span class="_richTextNode"> in a standalone repo. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Everything in this post is the study captured at the point in the project where the three architectures existed but no behavior had been modeled yet. The project has moved on since (I’ll share that in the next part of the story). I have deliberately left the baseline numbers as they stood so you can watch how the numbers move across the study. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> Here’s the obligatory AI-generated image: </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> </span><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Trade_Study_part1.m-08-12-26_3.png" width = "367" height = "551" alt = "" style = "vertical-align: baseline; width: 367px; height: 551px;"></img></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>The setup</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The </span><a href="https://github.com/matlab/simulink-agentic-toolkit" target="_blank" rel="noopener"><span class="_richTextNode">Simulink Agentic Toolkit</span></a><span class="_richTextNode"> now includes skills for Model-Based Systems Engineering (MBSE), so unlike my earlier post, I didn’t have to develop my own to build architectures. I did everything in this post using only the skills shipping in the Agentic Toolkit (</span><a href="https://github.com/matlab/simulink-agentic-toolkit/releases/tag/2026.08.05" target="_blank" rel="noopener"><span class="_richTextNode">Release 2026.08.05</span></a><span class="_richTextNode">). </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I started with the same set of stakeholder needs and system requirements as last time: a facility that cooks 8 soup varieties at 200 bowls per hour, ships them across the universe by rocket, runs with at most 5 crew, and fits within budgets for mass, power, cost, and volume. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> </span><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Trade_Study_part1.m-08-12-26_4.png" width = "624" height = "229" alt = "" style = "vertical-align: baseline; width: 624px; height: 229px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">As before, I had the agent use the RFLP methodology to develop the architectures If you don’t recall from the previous post, here’s a reminder on what that methodology looks like:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> </span><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Trade_Study_part1.m-08-12-26_5.png" width = "309" height = "233" alt = "" style = "vertical-align: baseline; width: 309px; height: 233px;"></img></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Three ways to build a soup factory</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Based on the functional and logical architectures and the requirements, I asked the agent to develop 3 physical variants that each notionally optimize a different aspect of the requirement space. Here’s what it came up with:</span></div><table  style = 'margin: 3px; border: 1px solid rgb(191, 191, 191); border-collapse: collapse; '><col/><col/><col/><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Alternative</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Built to maximize</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Design concept</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>HyperCook</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Throughput </span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Four parallel continuous cook lines </span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>LeanBroth</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Resource-budget margin</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Two batch kettles, one prep station, and fewer overall components</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>EverSimmer</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Mission assurance</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Three independent production cells, each a complete prep-cook-quality control-pack chain</span></div></td></tr></table><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> I asked the agent to create a simple diagram of each variant so I can see what it is proposing. It did </span><a href="https://github.com/mathworks/system-composer-rflp-reference-example/blob/main/analysis/reporting/makeVariantSchematics.m" target="_blank" rel="noopener"><span class="_richTextNode">that</span></a><span class="_richTextNode"> very cutely using MATLAB figures. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>HyperCook</span><span class="_richTextNode"> prioritizes throughput with four parallel continuous cook lines.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> </span><a href="https://github.com/sdagen/symmetrical-fiesta/blob/main/blog/images/variant_schematic_hypercook.png" target="_blank" rel="noopener"><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Trade_Study_part1.m-08-12-26_6.png" width = "624" height = "191" alt = "" style = "vertical-align: baseline; width: 624px; height: 191px;"></img></a></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>LeanBroth</span><span class="_richTextNode"> prioritizes budget margin with two batch kettles and one prep station.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><a href="https://github.com/sdagen/symmetrical-fiesta/blob/main/blog/images/variant_schematic_leanbroth.png" target="_blank" rel="noopener"><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Trade_Study_part1.m-08-12-26_7.png" width = "624" height = "191" alt = "" style = "vertical-align: baseline; width: 624px; height: 191px;"></img></a></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>EverSimmer</span><span class="_richTextNode"> prioritizes robustness: three fully independent production cells, each a complete prep-cook-quality control-pack chain. You can still produce soup even if one or two entire cells fail.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> </span><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Trade_Study_part1.m-08-12-26_8.png" width = "624" height = "202" alt = "" style = "vertical-align: baseline; width: 624px; height: 202px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> These all looked like reasonable concepts, which was good enough for my purposes to call them validated. So, I had the agent implement them in System Composer architecture models, including data dictionaries, requirements traceability links, and allocations between the functional, logical, and physical models. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">One implementation decision I want to point out: these are three separate architecture models, not variant components in one model. The variants differ in topology, hierarchy depth, and component count, and each needs its own allocation set. I reused the interface dictionary and stereotype profile across the three architecture models. You can see all of those </span><a href="https://github.com/mathworks/system-composer-rflp-reference-example/tree/main/architecture" target="_blank" rel="noopener"><span class="_richTextNode">here</span></a><span class="_richTextNode">. </span></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Architecture Views</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">As these architectures grew complex, </span><a href = "https://www.mathworks.com/help/systemcomposer/ug/create-custom-views-using-architecture-views-gallery.html"><span class="_richTextNode">architecture views</span></a><span class="_richTextNode"> became especially useful for understanding the design. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Here’s what the HyperCook physical architecture looks like at the top level: </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Trade_Study_part1.m-08-12-26_9.png" width = "857" height = "348" alt = "" style = "vertical-align: baseline; width: 857px; height: 348px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">That’s not totally unmanageable, but there are a lot of crossing connections owing to the fact that every component has a connection to the supervisory controller. Here’s a custom view I made that filters that out: </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Trade_Study_part1.m-08-12-26_10.png" width = "792" height = "265" alt = "" style = "vertical-align: baseline; width: 792px; height: 265px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Now that I had 3 variants, it was time to analyze them.</span></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Analyzing Architectures</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">How do you analyze an architecture? </span><a href = "https://www.mathworks.com/help/systemcomposer/ug/analyze-architecture.html"><span class="_richTextNode">This page</span></a><span class="_richTextNode"> in our documentation explains the basics of architecture analysis. As is described in that page, the agent generally followed this workflow:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Define a profile with a stereotype that describes some properties (ex. cost, mass)</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Apply the profile to the architecture model and add the stereotype to elements of the model (ex. components, interfaces)</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Specify values for the properties on those elements</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Write an analysis function to compute the values needed for the trade study</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://www.mathworks.com/help/systemcomposer/ref/systemcomposer.arch.architecture.instantiate.html"><span class="_richTextNode">Create an instance</span></a><span class="_richTextNode"> of the architecture model. This is a tree of elements that correspond to the model hierarchy.</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Run the analysis function and review the results</span></li></ul><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Next, I’ll walk you through how the agent applied these steps. </span></div><h3  style = 'margin: 15px 10px 5px 4px; padding: 0px; line-height: 20.4px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Make the architectures measurable</span></h3><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">To evaluate these architectures, I need numbers, not just boxes and connections. The best way to do that in System Composer is with </span><a href = "https://www.mathworks.com/help/systemcomposer/ug/customize-model-elements.html"><span class="_richTextNode">stereotypes</span></a><span class="_richTextNode">. A stereotype is a collection of properties that can be applied to design elements such as components and interfaces. Each component in my architectures uses the same stereotype to capture properties like mass, power, cost, throughput capacity, and so on. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I didn’t tell the agent what the properties should be; it came up with those itself.  </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> </span><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Trade_Study_part1.m-08-12-26_11.png" width = "475" height = "410" alt = "" style = "vertical-align: baseline; width: 475px; height: 410px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Here’s the </span><a href = "https://www.mathworks.com/help/systemcomposer/ug/define-architectural-properties-using-system-composer-profiles.html"><span class="_richTextNode">stereotype</span></a><span class="_richTextNode"> applied to a component in one of the physical architectures:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Trade_Study_part1.m-08-12-26_12.png" width = "624" height = "278" alt = "" style = "vertical-align: baseline; width: 624px; height: 278px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The agent also assigned the values for these properties. I’m not an expert in sizing components for fictional production facilities, so I left those values as whatever the agent made them. Since I let my agent go out to the internet, it was able to poke around the web and find some believable numbers. </span></div><h3  style = 'margin: 15px 10px 5px 4px; padding: 0px; line-height: 20.4px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Analysis Functions</span></h3><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The mathematical approach for an analysis function depends on the property being analyzed. This documentation page explains a few analysis constructs: </span><a href = "https://www.mathworks.com/help/systemcomposer/ug/analysis-function-constructs.html"><span class="_richTextNode">Analysis Function Constructs</span></a></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> Here are a few examples from the soup factory:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Mass, power cost: Things that you can add up, usually called a roll-up analysis. The mass of a component is the sum of the mass of its constituents. You can see in the code below that the analysis function for these roll-up properties iterates through the architecture, summing the property values of each leaf of the architecture from the bottom up (hence “roll-up”): </span></li></ul><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >variants = {</span><span style="color: rgb(167, 9, 245);">'HyperCook'</span><span >,</span><span style="color: rgb(167, 9, 245);">'PhysicalHyperCook'</span><span >; </span><span style="color: rgb(167, 9, 245);">'LeanBroth'</span><span >,</span><span style="color: rgb(167, 9, 245);">'PhysicalLeanBroth'</span><span >; </span><span style="color: rgb(167, 9, 245);">'EverSimmer'</span><span >,</span><span style="color: rgb(167, 9, 245);">'PhysicalEverSimmer'</span><span >};</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >results = struct([]);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">for </span><span >v = 1:size(variants, 1)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;vname = variants{v,1};</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;model = systemcomposer.loadModel(variants{v,2});</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;instance = instantiate(model.Architecture, </span><span style="color: rgb(167, 9, 245);">'GalacticSoupProfile'</span><span >, [vname </span><span style="color: rgb(167, 9, 245);">'Analysis'</span><span >]);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;iterate(instance, </span><span style="color: rgb(167, 9, 245);">'PostOrder'</span><span >, @gsRollup);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;r.Variant = vname;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;r.Model = variants{v,2};</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 19);">% Budget sums from top-level children after roll-up</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(14, 0, 255);">for </span><span >pn = {</span><span style="color: rgb(167, 9, 245);">'Mass_kg'</span><span >,</span><span style="color: rgb(167, 9, 245);">'Power_kW'</span><span >,</span><span style="color: rgb(167, 9, 245);">'Cost_kCredits'</span><span >,</span><span style="color: rgb(167, 9, 245);">'Volume_m3'</span><span >,</span><span style="color: rgb(167, 9, 245);">'OperatorsRequired'</span><span >}</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s = 0;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(14, 0, 255);">for </span><span >c = instance.Components</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(14, 0, 255);">if </span><span >c.hasValue([prefix pn{1}])</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s = s + c.getValue([prefix pn{1}]);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;r.(pn{1}) = s;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">function </span><span >gsRollup(instance, varargin)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(0, 128, 19);">%GSROLLUP PostOrder roll-up of additive PhysicalProperties through the hierarchy.</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(0, 128, 19);">%&nbsp;&nbsp;&nbsp;Composites receive the sum of their children for each additive property.</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(0, 128, 19);">%&nbsp;&nbsp;&nbsp;Use with: iterate(instance, 'PostOrder', @gsRollup)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >prefix = </span><span style="color: rgb(167, 9, 245);">'GalacticSoupProfile.PhysicalProperties.'</span><span >;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >additive = {</span><span style="color: rgb(167, 9, 245);">'Mass_kg'</span><span >, </span><span style="color: rgb(167, 9, 245);">'Power_kW'</span><span >, </span><span style="color: rgb(167, 9, 245);">'Cost_kCredits'</span><span >, </span><span style="color: rgb(167, 9, 245);">'Volume_m3'</span><span >, </span><span style="color: rgb(167, 9, 245);">'OperatorsRequired'</span><span >};</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">for </span><span >j = 1:numel(additive)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;prop = [prefix additive{j}];</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(14, 0, 255);">if </span><span >instance.isComponent() &amp;&amp; ~isempty(instance.Components) &amp;&amp; instance.hasValue(prop)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;total = 0;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(14, 0, 255);">for </span><span >child = instance.Components</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(14, 0, 255);">if </span><span >child.hasValue(prop)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;total = total + child.getValue(prop);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;instance.setValue(prop, total);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Things that are limited by a minimum capability: Gravity rating is a minimum; the gravity rating of a system is dictated by the weakest gravity rating of its constituents.</span></li></ul><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 19);">% Leaf-based metrics</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;leaves = gsCollectLeaves(instance);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;gravVals = cellfun(@(L) L.getValue([prefix </span><span style="color: rgb(167, 9, 245);">'GravityRating_g'</span><span >]), leaves);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;r.GravityMin = min(gravVals);</span></span></div></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Throughput is a bottleneck calculation. A production line runs no faster than its slowest stage, and parallel stages add. I used this kind of calculation for the throughput of each variant. (That's a lot more code than you want to see in a snippet, you can find it in </span><a href="https://github.com/mathworks/system-composer-rflp-reference-example/blob/main/analysis/pipeline/runVariantAnalysis.m" target="_blank" rel="noopener"><span class="_richTextNode">runVariantAnalysis.m</span></a><span class="_richTextNode">.)</span></li></ul><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Here’s a summary of the results (each value is followed by the corresponding percentage of the requirement cap that represents): </span></div><table  style = 'margin: 3px; border: 1px solid rgb(191, 191, 191); border-collapse: collapse; '><col/><col/><col/><col/><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Metric</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>HyperCook</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>LeanBroth</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>EverSimmer</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Mass, kg</span><span class="_richTextNode"> </span></div><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Requirement: ≤ 15,000</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">14,320 </span></div><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">(95.5% of requirement cap)</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">7,570 </span></div><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">(50.5%)</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">11,120 </span></div><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">(74.1%)</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Power, kW</span><span class="_richTextNode"> </span></div><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Requirement: ≤ 500</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">498 </span></div><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">(99.6%)</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">239 </span></div><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">(47.8%)</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">363 </span></div><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">(72.6%)</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Cost, kCr</span><span class="_richTextNode"> </span></div><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Requirement: ≤ 2,000</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">1,980 </span></div><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">(99.0%)</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">1,070 </span></div><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">(53.5%)</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">1,905 </span></div><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">(95.3%)</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Throughput, bph,</span><span class="_richTextNode"> </span></div><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Requirement: ≥ 200</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">320 </span></div><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">(+60%)</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">210 </span></div><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">(+5%)</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">240 </span></div><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">(+20%)</span></div></td></tr></table><h3  style = 'margin: 15px 10px 5px 4px; padding: 0px; line-height: 20.4px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; '><span class="_richTextNode"> </span><span class="_richTextNode" style=' font-weight: bold;'>Performing the trade</span></h3><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">All three variants pass the requirements gates, but that was expected since they were derived from the requirements and the agent could easily design it that way. So which is the “best” physical architecture? Time for a trade study! </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">To make this study, I told the agent to use </span><a href="https://en.wikipedia.org/wiki/Multiple-criteria_decision_analysis" target="_blank" rel="noopener"><span class="_richTextNode">Multiple Criteria Decision Analysis</span></a><span class="_richTextNode"> (MCDA) (sometimes called Multiple Objective Decision Analysis, MODA), which is a weighted decision matrix: score each option per criterion, normalize, weight, sum.</span></div><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(0, 128, 19);">% --- Weighting scenarios ---</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >scen.Balanced         = [0.20 0.10 0.15 0.10 0.10 0.15 0.20];</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >scen.ThroughputFirst  = [0.35 0.05 0.15 0.10 0.05 0.15 0.15];</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >scen.CostLean         = [0.10 0.20 0.35 0.05 0.10 0.10 0.10];</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >scen.MissionAssurance = [0.10 0.05 0.10 0.10 0.10 0.25 0.30];</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >scenNames = fieldnames(scen);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >scores = zeros(nV, numel(scenNames));</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">for </span><span >s = 1:numel(scenNames)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;w = scen.(scenNames{s});</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;assert(abs(sum(w) - 1) &lt; 1e-9, </span><span style="color: rgb(167, 9, 245);">'Weights must sum to 1'</span><span >);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;scores(:,s) = norm * w';</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Each criterion is min-max normalized across the three variants, so the best design on any criterion scores 1.0 and the worst scores 0.0. Then four weighting scenarios, each summing to 1, stand in for four stakeholders who would each make this decision differently. These weights are numerical stand-ins for opinions; they are not derived from anything. </span></div><table  style = 'margin: 3px; border: 1px solid rgb(191, 191, 191); border-collapse: collapse; '><col/><col/><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Scenario</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>What it prioritizes</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Balanced</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">No strong preference; throughput and resilience weighted slightly highest</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">ThroughputFirst</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">35% on throughput margin</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">CostLean</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">55% combined on cost and resource margin</span></div></td></tr><tr  style = 'background-color: rgba(0, 0, 0, 0); '><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">MissionAssurance</span></div></td><td  style = 'border: 1px solid rgb(191, 191, 191); vertical-align: top; '><div  style = 'margin: 2px 10px 2px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">55% combined on availability and failure tolerance</span></div></td></tr></table><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Here's how the variants scored on these scenarios: </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> </span><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Trade_Study_part1.m-08-12-26_13.png" width = "711" height = "369" alt = "" style = "vertical-align: baseline; width: 711px; height: 369px;"></img></div><h4  style = 'margin: 10px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 15px; font-weight: 700; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Is this just telling me what I wanted to hear?</span></h4><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Maybe? To find out, I tested the weighting schemes. The four scenarios above are designed by the agent, and that can encode biases and guesses. To test that, I drew 5,000 random weightings and counted how many times each variant won to get a sensitivity analysis over the space of plausible stakeholder priorities. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"> </span><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MBSE_Trade_Study_part1.m-08-12-26_14.png" width = "620" height = "286" alt = "" style = "vertical-align: baseline; width: 620px; height: 286px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">EverSimmer wins in three of four hand-picked scenarios and 85% of the Monte Carlo stakeholder priorities. So based on these study results, it seems that EverSimmer has strength as a design choice. </span></div><h3  style = 'margin: 15px 10px 5px 4px; padding: 0px; line-height: 20.4px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>What this study does not tell you</span></h3><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">An analysis is only as good as its stated limits, so here are the ones I would raise first in a review:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode" style=' font-weight: bold;'>These are point estimates, not distributions.</span><span class="_richTextNode"> At this early stage of design, the parameter values should have some range associated with them, which would give us distributions.</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode" style=' font-weight: bold;'>Normalization of the criteria is relative to this set of three.</span><span class="_richTextNode"> These scores compare HyperCook, LeanBroth, and EverSimmer to each other and mean nothing outside that comparison.</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode" style=' font-weight: bold;'>Nothing here has actually simulated.</span><span class="_richTextNode"> Every number above is a claim on a spec sheet. The roll-up assumes soup flows through the factory with zero losses and nothing ever breaks.</span></li></ul><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Working with the agent, this time</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">My April post described a propose-approve-generate-run-confirm loop, with me in the middle of every step. That is not how this project went. With the current generation of agent I described outcomes, and it worked in long autonomous stretches: building models, running simulations, writing and executing its own tests, farming documentation to sub-agents, and committing when things passed. My involvement moved up a level, from approving steps to reviewing artifacts, specifying analysis approaches, and pivoting focus based on my engineering judgment.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">That all sounds nice, and it was certainly fun to launch a small army of agents and see work get done so quickly. But this was not painless. The agents produced such a large volume of material so quickly, models, code, documents, etc., that I occasionally felt overwhelmed trying to maintain my orientation and ownership of all of it. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The most important lessons from that mode of working:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Make it write everything down.</span><span class="_richTextNode"> The decision logs were crucial for remembering and understanding what I asked the agent to do and why. This project grew quickly, and I would have had to start over many times without those documents. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Have the agent work in chunks YOU can manage.</span><span class="_richTextNode"> The agent, and especially with a cohort of subagents, can churn out huge volumes of material; it doesn’t matter to them. Make it plan and execute in batches that you and your team can handle reviewing. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Stay in the loop at every stage.</span><span class="_richTextNode"> It’s so tempting to give a little direction and then walk away, but this is not the way to do engineering. </span></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode" style=' font-weight: bold;'>Now it's your turn</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The whole project is on GitHub as a runnable reference example: models, requirements, analysis, tests, and the documentation set. You can open the project and </span><a href="https://github.com/mathworks/system-composer-rflp-reference-example/blob/main/GuidedTour.m" target="_blank" rel="noopener"><span class="_richTextNode">open this guided tour</span></a><span class="_richTextNode">.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">As I flagged at the top, that gives you the current numbers rather than the baseline ones in this post. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I hope you come back for the next installment when we will add in some dynamics!</span></div>
<br>
</div><script type="text/javascript">
{ let css = '._richTextNode {white-space: break-spaces;}';
let head = document.head || document.getElementsByTagName('head')[0];
let style = document.createElement('style');
head.appendChild(style);
style.type = 'text/css';
if (style.styleSheet) {
    style.styleSheet.cssText = css;
} else {
    style.appendChild(document.createTextNode(css));
}


}</script>]]></content:encoded>
					
					<wfw:commentRss>https://blogs.mathworks.com/simulink/2026/08/12/trade-studies-with-agentic-ai-powered-mbse/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Building and Controlling a Gantry Crane with Simulink, Simscape Multibody, and Codex</title>
		<link>https://blogs.mathworks.com/simulink/2026/08/06/building-and-controlling-a-gantry-crane-with-simulink-simscape-multibody-and-codex/?s_tid=feedtopost</link>
					<comments>https://blogs.mathworks.com/simulink/2026/08/06/building-and-controlling-a-gantry-crane-with-simulink-simscape-multibody-and-codex/#comments</comments>
		
		<dc:creator><![CDATA[Guy Rouleau]]></dc:creator>
		<pubDate>Thu, 06 Aug 2026 19:53:14 +0000</pubDate>
				<category><![CDATA[AI Coding Assistant]]></category>
		<category><![CDATA[Controls]]></category>
		<category><![CDATA[Modeling]]></category>
		<category><![CDATA[Codex]]></category>
		<guid isPermaLink="false">https://blogs.mathworks.com/simulink/?p=18812</guid>

					<description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/simulink/files/crane.m-08-06-26_13.gif" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><p>A few days ago, my colleague Ned Gulley published this blog post: Simulate in MATLAB, Animate in Blender.Ned simulated a sliding gantry crane supporting a heavy swinging load and then controlled it... <a class="read-more" href="https://blogs.mathworks.com/simulink/2026/08/06/building-and-controlling-a-gantry-crane-with-simulink-simscape-multibody-and-codex/">read more >></a></p>]]></description>
										<content:encoded><![CDATA[<div class = rtcContent><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><a href = "https://matlab.mathworks.com/open/github/v1?repo=simulink/blog&amp;project=2026_08_06_crane/crane.prj"><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/crane.m-08-06-26_1.png" width = "136" height = "21" alt = "" style = "vertical-align: baseline; width: 136px; height: 21px;"></img></a></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">A few days ago, my colleague Ned Gulley published this blog post: </span><a href = "https://blogs.mathworks.com/community/2026/07/31/simulate-in-matlab-animate-in-blender/"><span class="_richTextNode">Simulate in MATLAB, Animate in Blender</span></a><span class="_richTextNode">.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Ned simulated a sliding gantry crane supporting a heavy swinging load and then controlled it to swing the load above a wall. Here is what the final result looks like:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/crane.m-08-06-26_2.gif" width = "737" height = "247" alt = "" style = "vertical-align: baseline; width: 737px; height: 247px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In his post, Ned did not include the code, but he mentions that he implemented the simulation and animation workflow in MATLAB. My first reaction was:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-style: italic;'>Why implement that in MATLAB when we have Simscape Multibody?</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I launched </span><a href = "https://chatgpt.com/codex/"><span class="_richTextNode">Codex</span></a><span class="_richTextNode">, connected it to MATLAB through the </span><a href = "https://github.com/matlab/simulink-agentic-toolkit"><span class="_richTextNode">Simulink Agentic Toolkit</span></a><span class="_richTextNode"> and asked it to review Ned's post and implement something similar, but using Simulink and Simscape Multibody.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I will use this story to highlight:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">The importance of planning and how the initial plan can influence implementation choices in Simulink</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Different ways the Simulink Agentic Toolkit can implement the same control logic</span></li></ul><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">You can download the final result from my GitHub repository: </span><a href = "https://github.com/simulink/blog/tree/main/2026_08_06_crane/CraneProject"><span class="_richTextNode">blog/2026_08_06_crane/CraneProject at main · simulink/blog</span></a></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">The Plan</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">After reading the post, Codex used the </span><a href = "https://github.com/matlab/simulink-agentic-toolkit/tree/main/skills-catalog/model-based-design-core/specifying-plant-models"><span class="_richTextNode">specifying-plant-models</span></a><span class="_richTextNode"> skill from the Simulink Agentic Toolkit to plan how it was going to address this challenge. You can find those files </span><a href = "https://github.com/simulink/blog/tree/main/2026_08_06_crane/CraneProject/docs/specs/plant-models/gantry-crane-sm"><span class="_richTextNode">here</span></a><span class="_richTextNode">. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">It defined a set of goals:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/crane.m-08-06-26_3.png" width = "655" height = "236" alt = "" style = "vertical-align: baseline; width: 655px; height: 236px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">and divided the work into five phases:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/crane.m-08-06-26_4.png" width = "589" height = "272" alt = "" style = "vertical-align: baseline; width: 589px; height: 272px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Compared to other projects where I have used this skill, the proposed plan was relatively light (which makes sense for this relatively straightforward goal). I decided to leave it as is and begin the implementation.</span></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">The Plant Model</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Here is what the model looked like after phase 2. Note that I manually moved and resized a few blocks to get a better screenshot for this blog. I am very picky about Simulink model layout.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/crane.m-08-06-26_5.png" width = "955" height = "446" alt = "" style = "vertical-align: baseline; width: 955px; height: 446px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Applying a constant force on the base, I could use the </span><a href = "https://www.mathworks.com/help/sm/ref/multibodyexplorer.html"><span class="_richTextNode">Multibody Explorer</span></a><span class="_richTextNode"> to confirm that it moves the way I expect.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/crane.m-08-06-26_6.gif" width = "440" height = "346" alt = "" style = "vertical-align: baseline; width: 440px; height: 346px;"></img></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Control Design</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">If you look in the </span><a href = "https://github.com/simulink/blog/tree/main/2026_08_06_crane/CraneProject/scripts"><span class="_richTextNode" style=' font-family: monospace;'>scripts</span></a><span class="_richTextNode"> folder in my project, you will find a series of scripts that Codex used to design the maneuver to pump energy into the payload swing.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/crane.m-08-06-26_7.png" width = "300" height = "208" alt = "" style = "vertical-align: baseline; width: 300px; height: 208px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Here is what the code designing the LQR controller looks like:</span></div><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">function </span><span >K = designLQRCatchController(p)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(0, 128, 19);">%DESIGNLQRCATCHCONTROLLER LQR gain for the small-angle crane model.</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">if </span><span >nargin == 0</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;p = craneParameters();</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >M = p.trolleyMass;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >m = p.payloadMass;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >L = p.pendulumLength;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >g = p.gravity;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(0, 128, 19);">% State vector: [x; xdot; theta; thetaDot]. theta is measured from vertical.</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >A = [0 1 0 0; </span><span style="color: rgb(14, 0, 255);">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 0 -(m*g)/M 0; </span><span style="color: rgb(14, 0, 255);">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 0 0 1; </span><span style="color: rgb(14, 0, 255);">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 0 ((M+m)*g)/(M*L) 0];</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >B = [0; 1/M; 0; -1/(M*L)];</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >K = lqr(A, B, p.lqrQ, p.lqrR);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">If you're interested in more details, see </span><a href = "https://github.com/simulink/blog/blob/main/2026_08_06_crane/CraneProject/docs/crane-controller-design-blog.md"><span class="_richTextNode">crane-controller-design-blog.md</span></a><span class="_richTextNode">. Once the design was complete, I asked Codex to write a report explaining how it implemented the control logic and what each generated file does.</span></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Controller Implementation</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">This is where this gets interesting.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">If you look at the implementation plan generated by Codex, there are not many details on how the controller would be implemented. Since I did not make specific requests, it made decisions that are different than what I would have chosen. Let's go through a few iterations I went through.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The first version of the controller implemented by Codex looked like this:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/crane.m-08-06-26_8.png" width = "807" height = "374" alt = "" style = "vertical-align: baseline; width: 807px; height: 374px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In that version, the Stateflow chart managed the phases of the maneuver, and a MATLAB Function block implemented the control equations.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/crane.m-08-06-26_9.png" width = "277" height = "359" alt = "" style = "vertical-align: baseline; width: 277px; height: 359px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">While this is not fundamentally wrong, I usually prefer using Simulink math blocks when possible. I asked Codex to re-implement the Controller Force Law block into a Subsystem with basic math blocks. Here is what I got:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/crane.m-08-06-26_10.png" width = "600" height = "460" alt = "" style = "vertical-align: baseline; width: 600px; height: 460px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Not exactly what I was hoping for either, but once again, I had not given it very clear instructions of what I wanted. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I took the time to explain in detail that I wanted it to implement the control equations for each control mode using </span><a href = "https://www.mathworks.com/help/stateflow/ug/about-simulink-states.html"><span class="_richTextNode">Simulink subsystems as states</span></a><span class="_richTextNode"> in the Stateflow chart. This time it did a great job and produced exactly what I wanted.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode"></span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/crane.m-08-06-26_11.png" width = "681" height = "366" alt = "" style = "vertical-align: baseline; width: 681px; height: 366px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">With those changes, the whole controller is now implemented in Stateflow:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/crane.m-08-06-26_12.png" width = "523" height = "272" alt = "" style = "vertical-align: baseline; width: 523px; height: 272px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Here is the final maneuver:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/crane.m-08-06-26_13.gif" width = "726" height = "376" alt = "" style = "vertical-align: baseline; width: 726px; height: 376px;"></img></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Conclusion</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">With this story, I want to highlight a few things:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Planning is important. The more detailed and explicit your plan is, the more likely the final implementation is to match what you have in mind. You will also probably save time and token costs.</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">The Simulink Agentic Toolkit can implement algorithms in Simulink in many ways. With this example, it implemented the same control logic using a MATLAB Function block, two different styles of subsystems and a Stateflow chart.</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">If something is important to you, specify it to the agent explicitly. When there is more than one way to implement an algorithm, the agent needs to pick one, and it will not necessarily be the one you have in mind.</span></li></ul><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Now it's your turn</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Where are you in your adoption of agentic workflows with Simulink? What challenges are you facing?</span></div>
<br>
</div><script type="text/javascript">
{ let css = '._richTextNode {white-space: break-spaces;}';
let head = document.head || document.getElementsByTagName('head')[0];
let style = document.createElement('style');
head.appendChild(style);
style.type = 'text/css';
if (style.styleSheet) {
    style.styleSheet.cssText = css;
} else {
    style.appendChild(document.createTextNode(css));
}


}</script>]]></content:encoded>
					
					<wfw:commentRss>https://blogs.mathworks.com/simulink/2026/08/06/building-and-controlling-a-gantry-crane-with-simulink-simscape-multibody-and-codex/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>My Scuba Diving Simulator &#8211; Part 2</title>
		<link>https://blogs.mathworks.com/simulink/2026/07/16/my-scuba-diving-simulator-part-2/?s_tid=feedtopost</link>
					<comments>https://blogs.mathworks.com/simulink/2026/07/16/my-scuba-diving-simulator-part-2/#respond</comments>
		
		<dc:creator><![CDATA[Guy Rouleau]]></dc:creator>
		<pubDate>Thu, 16 Jul 2026 14:12:47 +0000</pubDate>
				<category><![CDATA[AI Coding Assistant]]></category>
		<category><![CDATA[Controls]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[Model-Based Design]]></category>
		<category><![CDATA[scuba]]></category>
		<guid isPermaLink="false">https://blogs.mathworks.com/simulink/?p=18736</guid>

					<description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/simulink/files/scuba_part_2.m-07-16-26_2.gif" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><p>In my previous post, I modeled a scuba diver using custom Simscape components. I was happy with the components and the overall plant model, but I was not fully satisfied.Each component behaved as... <a class="read-more" href="https://blogs.mathworks.com/simulink/2026/07/16/my-scuba-diving-simulator-part-2/">read more >></a></p>]]></description>
										<content:encoded><![CDATA[<div class = rtcContent><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><a href = "https://matlab.mathworks.com/open/github/v1?repo=simulink/blog&amp;project=2026_07_15_scuba_part_2/scuba_part_2.prj"><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/scuba_part_2.m-07-16-26_1.png" width = "136" height = "21" alt = "" style = "vertical-align: baseline; width: 136px; height: 21px;"></img></a></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In my </span><a href = "https://blogs.mathworks.com/simulink/2026/07/02/my-scuba-diving-simulator/"><span class="_richTextNode">previous post</span></a><span class="_richTextNode">, I modeled a scuba diver using custom Simscape components. I was happy with the components and the overall plant model, but I was not fully satisfied.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Each component behaved as expected, and the assembled diver system handled simple maneuvers correctly. However, I had not figured out yet how to control the buoyancy control device (BCD) and breathing together like real divers do during a full one-hour dive.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In this post, I describe what happened when I asked an AI coding agent to design that controller for a full dive profile like this one:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/scuba_part_2.m-07-16-26_2.gif" width = "800" height = "300" alt = "" style = "vertical-align: baseline; width: 800px; height: 300px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-style: italic;'>(Similarities with</span><span class="_richTextNode"> </span><a href = "https://store.steampowered.com/app/1868140/DAVE_THE_DIVER/"><span class="_richTextNode">Dave the Diver</span></a><span class="_richTextNode"> </span><span class="_richTextNode" style=' font-style: italic;'>are just a coincidence)</span></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">The Plan</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I asked:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-style: italic;'>The project currently open in MATLAB is a scuba diving simulator. Model fullDiveHarness includes the simulation of the diver, but not a controller. Your task is to design a controller. Design a trajectory for a typical 1 hour dive profile. The controller has access to the following signals: diver depth and velocity, and the volume of air in the BCD. The controller needs to generate 3 signals: Inflate BCD (0-1), Deflate BCD (0-1) and lung volume (m^3). Do some internet research to understand how divers typically control their buoyancy and depth and propose a plan for the controller logic and how it will be implemented in Simulink.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">It asked me a few clarification questions and proposed a plan: </span><a href = "https://github.com/simulink/blog/blob/main/scuba_part2/docs/dive_controller_plan.md"><span class="_richTextNode">dive_controller_plan.md</span></a></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Before touching the model, it analyzed the buoyancy math already in the project. It's important because this knowledge of the system enabled it to design a feedforward component to the controller.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/scuba_part_2.m-07-16-26_3.png" width = "841" height = "517" alt = "" style = "vertical-align: baseline; width: 841px; height: 517px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">It also summarized how divers typically control buoyancy in practice.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/scuba_part_2.m-07-16-26_4.png" width = "788" height = "147" alt = "" style = "vertical-align: baseline; width: 788px; height: 147px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">It described the controller logic:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/scuba_part_2.m-07-16-26_5.png" width = "853" height = "596" alt = "" style = "vertical-align: baseline; width: 853px; height: 596px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In the end, it described how it would verify the controller.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/scuba_part_2.m-07-16-26_6.png" width = "819" height = "223" alt = "" style = "vertical-align: baseline; width: 819px; height: 223px;"></img></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">The Model</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The agent added the trajectory generator and controller to the model and enabled signal logging for the signals needed for verification.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/scuba_part_2.m-07-16-26_7.png" width = "832" height = "352" alt = "" style = "vertical-align: baseline; width: 832px; height: 352px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Inside the controller, we can see the feedforward path and the PD controller that makes the diver breathe slightly more deeply or shallowly to control its depth. I manually tweaked the layout a little to make it look the way I like.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/scuba_part_2.m-07-16-26_8.png" width = "815" height = "404" alt = "" style = "vertical-align: baseline; width: 815px; height: 404px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In the initial version, the BCD valve allocation was implemented using a MATLAB Function block. I asked it to re-implement the same logic using a Stateflow chart. I find it much easier to understand at first look this type of algorithm in Stateflow than with MATLAB code.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/scuba_part_2.m-07-16-26_9.png" width = "1015" height = "454" alt = "" style = "vertical-align: baseline; width: 1015px; height: 454px;"></img></div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">The Results</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Let's simulate the final model and see what the results look like.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >initDiveController;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >mdl = </span><span style="color: rgb(167, 9, 245);">'fullDiveHarness'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >in = Simulink.SimulationInput(mdl);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >out = sim(in, </span><span style="color: rgb(167, 9, 245);">'ShowProgress'</span><span >, </span><span style="color: rgb(167, 9, 245);">'off'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '>&nbsp;</div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >depth   = out.logsout.get(</span><span style="color: rgb(167, 9, 245);">'depth'</span><span >).Values;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >ref     = out.logsout.get(</span><span style="color: rgb(167, 9, 245);">'depth_ref'</span><span >).Values;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >Vbcd    = out.logsout.get(</span><span style="color: rgb(167, 9, 245);">'Vbcd'</span><span >).Values;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >inflate = out.logsout.get(</span><span style="color: rgb(167, 9, 245);">'inflate'</span><span >).Values;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >deflate = out.logsout.get(</span><span style="color: rgb(167, 9, 245);">'deflate'</span><span >).Values;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >Vlung   = out.logsout.get(</span><span style="color: rgb(167, 9, 245);">'V_lung'</span><span >).Values;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >TankPressure = out.logsout.get(</span><span style="color: rgb(167, 9, 245);">'Tank Pressure'</span><span >).Values;</span></span></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">We can see that the diver follows the desired depth very well.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >figure(</span><span style="color: rgb(167, 9, 245);">'Name'</span><span >, </span><span style="color: rgb(167, 9, 245);">'Full Dive Results'</span><span >, </span><span style="color: rgb(167, 9, 245);">'NumberTitle'</span><span >, </span><span style="color: rgb(167, 9, 245);">'off'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >plot(ref.Time/60, ref.Data, </span><span style="color: rgb(167, 9, 245);">'--'</span><span >, depth.Time/60, depth.Data)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >set(gca, </span><span style="color: rgb(167, 9, 245);">'YDir'</span><span >, </span><span style="color: rgb(167, 9, 245);">'reverse'</span><span >)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >title(</span><span style="color: rgb(167, 9, 245);">'Depth profile'</span><span >)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >ylabel(</span><span style="color: rgb(167, 9, 245);">'Depth (m)'</span><span >)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >legend(</span><span style="color: rgb(167, 9, 245);">'reference'</span><span >, </span><span style="color: rgb(167, 9, 245);">'actual'</span><span >, </span><span style="color: rgb(167, 9, 245);">'Location'</span><span >, </span><span style="color: rgb(167, 9, 245);">'southeast'</span><span >)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >grid </span><span style="color: rgb(167, 9, 245);">on</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >title(</span><span style="color: rgb(167, 9, 245);">'1-hour dive: 18 m \rightarrow 12 m \rightarrow 5 m safety stop \rightarrow surface'</span><span >)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(230, 230, 230) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsFigure" uid="7E739D0D" prevent-scroll="true" data-testid="output_0" tabindex="-1" ><div class="outputLayer selectedOutputDecorationLayer doNotExport" aria-hidden="true"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport" aria-hidden="true"></div><div class="outputLayer navigationFocusLayer doNotExport" aria-hidden="false" role="application" tabindex="-1"></div><div class="outputLayer activeOutputDecorationLayer doNotExport" aria-hidden="false" role="application"></div><div class="figureElement eoOutputContent" role="article" aria-roledescription="Use Browse Mode to explore " aria-description="figure output "><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/simulink/files/scuba_part_2.m-07-16-26_10.png" style="width: 560px;"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The BCD controls are used only for depth changes or to correct excessive drift. That matches what I typically do while diving.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >figure</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >tiledlayout(2, 1, </span><span style="color: rgb(167, 9, 245);">'TileSpacing'</span><span >, </span><span style="color: rgb(167, 9, 245);">'compact'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >nexttile;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >plot(Vbcd.Time/60, Vbcd.Data*1e3, </span><span style="color: rgb(167, 9, 245);">'LineWidth'</span><span >, 1.5);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >title(</span><span style="color: rgb(167, 9, 245);">'BCD Volume'</span><span >)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >ylabel(</span><span style="color: rgb(167, 9, 245);">'V_{BCD} (L)'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >grid </span><span style="color: rgb(167, 9, 245);">on</span><span >;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >nexttile;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >plot(inflate.Time/60, inflate.Data, deflate.Time/60, deflate.Data)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >title(</span><span style="color: rgb(167, 9, 245);">'BCD Commands'</span><span >)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >ylabel(</span><span style="color: rgb(167, 9, 245);">'Valve cmd (0-1)'</span><span >)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >legend(</span><span style="color: rgb(167, 9, 245);">'inflate'</span><span >, </span><span style="color: rgb(167, 9, 245);">'deflate'</span><span >, </span><span style="color: rgb(167, 9, 245);">'Location'</span><span >, </span><span style="color: rgb(167, 9, 245);">'northeast'</span><span >)</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >grid </span><span style="color: rgb(167, 9, 245);">on</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(230, 230, 230) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsFigure" uid="BB2F553B" prevent-scroll="true" data-testid="output_1" tabindex="-1" ><div class="outputLayer selectedOutputDecorationLayer doNotExport" aria-hidden="true"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport" aria-hidden="true"></div><div class="outputLayer navigationFocusLayer doNotExport" aria-hidden="false" role="application" tabindex="-1"></div><div class="outputLayer activeOutputDecorationLayer doNotExport" aria-hidden="false" role="application"></div><div class="figureElement eoOutputContent" role="article" aria-roledescription="Use Browse Mode to explore " aria-description="figure output "><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/simulink/files/scuba_part_2.m-07-16-26_11.png" style="width: 560px;"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">As the tank empties, it slowly becomes lighter, so the diver adjusts its breathing to compensate.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >figure</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >plot(Vlung.Time/60, Vlung.Data*1e3)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >title(</span><span style="color: rgb(167, 9, 245);">'Breathing'</span><span >)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >ylabel(</span><span style="color: rgb(167, 9, 245);">'V_{lung} (L)'</span><span >)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >xlabel(</span><span style="color: rgb(167, 9, 245);">'Time (min)'</span><span >)</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >grid </span><span style="color: rgb(167, 9, 245);">on</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(230, 230, 230) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsFigure" uid="55859FAE" prevent-scroll="true" data-testid="output_2" tabindex="-1" ><div class="outputLayer selectedOutputDecorationLayer doNotExport" aria-hidden="true"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport" aria-hidden="true"></div><div class="outputLayer navigationFocusLayer doNotExport" aria-hidden="false" role="application" tabindex="-1"></div><div class="outputLayer activeOutputDecorationLayer doNotExport" aria-hidden="false" role="application"></div><div class="figureElement eoOutputContent" role="article" aria-roledescription="Use Browse Mode to explore " aria-description="figure output "><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/simulink/files/scuba_part_2.m-07-16-26_12.png" style="width: 560px;"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Finally, we can check the tank pressure and confirm that the air consumption is within the normal range for this type of dive.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >figure</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >plot(TankPressure.Time/60, TankPressure.Data)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >title(</span><span style="color: rgb(167, 9, 245);">'Tank Pressure'</span><span >)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >ylabel(</span><span style="color: rgb(167, 9, 245);">'Tank Pressure (PSI)'</span><span >)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >xlabel(</span><span style="color: rgb(167, 9, 245);">'Time (min)'</span><span >)</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >grid </span><span style="color: rgb(167, 9, 245);">on</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(230, 230, 230) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsFigure" uid="9D812B65" prevent-scroll="true" data-testid="output_3" tabindex="-1" ><div class="outputLayer selectedOutputDecorationLayer doNotExport" aria-hidden="true"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport" aria-hidden="true"></div><div class="outputLayer navigationFocusLayer doNotExport" aria-hidden="false" role="application" tabindex="-1"></div><div class="outputLayer activeOutputDecorationLayer doNotExport" aria-hidden="false" role="application"></div><div class="figureElement eoOutputContent" role="article" aria-roledescription="Use Browse Mode to explore " aria-description="figure output "><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/simulink/files/scuba_part_2.m-07-16-26_13.png" style="width: 560px;"></div></div></div></div></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Conclusion</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In the end, the agent did not only implement a controller in Simulink. It helped me close the loop on a modeling problem where I did not already know the answer.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In my experimentation with AI coding agents, so far I had mostly used them for tasks that I already knew how to do. I described the agent exactly what I wanted and it was good at executing faster than I could have. In this case, I decided to push the limits with a problem I did not know how to solve. It came up with something that worked. Because it implemented it in Simulink and Stateflow, it was very easy for me to review and understand what the agent had implemented and why it worked.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">If something was not clear, I was able to ask for clarification. For example, here is the answer I got when I asked "</span><span class="_richTextNode" style=' font-style: italic;'>Why do we need the desired velocity in addition to the desired depth profile</span><span class="_richTextNode">"</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/scuba_part_2.m-07-16-26_14.png" width = "896" height = "410" alt = "" style = "vertical-align: baseline; width: 896px; height: 410px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Especially this last paragraph, after reading it I thought "yes, that's what I do".</span></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Now it's your turn</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">You can download the latest version of the project here: </span><a href = "https://github.com/mathworks/Scuba-Simulator"><span class="_richTextNode">https://github.com/mathworks/Scuba-Simulator</span></a><span class="_richTextNode"> or open it in MATLAB Online by clicking this badge:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><a href = "https://matlab.mathworks.com/open/github/v1?repo=guirlo/scuba-simulator&amp;project=scuba-buyancy.prj"><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/scuba_part_2.m-07-16-26_1.png" width = "136" height = "21" alt = "" style = "vertical-align: baseline; width: 136px; height: 21px;"></img></a></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Use this code to simulate the full dive profile:</span></div><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >t = testFullDive;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >t.runSimulation;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >t.plotResults;</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Have fun trying different virtual dive profiles and breathing rates to plan your next dives.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '></div>
<br>
</div><script type="text/javascript">
{ let css = '._richTextNode {white-space: break-spaces;}';
let head = document.head || document.getElementsByTagName('head')[0];
let style = document.createElement('style');
head.appendChild(style);
style.type = 'text/css';
if (style.styleSheet) {
    style.styleSheet.cssText = css;
} else {
    style.appendChild(document.createTextNode(css));
}


}</script>]]></content:encoded>
					
					<wfw:commentRss>https://blogs.mathworks.com/simulink/2026/07/16/my-scuba-diving-simulator-part-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>My Scuba Diving Simulator</title>
		<link>https://blogs.mathworks.com/simulink/2026/07/02/my-scuba-diving-simulator/?s_tid=feedtopost</link>
					<comments>https://blogs.mathworks.com/simulink/2026/07/02/my-scuba-diving-simulator/#comments</comments>
		
		<dc:creator><![CDATA[Guy Rouleau]]></dc:creator>
		<pubDate>Thu, 02 Jul 2026 20:00:49 +0000</pubDate>
				<category><![CDATA[AI Coding Assistant]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[Modeling]]></category>
		<category><![CDATA[Claude Code]]></category>
		<category><![CDATA[scuba]]></category>
		<category><![CDATA[Simscape]]></category>
		<guid isPermaLink="false">https://blogs.mathworks.com/simulink/?p=18718</guid>

					<description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/simulink/files/ScubaSimulator.m-07-02-26_5-1.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><p>I recently took a week of vacation to go scuba diving in the Caribbean. In the middle of a dive, at about 80 feet down, this idea came to my mind: I need to make a scuba diving simulator!I have... <a class="read-more" href="https://blogs.mathworks.com/simulink/2026/07/02/my-scuba-diving-simulator/">read more >></a></p>]]></description>
										<content:encoded><![CDATA[<div class = rtcContent><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><a href = "https://matlab.mathworks.com/open/github/v1?repo=simulink/blog&amp;project=2026_06_20_scuba/ScubaSimulator.prj"><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/ScubaSimulator.m-07-02-26_1-1.png" width = "136" height = "21" alt = "" style = "vertical-align: baseline; width: 136px; height: 21px;"></img></a></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I recently took a week of vacation to go scuba diving in the Caribbean. In the middle of a dive, at about 80 feet down, this idea came to my mind: </span><span class="_richTextNode" style=' font-weight: bold;'>I need to make a scuba diving simulator!</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I have thought about creating this simulation before, but I always ended up struggling with one thing or another. Typically, I would get stuck when trying to add the effect of depth on the diver's lungs and the </span><a href = "https://en.wikipedia.org/wiki/Buoyancy_compensator_(diving)"><span class="_richTextNode">buoyancy control device (BCD)</span></a><span class="_richTextNode">.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Today, with an AI agent and the </span><a href = "https://www.mathworks.com/products/simulink-agentic-toolkit.html"><span class="_richTextNode">Simulink Agentic Toolkit</span></a><span class="_richTextNode">, I thought it was time to give this another try.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/ScubaSimulator.m-07-02-26_2-1.png" width = "338" height = "296" alt = "" style = "vertical-align: baseline; width: 338px; height: 296px;"></img></div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">The Plan</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Everyone who has worked with AI agents will tell you: The planning part is very important!</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I thought for some time about what I wanted this simulator to include and how I wanted it to be implemented. Once the picture was clear in my mind, I wrote my requirements:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">I want to simulate a typical hour-long scuba dive profile</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">It should model air consumption during the dive</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">It needs to model the diver's buoyancy throughout the dive</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">The diver's buoyancy should be controlled by the diver's breathing and the buoyancy control device (BCD)</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">The mechanical part of the simulation should use the </span><a href = "https://www.mathworks.com/help/simscape/lang/position-based-mechanical-translational-domain.html"><span class="_richTextNode">Simscape 1D position-based translational domain</span></a></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">The gas part should be implemented using a simple custom gas domain with constant temperature approximation</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">The depth information computed in the mechanical domain will be passed to the custom gas components that need it through a translational mechanical connection port</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">The depth control logic should be implemented in Simulink and Stateflow</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Three control signals should be sent to the plant model: BCD inflate valve, BCD release valve and diver breathing effort</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">The plant model should include the following individual Simscape components: Gas tank, first-stage regulator, BCD with intake and release valves, second stage regulator with intake and release valves.</span></li></ul><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Based on those requirements, the Simulink Agentic Toolkit invoked multiple sub agents to fetch relevant information from many reliable sources. Here are some examples:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/ScubaSimulator.m-07-02-26_3-1.png" width = "959" height = "187" alt = "" style = "vertical-align: baseline; width: 959px; height: 187px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/ScubaSimulator.m-07-02-26_4-1.png" width = "941" height = "147" alt = "" style = "vertical-align: baseline; width: 941px; height: 147px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In the end, it created 4 plan files</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://github.com/simulink/blog/blob/main/scuba_simulator/docs/specs/plant-models/scuba-diver/scuba-diver-system.md"><span class="_richTextNode">scuba-diver-system.md</span></a><span class="_richTextNode" style=' font-weight: bold;'>:</span><span class="_richTextNode"> A high-level description of the system, with executive summary, objectives, and success criteria.</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://github.com/simulink/blog/blob/main/scuba_simulator/docs/specs/plant-models/scuba-diver/scuba-diver-architecture.md"><span class="_richTextNode">scuba-diver-architecture.md</span></a><span class="_richTextNode" style=' font-weight: bold;'>:</span><span class="_richTextNode"> We are going into more details, listing the individual components, their interface, and their equations.</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://github.com/simulink/blog/blob/main/scuba_simulator/docs/specs/plant-models/scuba-diver/scuba-diver-implementation-plan.md"><span class="_richTextNode">scuba-diver-implementation-plan.md</span></a><span class="_richTextNode" style=' font-weight: bold;'>:</span><span class="_richTextNode"> This went into implementation of the full simulation, including controllers for dive profile scenarios, breathing waveform and BCD controller</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://github.com/simulink/blog/blob/main/scuba_simulator/docs/specs/plant-models/scuba-diver/scuba-diver-test-plan.md"><span class="_richTextNode">scuba-diver-test-plan.md</span></a><span class="_richTextNode" style=' font-weight: bold;'>:</span><span class="_richTextNode"> How all this will be tested.</span></li></ul><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">The Simscape Scuba Library</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The first implementation step I went through is the Simscape library development. The agent was pretty good at generating the components I wanted. Here is what the components look like in my library: </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/ScubaSimulator.m-07-02-26_5-1.png" width = "680" height = "366" alt = "" style = "vertical-align: baseline; width: 680px; height: 366px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The underwater gas domain definition code is:</span></div><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >domain </span><span style="color: rgb(167, 9, 245);">underwaterGas</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(0, 128, 19);">% Custom gas domain for scuba simulation.</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(0, 128, 19);">% Across variable: pressure (Pa)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(0, 128, 19);">% Through variable: molar flow rate (mol/s)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;parameters</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;R_gas = {8.314, </span><span style="color: rgb(167, 9, 245);">'J/(mol*K)'</span><span >};  </span><span style="color: rgb(0, 128, 19);">% Universal gas constant</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;T     = {293.15, </span><span style="color: rgb(167, 9, 245);">'K'</span><span >};         </span><span style="color: rgb(0, 128, 19);">% Gas temperature (isothermal)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;variables(Balancing = true)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;n_dot = {0, </span><span style="color: rgb(167, 9, 245);">'mol/s'</span><span >};          </span><span style="color: rgb(0, 128, 19);">% Molar flow rate (through)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;variables</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p     = {101325, </span><span style="color: rgb(167, 9, 245);">'Pa'</span><span >};        </span><span style="color: rgb(0, 128, 19);">% Pressure (across)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">For a component like the diver </span><a href = "https://github.com/simulink/blog/blob/main/scuba_simulator/%2Bscuba/%2Bgas/%2Belements/Lungs.ssc"><span class="_richTextNode">lungs</span></a><span class="_richTextNode">, the ideal gas law is used to compute the lungs volume at the current depth, and the Archimedes principle to compute the buoyancy force: </span></div><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;intermediates</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;R_gas  = A.R_gas;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;T      = A.T;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;depth  = R.x;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;P_amb  = P_atm + rho_water * R.gravity * depth;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F_buoy = rho_water * R.gravity * V_lungs;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;equations</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;V_lungs == V_lungs_in;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A.p == P_lung;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;der(n_lungs) == n_dot;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 19);">% Ideal gas law</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;P_lung * V_lungs == n_lungs * R_gas * T;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;f == -F_buoy;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><h3  style = 'margin: 15px 10px 5px 4px; padding: 0px; line-height: 20.4px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; '><span class="_richTextNode">Generating the Simscape library using an AI agent</span></h3><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Here are a few items I had to iterate with the agent to get the way I wanted:</span></div><h4  style = 'margin: 10px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 15px; font-weight: 700; text-align: left; '><span class="_richTextNode">Simscape language syntax</span></h4><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">As of today, the Simulink Agentic Toolkit does not include guidance for the Simscape language. Because of that, the agent initially ended up using old-style syntax like the setup function and let-in-end pattern that are either obsolete or will be soon. Once I realized that, I simply prompted the agent with the following and it succeeded in seconds:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">"</span><span class="_richTextNode" style=' font-style: italic;'>Update all Let-in-end pattern in Simscape language with the more modern intermediate syntax. Search the MathWorks documentation for examples</span><span class="_richTextNode">"</span></div><h4  style = 'margin: 10px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 15px; font-weight: 700; text-align: left; '><span class="_richTextNode">Block Icons</span></h4><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">By default, Simscape blocks have no icon. To make my new library of blocks look better, I asked the agent to generate images. The request was something like:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">"</span><span class="_richTextNode" style=' font-style: italic;'>Generate SVG image files for all components in the scuba library. Images should be representative of the block functionality. Update the "annotation" section of the</span><span class="_richTextNode"> </span><span class="_richTextNode" style=' font-style: italic; font-family: monospace;'>.ssc</span><span class="_richTextNode"> </span><span class="_richTextNode" style=' font-style: italic;'>files to reference the icon image</span><span class="_richTextNode">"</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">For complex components like the lung, gas tank and BCD bladder, I went through a few iterations to refine the image.</span></div><h4  style = 'margin: 10px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 15px; font-weight: 700; text-align: left; '><span class="_richTextNode">Lung model</span></h4><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In my initial request, I specified that the lung input should be the "diver breathing effort". Testing showed that I was wrong with that. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">While inspecting the test results, I realized that when going deeper, the diver was not consuming more air as expected. Instead, the lungs were getting smaller! After a bit of research, I realized that the lung input should be volume. The agent was able to fix that easily.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">At the end of the day, I did not write a single line of Simscape code myself and got the fully functional Simscape components I needed.</span></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Assembling the Scuba Diver</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Next step: Assemble the plant model. Unfortunately, I have to admit that the current layout algorithm in the Simulink Agentic Toolkit struggles with Simscape and physical connections. I asked the agent to give it a first shot. It added all the blocks with the correct parameterization, and I manually moved the blocks and lines around until I got a layout I was happy with.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I grouped the components in two subsystems: mechanical and gas.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The mechanical part is mostly the diver body and weights.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/ScubaSimulator.m-07-02-26_6-1.png" width = "519" height = "327" alt = "" style = "vertical-align: baseline; width: 519px; height: 327px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">For the gas network, I used the Simscape </span><a href = "https://www.mathworks.com/help/simscape/ref/connectionlabel.html"><span class="_richTextNode">Connection Label</span></a><span class="_richTextNode"> block to share the depth information with all components.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/ScubaSimulator.m-07-02-26_7-1.png" width = "991" height = "607" alt = "" style = "vertical-align: baseline; width: 991px; height: 607px;"></img></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Testing</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Once I had my diver assembled, I put together tests for a few simple maneuvers.</span></div><h3  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 20.4px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; '><span class="_richTextNode">Simple Ascent-Descent</span></h3><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">As a first test, I put together this model.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >mdl = </span><span style="color: rgb(167, 9, 245);">'descent_test'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >open_system(mdl)</span></span></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/ScubaSimulator.m-07-02-26_8-1.png" width = "987" height = "303" alt = "" style = "vertical-align: baseline; width: 987px; height: 303px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">At the beginning of the simulation, the BCD is empty and the diver descends. When reaching 15 meters, the BCD is inflated for some amount of time. We can see that a small fraction of a second makes the difference between sinking to the bottom and ascending back up.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >mdl = </span><span style="color: rgb(167, 9, 245);">'descent_test'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >inflateVector = 0.75:0.01:0.8;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >N = length(inflateVector);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >in = repmat(Simulink.SimulationInput(mdl),N,1);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >in = arrayfun(@(i) in(i).setVariable(</span><span style="color: rgb(167, 9, 245);">'InflateDT'</span><span >,inflateVector(i)),1:N);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >out = sim(in,</span><span style="color: rgb(167, 9, 245);">'ShowProgress'</span><span >,</span><span style="color: rgb(167, 9, 245);">'off'</span><span >,</span><span style="color: rgb(167, 9, 245);">'UseFastRestart'</span><span >,</span><span style="color: rgb(167, 9, 245);">'on'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >figure</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >plot(out(1).logsout.get(</span><span style="color: rgb(167, 9, 245);">'Desired Depth'</span><span >).Values)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >hold </span><span style="color: rgb(167, 9, 245);">on</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">for </span><span >i = 1:N</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >plot(out(i).logsout.get(</span><span style="color: rgb(167, 9, 245);">'Depth'</span><span >).Values);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >hold </span><span style="color: rgb(167, 9, 245);">off</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >labels = compose(</span><span style="color: rgb(167, 9, 245);">"Inflate duration = %.2f sec"</span><span >, inflateVector);  </span><span style="color: rgb(0, 128, 19);">% string array</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >legend(labels,</span><span style="color: rgb(167, 9, 245);">'Location'</span><span >,</span><span style="color: rgb(167, 9, 245);">'northwest'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >xlabel(</span><span style="color: rgb(167, 9, 245);">'Time (sec)'</span><span >)</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >ylabel(</span><span style="color: rgb(167, 9, 245);">'Depth (m)'</span><span >)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(230, 230, 230) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsFigure" uid="89C62EB2" prevent-scroll="true" data-testid="output_0" tabindex="-1" ><div class="outputLayer selectedOutputDecorationLayer doNotExport" aria-hidden="true"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport" aria-hidden="true"></div><div class="outputLayer navigationFocusLayer doNotExport" aria-hidden="false" role="application" tabindex="-1"></div><div class="outputLayer activeOutputDecorationLayer doNotExport" aria-hidden="false" role="application"></div><div class="figureElement eoOutputContent" role="article" aria-roledescription="Use Browse Mode to explore " aria-description="figure output "><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/simulink/files/ScubaSimulator.m-07-02-26_9-1.png" style="width: 560px;"></div></div></div></div></div><h3  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 20.4px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; '><span class="_richTextNode">Air Consumption</span></h3><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">When diving, the deeper you go, the more air you use. To validate that this is modeled properly, I used this simple harness where I "pinned" the diver at certain depths and let it breathe normally for an hour.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >mdl = </span><span style="color: rgb(167, 9, 245);">'breath_test'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >open_system(mdl);</span></span></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/ScubaSimulator.m-07-02-26_10-1.png" width = "466" height = "260" alt = "" style = "vertical-align: baseline; width: 466px; height: 260px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I can run the simulation for various depths.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >breathTestDepthV = 5:5:30;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >N = length(breathTestDepthV);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >in = repmat(Simulink.SimulationInput(mdl),N,1);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >in = arrayfun(@(i) in(i).setVariable(</span><span style="color: rgb(167, 9, 245);">'breathTestDepth'</span><span >,breathTestDepthV(i)),1:N);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >out = sim(in,</span><span style="color: rgb(167, 9, 245);">'ShowProgress'</span><span >,</span><span style="color: rgb(167, 9, 245);">'off'</span><span >,</span><span style="color: rgb(167, 9, 245);">'UseFastRestart'</span><span >,</span><span style="color: rgb(167, 9, 245);">'on'</span><span >);</span></span></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The results match quite well what I experience myself while diving.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >figure</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >hold </span><span style="color: rgb(167, 9, 245);">on</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">for </span><span >i = 1:N</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;ts = out(i).logsout.get(</span><span style="color: rgb(167, 9, 245);">'Tank Pressure'</span><span >).Values;   </span><span style="color: rgb(0, 128, 19);">% timeseries</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >&nbsp;&nbsp;&nbsp;&nbsp;plot(ts.Time/60, ts.Data)                          </span><span style="color: rgb(0, 128, 19);">% plot minutes vs data</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >hold </span><span style="color: rgb(167, 9, 245);">off</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >labels = compose(</span><span style="color: rgb(167, 9, 245);">"Depth = %dm"</span><span >, breathTestDepthV);  </span><span style="color: rgb(0, 128, 19);">% string array</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >legend(labels)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >xlabel(</span><span style="color: rgb(167, 9, 245);">'Time (min)'</span><span >)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >ylabel(</span><span style="color: rgb(167, 9, 245);">'Tank Pressure (PSI)'</span><span >)</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >title(</span><span style="color: rgb(167, 9, 245);">'Air consumption at different depths'</span><span >);</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(230, 230, 230) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsFigure" uid="5C0FD9F4" prevent-scroll="true" data-testid="output_1" tabindex="-1" ><div class="outputLayer selectedOutputDecorationLayer doNotExport" aria-hidden="true"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport" aria-hidden="true"></div><div class="outputLayer navigationFocusLayer doNotExport" aria-hidden="false" role="application" tabindex="-1"></div><div class="outputLayer activeOutputDecorationLayer doNotExport" aria-hidden="false" role="application"></div><div class="figureElement eoOutputContent" role="article" aria-roledescription="Use Browse Mode to explore " aria-description="figure output "><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/simulink/files/ScubaSimulator.m-07-02-26_11-1.png" style="width: 560px;"></div></div></div></div></div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Full Control</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I am still working on controlling the diver's depth for a full dive profile. It turns out that combining the BCD and breathing to control depth is more complicated than it looks like. Now that </span><a href = "https://www.anthropic.com/claude/fable"><span class="_richTextNode">Claude Fable</span></a><span class="_richTextNode"> is available, maybe I'll give it a try and see if it can figure it out.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">If anyone is interested, grab my </span><a href = "https://github.com/mathworks/Scuba-Simulator"><span class="_richTextNode">scuba-simulator project on GitHub</span></a><span class="_richTextNode"> and send me a pull request if you can come up with a good control logic. </span></div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Now it's your turn</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">What new modeling capabilities have AI agents and the Simulink Agentic Toolkit enabled for you? Let us know in the comments below.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '></div>
<br>
</div><script type="text/javascript">
{ let css = '._richTextNode {white-space: break-spaces;}';
let head = document.head || document.getElementsByTagName('head')[0];
let style = document.createElement('style');
head.appendChild(style);
style.type = 'text/css';
if (style.styleSheet) {
    style.styleSheet.cssText = css;
} else {
    style.appendChild(document.createTextNode(css));
}


}</script>]]></content:encoded>
					
					<wfw:commentRss>https://blogs.mathworks.com/simulink/2026/07/02/my-scuba-diving-simulator/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>MathWorks Automotive Conference and Model Referencing</title>
		<link>https://blogs.mathworks.com/simulink/2026/06/22/mathworks-automotive-conference-and-model-referencing/?s_tid=feedtopost</link>
					<comments>https://blogs.mathworks.com/simulink/2026/06/22/mathworks-automotive-conference-and-model-referencing/#respond</comments>
		
		<dc:creator><![CDATA[Guy Rouleau]]></dc:creator>
		<pubDate>Mon, 22 Jun 2026 19:55:38 +0000</pubDate>
				<category><![CDATA[AI Coding Assistant]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Model Reference]]></category>
		<category><![CDATA[Simulink Tips]]></category>
		<category><![CDATA[MathWorks Automotive Conference]]></category>
		<guid isPermaLink="false">https://blogs.mathworks.com/simulink/?p=18672</guid>

					<description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/simulink/files/MAC_MdlRef.m-06-22-26_4.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><p>I recently attended the MathWorks Automotive Conference. This was a great opportunity to connect with industry experts and see how they use MATLAB and Simulink.During the conference, I gave a... <a class="read-more" href="https://blogs.mathworks.com/simulink/2026/06/22/mathworks-automotive-conference-and-model-referencing/">read more >></a></p>]]></description>
										<content:encoded><![CDATA[<div class = rtcContent><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><a href = "https://matlab.mathworks.com/open/github/v1?repo=simulink/blog&amp;project=2026_22_06_MAC_MdlRef/MathWorks_Automotive_Conference_MdlRef.prj"><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MAC_MdlRef.m-06-22-26_1.png" width = "136" height = "21" alt = "" style = "vertical-align: baseline; width: 136px; height: 21px;"></img></a></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I recently attended the </span><a href = "https://www.mathworks.com/company/events/conferences/automotive-conference-michigan/2026.html"><span class="_richTextNode">MathWorks Automotive Conference</span></a><span class="_richTextNode">. This was a great opportunity to connect with industry experts and see how they use MATLAB and Simulink.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">During the conference, I gave a presentation titled </span><a href = "https://www.mathworks.com/videos/building-efficient-and-fast-models-sharing-user-experience-1779076022313.html"><span class="_richTextNode">Building Efficient and Fast Models: Sharing User Experience</span></a><span class="_richTextNode">. I thought some readers may find the topic useful, so I decided to summarize the main points here.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">You can find the recording and slides here:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Recording: </span><a href = "https://www.mathworks.com/videos/building-efficient-and-fast-models-sharing-user-experience-1779076022313.html"><span class="_richTextNode">Building Efficient and Fast Models: Sharing User Experience</span></a></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Slides: </span><a href = "https://www.mathworks.com/content/dam/mathworks/mathworks-dot-com/company/events/conferences/automotive-conference-michigan/2026/na-mac-2026-mathworks-building-fast-models.pdf"><span class="_richTextNode">Building Efficient and Fast Models: Sharing User Experience - PDF</span></a></li></ul><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Key takeaways</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I would summarize the key takeaways as:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Componentization using Model Reference Accelerator mode is key to performance</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Know your workflows to determine what and when to componentize using Model Reference Accelerator mode</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Foundation for successful componentization</span></li></ul><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MAC_MdlRef.m-06-22-26_2.png" width = "801" height = "344" alt = "" style = "vertical-align: baseline; width: 801px; height: 344px;"></img></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Know your workflows</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I always like to refer to the workflows described in this technical article: </span><a href = "https://www.mathworks.com/company/technical-articles/improving-simulation-performance-in-simulink.html"><span class="_richTextNode">Improving Simulation Performance in Simulink - MATLAB &amp; Simulink</span></a><span class="_richTextNode">.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MAC_MdlRef.m-06-22-26_3.png" width = "800" height = "266" alt = "" style = "vertical-align: baseline; width: 800px; height: 266px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">The most important recommendation to keep in mind based on those workflows is:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode" style=' font-weight: bold;'>If a model is not structurally modified between simulations, it should not be recompiled.</span></li></ul><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Multiple workflows in one simulation</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">This is where Model Reference Accelerator mode comes into play. Model Reference allows a single simulation to be composed of multiple Simulink models... which means multiple workflows in one simulation: </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MAC_MdlRef.m-06-22-26_4.png" width = "801" height = "346" alt = "" style = "vertical-align: baseline; width: 801px; height: 346px;"></img></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Foundation for successful componentization</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Once you realize how and when Model Reference Accelerator mode can benefit your workflows, it's time to dig into the specifics of what is needed to adopt it.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">When creating a model that I plan to accelerate, or converting an existing subsystem to an accelerated referenced model, I usually go through a series of steps or questions.</span></div><h3  style = 'margin: 15px 10px 5px 4px; padding: 0px; line-height: 20.4px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; '><span class="_richTextNode">1 - Can it run as a referenced model in Accelerator mode?</span></h3><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Some features are not supported by Model Reference Accelerator mode.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">I will not go through the full list here, but here are a few examples:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Blocks that run MATLAB code in interpreted mode are not supported for Accelerator mode code generation</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode">Goto and From blocks cannot cross model boundaries.</span></li></ul><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">You can get the full list of limitations here: </span><a href = "https://www.mathworks.com/help/simulink/ug/model-referencing-limitations.html"><span class="_richTextNode">Model Reference Requirements and Limitations</span></a></div><h3  style = 'margin: 15px 10px 5px 4px; padding: 0px; line-height: 20.4px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; '><span class="_richTextNode">2 - Can I tune parameters without rebuilding the accelerator target?</span></h3><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">To benefit from Model Reference Accelerator mode, the parameters you care about must remain tunable without triggering a rebuild. For the majority of parameters, it just works by default. In some cases, you need to do a bit of extra work. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Here are examples of the use cases I encounter the most frequently:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode" style=' font-weight: bold;'>Variant Subsystems:</span><span class="_richTextNode"> By default the </span><a href = "https://www.mathworks.com/help/simulink/var/activate-variant-during-different-stages-of-simulation-and-code-generation-workflow.html"><span class="_richTextNode">variant activation time</span></a><span class="_richTextNode"> parameter is set to </span><span class="_richTextNode" style=' font-weight: bold; font-family: monospace;'>update diagram</span><span class="_richTextNode">. To be tuned in accelerator mode, the variant activation time needs to be set to </span><span class="_richTextNode" style=' font-weight: bold; font-family: monospace;'>startup</span><span class="_richTextNode">.</span></li></ul><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MAC_MdlRef.m-06-22-26_5.png" width = "513" height = "305" alt = "" style = "vertical-align: baseline; width: 513px; height: 305px;"></img></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode" style=' font-weight: bold;'>Simscape:</span><span class="_richTextNode"> Simscape parameters have a Configurability setting that needs to be set to Run-time:</span></li></ul><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/MAC_MdlRef.m-06-22-26_6.png" width = "566" height = "278" alt = "" style = "vertical-align: baseline; width: 566px; height: 278px;"></img></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span class="_richTextNode" style=' font-weight: bold;'>Mask Initialization code:</span><span class="_richTextNode"> By default, Simulink does not generate accelerator code for mask initialization MATLAB code. For your mask initialization to preserve tunability, you need to follow the syntax described here: </span><a href = "https://www.mathworks.com/help/simulink/ug/preserve-tunability.html"><span class="_richTextNode">Preserve Tunability of Parameters That Are Modified or Created in Mask Initialization</span></a><span class="_richTextNode">.</span></li></ul><h3  style = 'margin: 15px 10px 5px 4px; padding: 0px; line-height: 20.4px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; '><span class="_richTextNode">3 - Is the accelerator target initializing as fast as possible?</span></h3><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Once compiled and the cache is available, a referenced model in accelerator mode should start instantly, in less than one second. If you see longer initialization times, it's worth investigating. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">To better understand how cache and accelerator rebuilds work, look at this blog post: </span><a href = "https://blogs.mathworks.com/simulink/2023/10/18/accelerator-cache-and-rebuilds-everything-you-need-to-know/"><span class="_richTextNode">Accelerator Cache and Rebuilds – Everything you need to know</span></a></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In MATLAB R2026a, a </span><a href = "https://www.mathworks.com/help/simulink/release-notes.html?s_tid=CRUX_lftnav#mw_b85549ac-893e-4f76-b016-0f6e2824967b"><span class="_richTextNode">detailed breakdown of the model initialization has been added to the Simulink Profiler</span></a><span class="_richTextNode">. We expect this newly added information to be very useful.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">If you still have concerns, reach out to </span><a href = "https://www.mathworks.com/support/contact_us.html"><span class="_richTextNode">technical support</span></a><span class="_richTextNode"> and we can help you with that.</span></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Now it's your turn</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Are you already using Model Reference to speed up your simulations? </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">If you have an existing model that you think could benefit from Model Reference, try getting help from an AI Agent like Claude Code or Codex. I had good success with the example in this blog post: </span><a href = "https://blogs.mathworks.com/simulink/2026/03/26/refactoring-a-simulink-model-using-the-matlab-mcp-server/"><span class="_richTextNode">Refactoring a Simulink Model using the MATLAB MCP Server</span></a><span class="_richTextNode">.</span></div>
<br>
</div><script type="text/javascript">
{ let css = '._richTextNode {white-space: break-spaces;}';
let head = document.head || document.getElementsByTagName('head')[0];
let style = document.createElement('style');
head.appendChild(style);
style.type = 'text/css';
if (style.styleSheet) {
    style.styleSheet.cssText = css;
} else {
    style.appendChild(document.createTextNode(css));
}


}</script>]]></content:encoded>
					
					<wfw:commentRss>https://blogs.mathworks.com/simulink/2026/06/22/mathworks-automotive-conference-and-model-referencing/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Logging Simscape variables like Simulink Signals</title>
		<link>https://blogs.mathworks.com/simulink/2026/05/05/logging-simscape-variables-like-simulink-signals/?s_tid=feedtopost</link>
					<comments>https://blogs.mathworks.com/simulink/2026/05/05/logging-simscape-variables-like-simulink-signals/#comments</comments>
		
		<dc:creator><![CDATA[Guy Rouleau]]></dc:creator>
		<pubDate>Tue, 05 May 2026 22:12:43 +0000</pubDate>
				<category><![CDATA[AI Coding Assistant]]></category>
		<category><![CDATA[Physical Modeling]]></category>
		<category><![CDATA[Simulink Tips]]></category>
		<category><![CDATA[What's new?]]></category>
		<guid isPermaLink="false">https://blogs.mathworks.com/simulink/?p=18656</guid>

					<description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/simulink/files/SimscapeLogging.m-05-05-26_3.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><p>Did you know that starting in R2024a, it is possible to log Simscape variables like if they were Simulink signals?Let's see how that works.The ProblemHere is a pattern I often see in Simscape models.... <a class="read-more" href="https://blogs.mathworks.com/simulink/2026/05/05/logging-simscape-variables-like-simulink-signals/">read more >></a></p>]]></description>
										<content:encoded><![CDATA[<div class = rtcContent><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><a href="https://matlab.mathworks.com/open/github/v1?repo=simulink/blog&amp;project=2026_05_05_SimscapeLogging/SimscapeLogging.prjhttps://matlab.mathworks.com/open/github/v1?repo=simulink/blog&amp;project=2026_05_05_SimscapeLogging/SimscapeLogging.prj" target="_blank" rel="noopener"><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeLogging.m-05-05-26_1.png" width = "136" height = "21" alt = "" style = "vertical-align: baseline; width: 136px; height: 21px;"></img></a></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Did you know that starting in R2024a, it is possible to log Simscape variables like if they were Simulink signals?</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Let's see how that works.</span></div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">The Problem</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Here is a pattern I often see in Simscape models. To log variables from Simscape blocks, users add sensor blocks and </span><a href = "https://www.mathworks.com/help/simscape/ref/pssimulinkconverter.html"><span class="_richTextNode">PS-Simulink Converter</span></a><span class="_richTextNode">, and then log the output Simulink signal.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >mdl = </span><span style="color: rgb(167, 9, 245);">'CavitationInTwoPhaseFluid'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >open_system(mdl)</span></span></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeLogging.m-05-05-26_2.png" width = "709" height = "253" alt = "" style = "vertical-align: baseline; width: 709px; height: 253px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">After simulating, you can access all logged signals in the </span><span class="_richTextNode" style=' font-family: monospace;'>logsout</span><span class="_richTextNode">.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >out = sim(mdl);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >out.logsout</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsVariableStringElement" uid="1B2A28AB" prevent-scroll="true" data-testid="output_0" style="width: 1175px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;" tabindex="-1"><div class="textElement eoOutputContent" tabindex="-1" data-previous-available-width="1138" data-previous-scroll-height="153" data-hashorizontaloverflow="false" role="article" aria-roledescription="Use Browse Mode to explore " aria-description="variable output " style="max-height: 261px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><span class="variableNameElement" style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">ans = </span></div><div style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">Simulink.SimulationData.Dataset 'logsout' with 3 elements

   <strong style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">   </strong><strong style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">                  </strong><strong style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"> Name         </strong><strong style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"> BlockPath                                </strong>
   <strong style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">   </strong><strong style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">                  </strong><strong style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"> ____________ </strong><strong style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"> ________________________________________ </strong>
    1  [1x1 Signal]      Pconverter    ...InTwoPhaseFluid/PS-Simulink Converter
    2  [1x1 Signal]      Displacement  ...nTwoPhaseFluid/PS-Simulink Converter1
    3  [1x1 Signal]      Psource       CavitationInTwoPhaseFluid/Sine Wave     

  - Use braces { } to access, modify, or add elements using index.
</div></div></div></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">While it is a perfectly valid pattern, adding sensor blocks just to log signals is inefficient. This adds blocks to the model, impacting the performance and clarity of the model.</span></div><h3  style = 'margin: 15px 10px 5px 4px; padding: 0px; line-height: 20.4px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; '><span class="_richTextNode">Simscape Logging - A non-ideal workaround</span></h3><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">For as far as I can remember, </span><a href = "https://www.mathworks.com/help/simscape/ug/about-simscape-data-logging.html"><span class="_richTextNode">Simscape offers its own logging</span></a><span class="_richTextNode"> that is separate from Simulink logging. While it is useful for debugging purposes using the </span><a href = "https://www.mathworks.com/help/simscape/ref/simscaperesultsexplorer.html"><span class="_richTextNode">Simscape Results Explorer</span></a><span class="_richTextNode">, I find it less convenient for writing more robust and scalable post-processing code. For example, to access the data for the Displacement signal from above, I would need this line of code:</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >out.simlog_CavitationInTwoPhaseFluid.Translational_Mechanical_Converter_2P.interface_displacement.series.values;</span></span></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">This returns an array of double numbers instead of the </span><a href = "https://www.mathworks.com/help/matlab/ref/timeseries.html"><span class="_richTextNode">timeseries</span></a><span class="_richTextNode"> or </span><a href = "https://www.mathworks.com/help/matlab/timetables.html"><span class="_richTextNode">timetable</span></a><span class="_richTextNode"> like the signals logged in Simulink.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Let's look at a better way.</span></div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Simscape Instrumentation Table</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">To directly log a Simscape variable like a Simulink signal, start by selecting the block in the canvas. Go to the </span><span class="_richTextNode" style=' font-weight: bold;'>Simscape Block</span><span class="_richTextNode"> tab in the Simulink toolstrip and click </span><span class="_richTextNode" style=' font-weight: bold;'>Instrumentation Table</span><span class="_richTextNode">. This will open the Model Editor panel with the Simscape Variables tab selected. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">In this panel, you can see all the variables for the selected block, enable logging for the ones you want and specify the name of the logged signals.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeLogging.m-05-05-26_3.png" width = "992" height = "746" alt = "" style = "vertical-align: baseline; width: 992px; height: 746px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">After making those changes, I can simulate the new model and confirm that the results are the same</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >mdl = </span><span style="color: rgb(167, 9, 245);">'CavitationInTwoPhaseFluidSSCLog'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >open_system(mdl)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >outAfter = sim(mdl);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >outAfter.logsout</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsVariableStringElement" uid="9B3D10CD" prevent-scroll="true" data-testid="output_1" tabindex="-1" style="width: 1175px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="textElement eoOutputContent" tabindex="-1" data-previous-available-width="1138" data-previous-scroll-height="153" data-hashorizontaloverflow="false" role="article" aria-roledescription="Use Browse Mode to explore " aria-description="variable output " style="max-height: 261px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><span class="variableNameElement" style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">ans = </span></div><div style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">Simulink.SimulationData.Dataset 'logsout' with 3 elements

   <strong style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">   </strong><strong style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">                    </strong><strong style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"> Name         </strong><strong style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"> BlockPath                                </strong>
   <strong style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">   </strong><strong style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">                    </strong><strong style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"> ____________ </strong><strong style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"> ________________________________________ </strong>
    1  [1x1 Variable]      Pconverter    ...aseFluidSSCLog/Local Restriction (2P)
    2  [1x1 Signal  ]      Psource       ...tationInTwoPhaseFluidSSCLog/Sine Wave
    3  [1x1 Variable]      Displacement  ...anslational Mechanical Converter (2P)

  - Use braces { } to access, modify, or add elements using index.
</div></div></div></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >diffResult = Simulink.sdi.compareRuns(runIDs(end-1), runIDs(end),</span><span style="color: rgb(167, 9, 245);">'abstol'</span><span >,1e-3,</span><span style="color: rgb(167, 9, 245);">'reltol'</span><span >,1e-3);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace, Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >diffResult.Summary.OutOfTolerance</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsVariableStringElement" uid="7C5CD5DE" prevent-scroll="true" data-testid="output_2" tabindex="-1" style="width: 1175px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="textElement eoOutputContent" tabindex="-1" data-previous-available-width="1138" data-previous-scroll-height="35" data-hashorizontaloverflow="false" role="article" aria-roledescription="Use Browse Mode to explore " aria-description="variable output " style="max-height: 261px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><span class="variableNameElement" style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">ans = <span class="headerElement veVariableValueSummary" style="white-space: pre; font-style: italic; color: rgb(97, 97, 97); font-size: 12px;">uint32</span></span>
0</div></div></div></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Note that this can all be configured programmatically as described here: </span><a href = "https://www.mathworks.com/help/simscape/ug/manage-selective-logging-instrumentation-programmatically.html"><span class="_richTextNode">Log Selected Variables Programmatically</span></a></div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Using a Coding Agent for Refactoring and Modernization</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Do you think I made those changes myself manually? We're not in 2025 anymore!</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">What I did is connect my favorite coding agent (configured to use the </span><a href="https://github.com/matlab/simulink-agentic-toolkit" target="_blank" rel="noopener"><span class="_richTextNode">Simulink Agentic Toolkit</span></a><span class="_richTextNode">) to my running MATLAB session and asked:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode" style=' font-style: italic; font-family: monospace;'>My Simulink model is logging Simscape variables using sensor blocks and PS-Simulink Converter to then log the Simulink signal. I want you to refactor this model to delete sensor blocks used only for logging and instead use the Simscape Instrumentation Table to log the Simscape variables like Simulink signal. The name of logged signals should remain the same. Begin by capturing a baseline and validate that the logged signals are the same after your changes.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">After just a few seconds, I had the model shown in the above picture and a summary of the changes:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/simulink/files/SimscapeLogging.m-05-05-26_4.png" width = "923" height = "338" alt = "" style = "vertical-align: baseline; width: 923px; height: 338px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Before you ask, yes, removing sensors in a Simscape model can change the results, but only within the specified solver tolerance, nothing significant. That's one more reason to avoid unnecessary sensors.</span></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class="_richTextNode">Now it's your turn</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">If you are not familiar with this feature, I recommend these documentation pages:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://www.mathworks.com/help/simscape/ug/about-selective-logging-instrumentation.html"><span class="_richTextNode">About Selective Logging</span></a></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://www.mathworks.com/help/simscape/ug/log-individual-block-variables.html"><span class="_richTextNode">Log Selected Block Variables</span></a></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://www.mathworks.com/help/simscape/ug/manage-selective-logging-instrumentation-programmatically.html"><span class="_richTextNode">Log Selected Variables Programmatically</span></a></li></ul><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class="_richTextNode">Do you like this way of logging Simscape variables? Have you tried the Simulink Agentic Toolkit to do this kind of refactoring and modernization work? Let us know in the comments below.</span></div>
<br>
</div><script type="text/javascript">
{ let css = '._richTextNode {white-space: break-spaces;} /* Copyright 2014-2025 The MathWorks, Inc. *//* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsErrorElement {    min-height: 18px;    max-height: 550px;} .embeddedOutputsErrorElement .diagnosticMessage-errorType {    overflow: auto;} .embeddedOutputsErrorElement.inlineElement {} .embeddedOutputsErrorElement.rightPaneElement {} /* Copyright 2014-2025 The MathWorks, Inc. *//* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsWarningElement {    min-height: 18px;    max-height: 550px;} .embeddedOutputsWarningElement .diagnosticMessage-warningType {    overflow: auto;} .embeddedOutputsWarningElement.inlineElement {} .embeddedOutputsWarningElement.rightPaneElement {} /* Copyright 2015-2025 The MathWorks, Inc. *//* In this file, styles are not scoped to rtcContainer since they could be in the Dojo Tooltip */.diagnosticMessage-wrapper {    /* Since this selector may be used outside RTC Container without RTC semantic variables, a    default value is used. An example here is the App Designers alert tooltip. */    font-family: var(--rtc-output-font-family, Menlo, Monaco, Consolas, "Courier New", monospace);    font-size: var(--rtc-output-font-size, 12px);} .diagnosticMessage-wrapper.diagnosticMessage-warningType {    /*This fallback value will be used for appdesigner warnings*/    color: var(--rtc-warning-output-color, var(--mw-color-matlabWarning));} .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    /*This fallback value will be used for appdesigner warnings*/    color: var(--rtc-warning-output-color, var(--mw-color-matlabWarning));    text-decoration: underline;} .rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-warningType,.rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: var(--mw-color-matlabWarning) !important;} .diagnosticMessage-wrapper.diagnosticMessage-errorType {    /*This fallback value will be used in appdesigner error tooltip text*/    color: var(--rtc-error-output-color, var(--mw-color-matlabErrors));} .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    /*This fallback value will be used in appdesigner error tooltip text*/    color: var(--rtc-error-output-color, var(--mw-color-matlabErrors));    text-decoration: underline;} .rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-errorType,.rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: var(--mw-color-matlabErrors) !important;} .diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {    white-space: pre-wrap;} .diagnosticMessage-wrapper .diagnosticMessage-stackPart {    white-space: pre;} /* Copyright 2014-2025 The MathWorks, Inc. */.embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {    white-space: pre;    word-wrap:  initial;    min-height: 18px;    max-height: 550px;} .embeddedOutputsTextElement .textElement,.embeddedOutputsVariableStringElement .textElement {    overflow: auto;} .textElement,.rtcDataTipElement .textElement {    padding-top: 2px;} .embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {} .inlineElement .textElement {} .embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .textElement {    padding-top: 2px;    padding-left: 9px;}';
let head = document.head || document.getElementsByTagName('head')[0];
let style = document.createElement('style');
head.appendChild(style);
style.type = 'text/css';
if (style.styleSheet) {
    style.styleSheet.cssText = css;
} else {
    style.appendChild(document.createTextNode(css));
}


}</script>]]></content:encoded>
					
					<wfw:commentRss>https://blogs.mathworks.com/simulink/2026/05/05/logging-simscape-variables-like-simulink-signals/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
			</item>
	</channel>
</rss>
