Commit 74883727 authored by Johannes Eder's avatar Johannes Eder
Browse files

Merge branch '4069' into 'master'

4069

See merge request !39
parents 0e69b570 22e09086
......@@ -5,8 +5,8 @@
<!-- edit overview page -->
<extensionContent id="orgfortissaf3rcpapplication-overview-introExtension" style="css/intro.css" name="Overview" path="overview/@">
<group style-id="content-group" id="orgfortissaf3rcpapplication-introLink-group">
<link label="Homepage of AutoFOCUS3" url="https://af3.fortiss.org/" id="orgfortissaf3rcpapplication-introLinkAutoFocusLogo" style-id="content-link">
<text>https://af3.fortiss.org/</text>
<link label="Homepage of AutoFOCUS3" url="https://www.fortiss.org/en/publications/software/autofocus-3" id="orgfortissaf3rcpapplication-introLinkAutoFocusLogo" style-id="content-link">
<text>https://www.fortiss.org/en/publications/software/autofocus-3</text>
</link>
<anchor id="additions"/>
</group>
......@@ -66,12 +66,9 @@
<!-- edit tutorials page -->
<extensionContent id="orgfortissaf3rcpapplication-introExtension" style="css/intro.css" name="Tutorials" path="tutorials/@">
<group style-id="content-group" id="orgfortissaf3rcpapplication-introLink-group">
<link label="Screencasts of AutoFOCUS 3" url="https://af3.fortiss.org/docs/screencasts/" id="orgfortissaf3rcpapplication-introLinkTutorial" style-id="content-link">
<link label="Screencasts of AutoFOCUS 3" url="https://www.youtube.com/af3fortiss" id="orgfortissaf3rcpapplication-introLinkTutorial" style-id="content-link">
<text>Screencasts explaining AutoFOCUS 3 features and use cases.</text>
</link>
<link label="AutoFOCUS 3 Tutorials" url="https://af3.fortiss.org/docs/tutorials/" id="orgfortissaf3rcpapplication-introLinkTutorial" style-id="content-link">
<text>Step-by-step tutorials and howtos.</text>
</link>
<link label="AutoFOCUS 3 Online Help" url="http://org.eclipse.ui.intro/showHelp" id="orgfortissaf3rcpapplication-introLinkHelp" style-id="content-link">
<text>Opens the AutoFOCUS 3 Online Help.</text>
</link>
......@@ -128,8 +125,8 @@
<!-- edit web resource page -->
<extensionContent id="orgfortissaf3rcpapplication-introExtension" style="css/intro.css" name="Webresources" path="webresources/@">
<group style-id="content-group" id="orgfortissaf3rcpapplication-introLink-group">
<link label="Know more about AutoFOCUS 3" url="https://af3.fortiss.org/" id="orgfortissaf3rcpapplication-introLinkWeb" style-id="content-link">
<text>AutoFOCUS3 home page: https://af3.fortiss.org/</text>
<link label="Know more about AutoFOCUS 3" url="https://www.fortiss.org/en/publications/software/autofocus-3" id="orgfortissaf3rcpapplication-introLinkWeb" style-id="content-link">
<text>AutoFOCUS3 home page: https://www.fortiss.org/en/publications/software/autofocus-3</text>
</link>
<link label="How to contribute?" url="https://af3-developer.fortiss.org/projects/autofocus3/wiki/Developers_documentation" id="orgfortissaf3rcpapplication-introLinkWeb" style-id="content-link">
<text>AutoFOCUS 3 Developer Documentation: https://af3-developer.fortiss.org/projects/autofocus3/wiki/Developers_documentation</text>
......
af3_faq.html 6f530dee154e0abac047d8f3b655d9582e2bed08 GREEN
example_co-simulation.html 92e99e0304a365a0503d5cc2d428a5af94759151 GREEN
example_co-simulation.html 92f60eb7a00cb781eb3df2d9f2d50f7d00b566c4 GREEN
examples.MainPage.html 2c4306f571d68206ce7511bbe0fda2ee428cd2d9 GREEN
getting_started.html c14e905bd433534ec9f7ace46b487e743d78f502 GREEN
managing_projects.html 3ae1eb6a7d50f6467403de239692289bb07b93f6 GREEN
......
......@@ -2,7 +2,7 @@ BehaviorMod.ContentPage.html 8add0e6ba4dffc4715af499f681576b90d24a252 GREEN
ModandSim.MainPage.html 2ffbbecd7d06ade3f5a0a0ca3b3f8407d6ba5879 GREEN
code_specification.html 2212a40a032718892a24ab7aef701f40a90e4f7a GREEN
component_architecture.html d122d62d6622714a597a6ffbbf12bf0c8a092861 GREEN
cosimulation_with_af3.html 0922716c40e6d18412e4dca3232e458f1fd917c8 GREEN
cosimulation_with_af3.html 2a6979db8f96a812defc5df6294a9381031cbb2e GREEN
data_dictionary.html f16333315733a5223868fdf2e0b1ec06c0419d43 GREEN
hierarchical_state_automaton.html b1e1f12b3bd667fce2158df8d0dd7379b7fb7703 GREEN
mode_automaton.html 57688d041d31a074174bd8708118fb4833626753 GREEN
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- User documentation for Cosimulation feature. -->
<!-- User documentation for Co-simulation feature. -->
<html>
<head>
......@@ -122,7 +122,8 @@
<h1>Coupling AutoFOCUS3 with other Tools using Co-Simulation</h1>
<p>The following sections provide introduction and discuss cosimulation functionality in detail.</p>
<p>The following sections provide introduction and discuss co-simulation functionality in detail.
The <a href="../example_co-simulation.html">inverted pendulum example</a> illustrates the concepts introduced in this section with a co-simulation comprising three tools.</p>
<h2>Introduction</h2>
<p> AF3 alone cannot satisfy all the needs of system development.
......@@ -131,33 +132,47 @@ Other tools are often needed, e.g., for modeling continuous behavior
for interoperability with legacy tools, or simply for using non-AF3 features in combination with AF3
(e.g., visualization). </p>
<p>
In such cases, AF3 has <i>cosimulation</i> capabilities which allows to use AF3 <a href="simulation_with_af3.html">simulation</a>
In such cases, AF3 has <i>co-simulation</i> capabilities which allows to use AF3 <a href="simulation_with_af3.html">simulation</a>
with other tools in a synchronous manner.
AF3 offers cosimulation functionality in the following two ways:
AF3 offers co-simulation functionality in the following two ways:
<ul> <li>
The AF3 model can be exported as an <a target="_blank" rel="noopener noreferrer" href="http://www.fmi-standard.org">FMU</a>, which can be used as one of the components for cosimulation in other tools.</li>
The AF3 model can be exported as an <a target="_blank" rel="noopener noreferrer" href="http://www.fmi-standard.org">FMU</a>, which can be used as one of the components for co-simulation in other tools.</li>
<li>AF3 provides the environment for FMUs cosimulation by utilizing Cosimulation Orchestration Engine (<a target="_blank" rel="noopener noreferrer" href="https://into-cps-association.github.io/simulation/coe.html">COE</a>)
provided by INTO-CPS as a service. Thus, the FMUs from different tools can be imported and cosimulated together along with the AF3 components.</li>
<li>AF3 provides the environment for FMUs co-simulation by utilizing Co-simulation Orchestration Engine (<a target="_blank" rel="noopener noreferrer" href="https://into-cps-association.github.io/simulation/coe.html">COE</a>)
provided by INTO-CPS as a service. Thus, the FMUs from different tools can be imported and co-simulated together along with the AF3 components.</li>
</ul>
</p>
<h2>Cosimulation using FMI (Functional Mockup Interface)</h2>
<h2>Co-simulation using FMI (Functional Mockup Interface)</h2>
<p>
This feature supports for now only FMU export satisfying the following constraints:
AutoFOCUS3 supports currently supports FMU 2.0 export on the following platforms that
meet the listed prerequisites:
<ul>
<li>FMI2.0</li>
<li>Windows 32/64bit</li>
<li>GCC compiler:</li>
<ul>
<li>We recommend <a target="_blank" rel="noopener noreferrer" href="https://jmeubank.github.io/tdm-gcc/">TDM-GCC MinGW</a> (tested with release 9.2.0)</li>
<li>Note: <tt>gcc</tt> has to be in the search <tt>PATH</tt>. Therefore, restart AutoFOCUS3 after installing the <i>TDM-GCC MinGW</i> package.</li>
<li>Input and output values cannot carry NoVal but instead contain default values (0 for integers and reals, false for booleans, first item for enumerations)
Note: This behaviour is different from AF3 <i>simulation</i></li>
</ul>
<li>Windows
<ul>
<li>We recommend <a target="_blank" rel="noopener noreferrer" href="https://jmeubank.github.io/tdm-gcc/">TDM-GCC MinGW (x64)</a> (tested with release 9.2.0)</li>
<li>Note: <tt>gcc</tt> has to be in the search <tt>PATH</tt>. Therefore, restart AutoFOCUS3 after installing the <i>TDM-GCC MinGW</i> package.</li>
</ul>
</li>
<li>Linux
<ul>
<li>Install <tt>gcc</tt> using your distributions package manager.</li>
<li>Ensure that <tt>gcc</tt> is in the <tt>PATH</tt>.
</ul>
<li>macOS: Currently not supported</li>
</ul>
<b>Note</b>:
<ul>
<li>Input and output values cannot carry <tt>NoVal</tt> but instead contain
default values (<tt>0</tt> for integers and reals, <tt>false</tt> for booleans, first item for enumerations)
</li>
<li>This behaviour is different from AF3 <i>simulation</i>!</li>
</ul>
</p>
<h2>Exporting component architecture as an FMU</h2>
......@@ -169,7 +184,7 @@ To export anyone of them to the FMU, right-click on it in the model navigator an
<img src="./pictures/FMI_menu.png"/>
<p> AF3 works with logical time, however cosimulation is generally achieved with tools modeling reality and therefore working with real time.
<p> AF3 works with logical time, however co-simulation is generally achieved with tools modeling reality and therefore working with real time.
Therefore, the FMI standard requires that AF3 notion of time is translated to real time.
For that, a function with the name 'samplingTime()' can be defined in the data dictionary and used inside the AF3 component's behavior.
If the samplingTime() is not defined, the user will be
......@@ -180,15 +195,15 @@ asked to provide the required frequency (equivalent to sampling time) for the co
<p> You will then be asked where to store the generated FMU.
Once this is done, a message confirming that generation was successful appears and you can find the generated FMU in the directory that you selected.
You can then make use of the <a target="_blank" rel="noopener noreferrer" href="https://www.fmi-standard.org/tools">numerous cosimulation tools</a> along with AF3 itself, supporting FMI to cosimulate the generated AF3 model's FMU.</p>
You can then make use of the <a target="_blank" rel="noopener noreferrer" href="https://www.fmi-standard.org/tools">numerous co-simulation tools</a> along with AF3 itself, supporting FMI to co-simulate the generated AF3 model's FMU.</p>
<h2>Importing FMUs and their cosimulation</h2>
<h2>Importing FMUs and their co-simulation</h2>
<p>
The FMU's from other tools can be imported in AF3 for the cosimulation together with the AF3's own behavior components.</p>
The FMU's from other tools can be imported in AF3 for the co-simulation together with the AF3's own behavior components.</p>
<h3>Creating an FMU Specification</h3>
<p>
To use the cosimulation feature, you have to create the <i>FMU Specification</i> inside the component.
To use the co-simulation feature, you have to create the <i>FMU Specification</i> inside the component.
Only the entire component architecture can be simulated having FMUs or other AF3 behaviors inside its subcomponents.</p>
<p>To create an <i>FMU specification</i> for a component, open the context menu of the component and select "FMU Specification".</p>
......@@ -209,19 +224,19 @@ It has a field with:
<img src="./pictures/externalSpecificationEditor.png"/>
<p>Different AF3 component and the FMUs are connected with each other through the input and output ports. The outputs that has to be displayed as a result of the
cosimulation are assigned to the Component Architecture's root component.</p>
co-simulation are assigned to the Component Architecture's root component.</p>
<img src="./pictures/cosimulationComponentsConnection.png"/>
<h3>Running a Cosimulation</h3>
<h3>Running a Co-simulation</h3>
<p>To start the cosimulation, right-click on the <i>Component Architecture</i> element in the <i>Model Navigator</i> and select "Run Cosimulator". Remember
<p>To start the co-simulation, right-click on the <i>Component Architecture</i> element in the <i>Model Navigator</i> and select "Run Co-simulator". Remember
that this option will only be available, if there is at least two atomic component and one of them has an FMU Specification behavior.</p>
<img src="./pictures/runCosimulator.png"/>
<p>
If there would be no error in the model, then Cosimulation Configuration window will open containing two sections:
If there would be no error in the model, then Co-simulation Configuration window will open containing two sections:
<ul>
<li><i>Simulation time:</i> The step size, start and end time values has to be provided for which the simulation needs to be run.
The end time should be greater than the start time and the step size should be greater than zero and within the range of start and end time. </li>
......@@ -229,12 +244,12 @@ The end time should be greater than the start time and the step size should be g
</ul>
</p>
<p>Then press OK to proceed or cancel to stop the cosimulator.</p>
<p>Then press OK to proceed or cancel to stop the co-simulator.</p>
<img src="./pictures/cosimulationConfigurations.png"/>
<p> OK will execute the cosimulation of the components and at last the window with graph having the results will pop up.</p>
<p> OK will execute the co-simulation of the components and at last the window with graph having the results will pop up.</p>
<img src="./pictures/cosimulationResults.png"/>
......
......@@ -123,11 +123,15 @@
with AutoFOCUS3, OpenModelica and Overture
</h1>
<p>
<b>Note:</b> The following example has been tested on <b>Windows</b> only. We are aware of a bug preventing the simulation of Overture FMUs with OpenModelica on Linux. macOS is not supported as of now.
</p>
<b>Note:</b>
<ul>
<li>The following example works as described <b>on Windows only</b>.</li>
<li>Linux: A manual workaround is required as of now. Please contact us if you
would like to try the example on this platform.</li>
<li>macOS is not supported as of now.</li>
</ul>
The example at hand illustrates the co-simulation capabilities of AutoFOCUS 3 and shows how this feature can be leveraged for tool-interoperability.
The example at hand illustrates the <a href="ModandSim/cosimulation_with_af3.html">co-simulation capabilities of AutoFOCUS 3</a> and shows how this feature can be leveraged for tool-interoperability.
To highlight the potential of the Functional Mock-up Interface (FMI) standard, we consider a controlled inverted pendulum.
On the one hand, both the pendulum's dynamics and the PID controller are modeled using OpenModelica - a tool dedicated to the development of continuous systems.
The input and environment models, on the other hand, have been developed in AutoFOCUS 3 and Overture respectively - both representing models with a discrete notion of time.
......@@ -171,7 +175,7 @@
<h3>Overture</h3>
<ol>
<li><a target="_blank" rel="noopener noreferrer" href="http://overturetool.org/download/">Download</a>, unzip and launch Overture</li>
<li><a target="_blank" rel="noopener noreferrer" href="http://overturetool.org/download/">Download</a>, unzip and launch Overture (tested with Version 3.0.0)</li>
<li>Install the FMI exporter for Overture following these instructions: <a target="_blank" rel="noopener noreferrer" href="https://into-cps-association.github.io/constituent-model-development/overture/fmi-support.html">FMI support for Overture</a></li>
<li>Download the following Overture project: <a href="./gettingStarted/dat/overture_environment.zip">Environment Model</a></li>
<li>Import the project: <b>'File &rarr; Import... &rarr; General &rarr; Existing Projects into Workspace &rarr; Select archive file'</b></li>
......@@ -180,7 +184,7 @@
<h3>OpenModelica</h3>
<ol>
<li><a target="_blank" rel="noopener noreferrer" href="https://openmodelica.org/">Download</a></td> and install OpenModelica</li>
<li><a target="_blank" rel="noopener noreferrer" href="https://openmodelica.org/">Download</a></td> and install OpenModelica (tested with version 1.14.{1/2} (Windows/Linux)</li>
<li>Download the following OpenModelica model: <a href="./gettingStarted/dat/openmodelica_system.mo">System &amp; Controller Model</a></li>
<li>Launch OMEdit - OpenModelica Connection Editor</li>
<li>Import the project: <b>'File &rarr; Open Model/Library Files(s)'</b> and open it by double-clicking <tt>openmodelica_system</tt></li>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment