ChE 436: Simulation Labs
Main.SimulationLab History
Hide minor edits - Show changes to markup
(:html:)
<div id="disqus_thread"></div> <script type="text/javascript"> /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ var disqus_shortname = 'apmonitor'; // required: replace example with your forum shortname /* * * DON'T EDIT BELOW THIS LINE * * */ (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> <a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
(:htmlend:)
- Simulation Lab 8
- Supplemental Files
- Simulation Control Lab Grading Sheet
- 2 page Executive Summary
- 5 minute Presentation
Programming Help
Below are a few examples of Simulink and MATLAB programs that can help with projects. Common questions for the simulation labs include how to import data, export results, and configuring more complex systems.
Import Data File into Simulink
Data such as any custom time series can be imported into Simulink. In this example, an Interpreted MATLAB Function block is used to read a data file (data.txt) and interpolate with a linear approximation between the two nearest points.
Embedding Custom Functions (MATLAB scripts)
(:html:) <iframe width="560" height="315" src="//www.youtube.com/embed/XfG9fO4bcNk?rel=0" frameborder="0" allowfullscreen></iframe> (:htmlend:)
Example MIMO System
The following Simulink model is an example of a Multiple-Input Multiple-Output system. The first block is an example of two decoupled PID controllers (non-interacting) while the second block is an example of interacting PID controllers with feedforward gains.
Download Interacting Control Example (Simulink)

Exporting Data from MATLAB / Simulink
You may want to export data from MATLAB or Simulink to combine plots or for further manipulation in another program like Excel. One way is shown below:
Step 1: Drop the "to Workspace" blocks into Simulink and re-run the simulation. The requested variables will be exported to the MATLAB workspace.

Step 2: From the MATLAB command prompt, view the "input" and "output" data that was generated from the Simulink simulation. Type "input" or "output" to inspect the information that is contained in the variable structure.

Step 3: Save the data to a text file. One way is to construct all of the data that will be saved into a data matrix and then export as an ASCII text file (tab delimited). Make sure your current directory allows you to save a file (is not write-restricted) or it will return an error.

Example MIMO System
Programming Help
Below are a few examples of Simulink and MATLAB programs that can help with projects. Common questions for the simulation labs include how to import data, export results, and configuring more complex systems.
Import Data File into Simulink
Data such as any custom time series can be imported into Simulink. In this example, an Interpreted MATLAB Function block is used to read a data file (data.txt) and interpolate with a linear approximation between the two nearest points.
Embedding Custom Functions (MATLAB scripts)
(:html:) <iframe width="560" height="315" src="//www.youtube.com/embed/XfG9fO4bcNk?rel=0" frameborder="0" allowfullscreen></iframe> (:htmlend:)
Example MIMO System
Exporting Data from MATLAB / Simulink
Exporting Data from MATLAB / Simulink
(:htmlend:)
Other Student Control Projects
(:html:) <iframe width="560" height="315" src="//www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDhUyN1Kur1XbDG4p7W9OKom" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="//www.youtube.com/embed/yFo9vEk1cCo?rel=0" frameborder="0" allowfullscreen></iframe></iframe>
<iframe width="560" height="315" src="//www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDhuPF0FV1WbxTF2Kpkodlyn" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="//www.youtube.com/embed/20n_KtEy6Y4?rel=0" frameborder="0" allowfullscreen></iframe></iframe>
<iframe width="560" height="315" src="//www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDiDHXgrjmnL_NIudu43Xtu-" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="//www.youtube.com/embed/rim0wJxZ-O8?rel=0" frameborder="0" allowfullscreen></iframe></iframe>
<iframe width="560" height="315" src="//www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDiMgiwODftWlVUrzSrqis8C" frameborder="0" allowfullscreen></iframe>
(:html:) <iframe width="560" height="315" src="//www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDjnlnHY7L9_S6TbSzPvIlVQ" frameborder="0" allowfullscreen></iframe> (:htmlend:)
Example MIMO System
The following Simulink model is an example of a Multiple-Input Multiple-Output system. The first block is an example of two decoupled PID controllers (non-interacting) while the second block is an example of interacting PID controllers with feedforward gains.


(:html:)
<div id="disqus_thread"></div> <script type="text/javascript"> /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ var disqus_shortname = 'apmonitor'; // required: replace example with your forum shortname /* * * DON'T EDIT BELOW THIS LINE * * */ (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> <a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
(:htmlend:)
Project 1: Friction Stir Welding
Project 1: Heated Rod Temperature Control
5 Steps to Begin a Technical Presentation
Students have an opportunity with the second lab to share a brief presentation on their project. Below are 5 steps for beginning a technical presentation.
Project 1: Friction Stir Welding
<iframe width="560" height="315" src="https://www.youtube.com/embed/lWBr7ploeNM" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDiIbdwROVoQY4jKNzn_jKAq&hl=en_US" frameborder="0" allowfullscreen></iframe>
Project 1: Friction Stir Welding
Project 2: Deployable Nuclear Reactor for Disaster Relief
<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDiIbdwROVoQY4jKNzn_jKAq&hl=en_US" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDittrFjBmAMNJoKrxsTbOVd&hl=en_US" frameborder="0" allowfullscreen></iframe>
Project 2: Deployable Nuclear Reactor for Disaster Relief
Project 3: Minimizing Anti-viral use in HIV Control
<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDittrFjBmAMNJoKrxsTbOVd&hl=en_US" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDhDKTVZR-E-LlR34iyC5rlq&hl=en_US" frameborder="0" allowfullscreen></iframe>
Project 3: Minimizing Anti-viral use in HIV Control
(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDhDKTVZR-E-LlR34iyC5rlq&hl=en_US" frameborder="0" allowfullscreen></iframe> (:htmlend:)
5 Steps to Begin a Technical Presentation
Students have an opportunity with the second lab to share a brief presentation on their project. Below are 5 steps for beginning a technical presentation.
(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/lWBr7ploeNM" frameborder="0" allowfullscreen></iframe> (:htmlend:)
Project 6: Friction Stir Welding
(:html:) <iframe width="560" height="315" src="//www.youtube.com/embed/rim0wJxZ-O8?rel=0" frameborder="0" allowfullscreen></iframe></iframe> (:htmlend:)
Project 7: Smart-Grid Energy Storage
Project 8: Automated Pressure Control During Drilling
(:html:) <iframe width="560" height="315" src="//www.youtube.com/embed/20n_KtEy6Y4?rel=0" frameborder="0" allowfullscreen></iframe></iframe> (:htmlend:)
Project 5: Control of a Reservoir Network
(:html:) <iframe width="560" height="315" src="//www.youtube.com/embed/yFo9vEk1cCo?rel=0" frameborder="0" allowfullscreen></iframe></iframe> (:htmlend:)


Project 1: Friction Stir Welding
5 Steps to Begin a Technical Presentation
Students have an opportunity with the second lab to share a brief presentation on their project. Below are 5 steps for beginning a technical presentation.
<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDiIbdwROVoQY4jKNzn_jKAq&hl=en_US" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/lWBr7ploeNM" frameborder="0" allowfullscreen></iframe>
Project 2: Deployable Nuclear Reactor for Disaster Relief
Project 1: Friction Stir Welding
<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDittrFjBmAMNJoKrxsTbOVd&hl=en_US" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDiIbdwROVoQY4jKNzn_jKAq&hl=en_US" frameborder="0" allowfullscreen></iframe>
Project 3: Minimizing Anti-viral use in HIV Control
Project 2: Deployable Nuclear Reactor for Disaster Relief
<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDhDKTVZR-E-LlR34iyC5rlq&hl=en_US" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDittrFjBmAMNJoKrxsTbOVd&hl=en_US" frameborder="0" allowfullscreen></iframe>
Project 3: Minimizing Anti-viral use in HIV Control
(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDhDKTVZR-E-LlR34iyC5rlq&hl=en_US" frameborder="0" allowfullscreen></iframe> (:htmlend:)
Project #2 is a virtual system that can be numerically simulated. The purpose of this second lab is to apply more advanced topics that integrate the course material but do not have some of the limitations of physical systems.
The second lab is a virtual system that can be investigated through numerical simulation. The purpose of this lab is to apply more advanced topics that integrate the course material but do not have some of the limitations of physical systems.
Project 1: Friction Stir Welding
(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDiIbdwROVoQY4jKNzn_jKAq&hl=en_US" frameborder="0" allowfullscreen></iframe> (:htmlend:)
Project 2: Deployable Nuclear Reactor for Disaster Relief
(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDittrFjBmAMNJoKrxsTbOVd&hl=en_US" frameborder="0" allowfullscreen></iframe> (:htmlend:)
Project 3: Minimizing Anti-viral use in HIV Control
(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDhDKTVZR-E-LlR34iyC5rlq&hl=en_US" frameborder="0" allowfullscreen></iframe> (:htmlend:)
Project 4: Distillation Control
(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDjE8W6s14ICP8SXaSD_hmAm&hl=en_US" frameborder="0" allowfullscreen></iframe> (:htmlend:)



Other examples of simulated systems are found in:
Repository of nonlinear dynamic models
Exporting Data from MATLAB / Simulink
You may want to export data from MATLAB or Simulink to combine plots or for further manipulation in another program like Excel. One way is shown below:
Step 1: Drop the "to Workspace" blocks into Simulink and re-run the simulation. The requested variables will be exported to the MATLAB workspace.
Attach:simulink_to_workspace.png
Step 2: From the MATLAB command prompt, view the "input" and "output" data that was generated from the Simulink simulation. Type "input" or "output" to inspect the information that is contained in the variable structure.
Step 3: Save the data to a text file. One way is to construct all of the data that will be saved into a data matrix and then export as an ASCII text file (tab delimited). Make sure your current directory allows you to save a file (is not write-restricted) or it will return an error.
(:description Process Control and Dynamics Labs in Chemical Engineering at Brigham Young University:)
(:description Process Control and Dynamics Labs in Chemical Engineering at Brigham Young University:)
Lab 2: Simulated System
Project #2 is a virtual system that can be numerically simulated. The purpose of this second lab is to apply more advanced topics that integrate the course material but do not have some of the limitations of physical systems.
- Simulation Lab 1 | Supplemental Files
- Simulation Lab 2 | Supplemental Files
- Simulation Lab 3 | Supplemental Files
- Simulation Lab 4 | Supplemental Files
Other examples of simulated systems are found in:
Repository of nonlinear dynamic models
Groups for Project #2

(:title ChE 436: Simulation Labs:) (:keywords nonlinear, model, predictive control, differential, algebraic, modeling language, process control course:) (:description Process Control and Dynamics Labs in Chemical Engineering at Brigham Young University:)