Skip to content

Commit

Permalink
Add 'DrModelica/' from commit '4aebc12187da9e57445cec7f37d41bd99709bf47'
Browse files Browse the repository at this point in the history
git-subtree-dir: DrModelica
git-subtree-mainline: 75965dc
git-subtree-split: 4aebc12
  • Loading branch information
sjoelund committed May 6, 2015
2 parents 75965dc + 4aebc12 commit 1799708
Show file tree
Hide file tree
Showing 207 changed files with 48,188 additions and 0 deletions.
256 changes: 256 additions & 0 deletions DrModelica/AccessControl/AccessDemo.onb

Large diffs are not rendered by default.

89 changes: 89 additions & 0 deletions DrModelica/AccessControl/Exercise1.onb
@@ -0,0 +1,89 @@
<!DOCTYPE OMNotebook>
<Notebook>
<GroupCell closed="false" >
<GroupCell closed="false" >
<TextCell style="Title" >
<Text>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Arial; font-size:38pt; font-weight:600; color:#000000;">Exercise 1&lt;/p>&lt;/body>&lt;/html></Text>
</TextCell>
<GroupCell closed="false" >
<TextCell style="Section" >
<Text>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Times; font-size:18pt; font-weight:600; color:#000000;">Access Control&lt;/p>&lt;/body>&lt;/html></Text>
</TextCell>
<TextCell style="Text" >
<Text>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Times New Roman; font-size:12pt; color:#000000;">&lt;br />Complete the classes &lt;span style=" font-family:Courier New;">Access &lt;/span>and&lt;span style=" font-family:Courier New;"> Acc &lt;/span>below. The variable &lt;span style=" font-family:Courier New;">acc&lt;/span> is an instance of the class &lt;span style=" font-family:Courier New;">Acc&lt;/span>, which contains the variables &lt;span style=" font-family:Courier New;">a, b, c, d&lt;/span> and &lt;span style=" font-family:Courier New;">e&lt;/span>, where &lt;span style=" font-family:Courier New;">d&lt;/span> and &lt;span style=" font-family:Courier New;">e&lt;/span> are protected. Where can the variables be set? Set a = 7.4 in the class Access.&lt;/p>&lt;/body>&lt;/html></Text>
</TextCell>
<InputCell style="Input" closed="true" >
<Input>class Access
...
equation
...
end Access;</Input>
<Output></Output>
</InputCell>
<TextCell style="Text" >
<Text>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Times New Roman; font-size:12pt; color:#000000;">&lt;/p>&lt;/body>&lt;/html></Text>
</TextCell>
<InputCell style="Input" closed="true" >
<Input>class AccessInst
Access acc;
end AccessInst;</Input>
<Output></Output>
</InputCell>
<GroupCell closed="false" >
<TextCell style="Subsection" >
<Text>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Times; font-size:14pt; font-weight:600; color:#000000;">Answer&lt;/p>&lt;/body>&lt;/html></Text>
</TextCell>
<TextCell style="Text" >
<Text>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Times New Roman; font-size:12pt; color:#000000;">The public variables &lt;span style=" font-family:Courier New;">a, b&lt;/span> and &lt;span style=" font-family:Courier New;">c&lt;/span> can be set in either class, while &lt;span style=" font-family:Courier New;">d&lt;/span> and &lt;span style=" font-family:Courier New;">e&lt;/span> must be set in class &lt;span style=" font-family:Courier New;">Acc&lt;/span>. The variable a must be a parameter, since we want to change it in the class Access.&lt;/p>&lt;/body>&lt;/html></Text>
</TextCell>
<InputCell style="Input" closed="false" >
<Input>class Access
parameter Real a;
Real b;
Real c;
protected
Integer d, e;
equation
b = 2.0;
c = 1.3;
d = 5;
e = 7;
end Access;</Input>
<Output>Ok</Output>
</InputCell>
<TextCell style="Text" >
<Text>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Times New Roman; font-size:12pt; color:#000000;">&lt;br />Since a is a parameter it can not be changed during simulation, so it can not be modified in the equation section.&lt;/p>&lt;/body>&lt;/html></Text>
</TextCell>
<InputCell style="Input" closed="false" >
<Input>class AccessInst
Access acc(a = 7.4);
end AccessInst;</Input>
<Output>Ok</Output>
</InputCell>
<TextCell style="Text" >
<Text>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Times New Roman; font-size:12pt; color:#000000;">&lt;/p>&lt;/body>&lt;/html></Text>
</TextCell>
<GroupCell closed="false" >
<TextCell style="Subsubsection" >
<Text>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Times; font-size:12pt; font-weight:600; color:#000000;">Simulation of Access and AccessInst&lt;/p>&lt;/body>&lt;/html></Text>
</TextCell>
<InputCell style="Input" closed="false" >
<Input>simulate( Access );</Input>
<Output>[done]</Output>
</InputCell>
<TextCell style="Output" >
<Text>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Courier New; font-size:11pt; color:#000000;">&lt;/p>&lt;/body>&lt;/html></Text>
</TextCell>
<InputCell style="Input" closed="false" >
<Input>simulate( AccessInst );</Input>
<Output>[done]</Output>
</InputCell>
<TextCell style="Output" >
<Text>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Courier New; font-size:11pt; color:#000000;">&lt;/p>&lt;/body>&lt;/html></Text>
</TextCell>
</GroupCell>
</GroupCell>
</GroupCell>
</GroupCell>
</GroupCell>
</Notebook>

0 comments on commit 1799708

Please sign in to comment.