ChE 436: Simulation Labs

Main.SimulationLab History

Show minor edits - Show changes to markup

June 21, 2020, at 05:03 AM by 136.36.211.159 -
Deleted lines 121-139:

(: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:)

Changed lines 98-99 from:
to:
  • Simulation Lab 8
  • Supplemental Files
December 09, 2014, at 08:23 PM by 10.10.149.147 -
Added lines 8-11:
November 26, 2014, at 05:09 PM by 107.188.175.164 -
Deleted lines 116-159:

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.

November 26, 2014, at 05:03 PM by 107.188.175.164 -
Changed lines 15-17 from:
to:
Changed lines 26-28 from:
to:
Changed lines 37-39 from:
to:
Changed lines 48-51 from:
to:
Changed lines 60-62 from:
to:
Changed lines 71-73 from:
to:
Changed lines 82-84 from:
to:
Changed lines 93-95 from:
to:
Changed lines 120-121 from:

Example MIMO System

to:

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

Changed line 146 from:

Exporting Data from MATLAB / Simulink

to:

Exporting Data from MATLAB / Simulink

October 31, 2014, at 04:48 PM by 107.188.175.164 -
Added lines 8-9:
Added lines 96-103:

(:htmlend:)


Other Student Control Projects

(:html:) <iframe width="560" height="315" src="//www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDhUyN1Kur1XbDG4p7W9OKom" frameborder="0" allowfullscreen></iframe>

Changed lines 62-64 from:

<iframe width="560" height="315" src="//www.youtube.com/embed/yFo9vEk1cCo?rel=0" frameborder="0" allowfullscreen></iframe></iframe>

to:

<iframe width="560" height="315" src="//www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDhuPF0FV1WbxTF2Kpkodlyn" frameborder="0" allowfullscreen></iframe>

Added line 62:
Added line 64:
Changed line 97 from:

<iframe width="560" height="315" src="//www.youtube.com/embed/20n_KtEy6Y4?rel=0" frameborder="0" allowfullscreen></iframe></iframe>

to:

<iframe width="560" height="315" src="//www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDiDHXgrjmnL_NIudu43Xtu-" frameborder="0" allowfullscreen></iframe>

Changed line 73 from:

<iframe width="560" height="315" src="//www.youtube.com/embed/rim0wJxZ-O8?rel=0" frameborder="0" allowfullscreen></iframe></iframe>

to:

<iframe width="560" height="315" src="//www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDiMgiwODftWlVUrzSrqis8C" frameborder="0" allowfullscreen></iframe>

Added lines 82-85:

(:html:) <iframe width="560" height="315" src="//www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDjnlnHY7L9_S6TbSzPvIlVQ" frameborder="0" allowfullscreen></iframe> (:htmlend:)

November 21, 2013, at 02:57 PM by 128.187.97.24 -
Added lines 111-112:
November 21, 2013, at 02:42 PM by 128.187.97.24 -
Added lines 105-110:

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)

November 15, 2013, at 07:50 PM by 128.187.97.20 -
Changed lines 120-139 from:
to:

(: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:)

November 13, 2013, at 05:51 PM by 69.169.137.17 -
Changed line 11 from:

Project 1: Friction Stir Welding

to:

Project 1: Heated Rod Temperature Control

November 13, 2013, at 05:51 PM by 69.169.137.17 -
Changed lines 11-14 from:

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.

to:

Project 1: Friction Stir Welding

Changed line 17 from:

<iframe width="560" height="315" src="https://www.youtube.com/embed/lWBr7ploeNM" frameborder="0" allowfullscreen></iframe>

to:

<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDiIbdwROVoQY4jKNzn_jKAq&hl=en_US" frameborder="0" allowfullscreen></iframe>

Changed lines 22-26 from:

Project 1: Friction Stir Welding

to:

Project 2: Deployable Nuclear Reactor for Disaster Relief

Changed line 28 from:

<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDiIbdwROVoQY4jKNzn_jKAq&hl=en_US" frameborder="0" allowfullscreen></iframe>

to:

<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDittrFjBmAMNJoKrxsTbOVd&hl=en_US" frameborder="0" allowfullscreen></iframe>

Changed lines 33-37 from:

Project 2: Deployable Nuclear Reactor for Disaster Relief

to:

Project 3: Minimizing Anti-viral use in HIV Control

Changed line 39 from:

<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDittrFjBmAMNJoKrxsTbOVd&hl=en_US" frameborder="0" allowfullscreen></iframe>

to:

<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDhDKTVZR-E-LlR34iyC5rlq&hl=en_US" frameborder="0" allowfullscreen></iframe>

Deleted lines 43-53:

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:)


Added lines 96-104:

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:)


November 13, 2013, at 02:42 PM by 69.169.137.17 -
Added lines 76-105:

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:)


November 11, 2013, at 07:45 PM by 128.187.97.20 -
Added lines 66-76:

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:)


Changed line 91 from:
to:
October 25, 2013, at 04:40 PM by 69.169.137.17 -
Changed lines 11-15 from:

Project 1: Friction Stir Welding

to:

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.

Changed line 16 from:

<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDiIbdwROVoQY4jKNzn_jKAq&hl=en_US" frameborder="0" allowfullscreen></iframe>

to:

<iframe width="560" height="315" src="https://www.youtube.com/embed/lWBr7ploeNM" frameborder="0" allowfullscreen></iframe>

Changed lines 21-25 from:

Project 2: Deployable Nuclear Reactor for Disaster Relief

to:

Project 1: Friction Stir Welding

Changed line 27 from:

<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDittrFjBmAMNJoKrxsTbOVd&hl=en_US" frameborder="0" allowfullscreen></iframe>

to:

<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDiIbdwROVoQY4jKNzn_jKAq&hl=en_US" frameborder="0" allowfullscreen></iframe>

Changed lines 32-36 from:

Project 3: Minimizing Anti-viral use in HIV Control

to:

Project 2: Deployable Nuclear Reactor for Disaster Relief

Changed line 38 from:

<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDhDKTVZR-E-LlR34iyC5rlq&hl=en_US" frameborder="0" allowfullscreen></iframe>

to:

<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDittrFjBmAMNJoKrxsTbOVd&hl=en_US" frameborder="0" allowfullscreen></iframe>

Added lines 43-53:

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:)


Deleted line 80:
December 05, 2012, at 09:41 PM by 128.187.97.21 -
Deleted lines 69-73:

Groups for Project #2

December 05, 2012, at 01:55 AM by 69.169.188.188 -
Changed lines 7-8 from:

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.

to:

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.


Added lines 20-21:

Added lines 31-32:

Added lines 42-43:

Added lines 52-53:

December 05, 2012, at 01:53 AM by 69.169.188.188 -
Changed lines 9-13 from:
to:

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

December 05, 2012, at 01:48 AM by 69.169.188.188 -
Added line 12:
Added lines 14-16:

(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLBUgWXdTBDjE8W6s14ICP8SXaSD_hmAm&hl=en_US" frameborder="0" allowfullscreen></iframe> (:htmlend:)

December 03, 2012, at 11:22 PM by 128.187.97.21 -
Changed lines 20-21 from:
to:
Changed lines 24-25 from:
to:
Changed line 28 from:
to:
December 03, 2012, at 11:22 PM by 128.187.97.21 -
Changed lines 14-16 from:

Other examples of simulated systems are found in:

Repository of nonlinear dynamic models

to:

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.

Attach:matlab_input_data.png

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.

Attach:matlab_save_data.png

December 03, 2012, at 10:57 PM by 128.187.97.21 -
Changed lines 3-21 from:

(:description Process Control and Dynamics Labs in Chemical Engineering at Brigham Young University:)

to:

(: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.

Other examples of simulated systems are found in:

Repository of nonlinear dynamic models

Groups for Project #2

December 03, 2012, at 10:56 PM by 128.187.97.21 -
Added lines 1-3:

(: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:)