E01 - Two-port electrical resistor in two operating phases (single scenario)ΒΆ

Overview

../../../_images/mpfo-xml_example_01.png

Example 1: Two-port electrical resistor R1 that is operated for several hours in two operating phases at different temperatures.

MPFO-XML Source Code

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
<?xml version="1.0" encoding="UTF-8"?>
<MPFo 
    xmlns:m="http://www.w3.org/1998/Math/MathML"
    xmlns="http://www.mpfo.org/mpfo-0.7"
    xmlns:mml="http://www.w3.org/1998/Math/MathML"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.mpfo.org/mpfo-0.7 http://www.mpfo.org/mpfo-0.7/mpfo.xsd"
    Id="ID.Component.R1" 
    MPFoVersion="0.7">
    
    <Description>Example: Simple two-port electrical resistor R1 that is operated with a DC current for 55h at 298K (25C) and 350h at 423K (150C)</Description>
    
    <!-- External MPFO-XML definitions --> 
    <Include>
        <!-- Include external MPFO standard definitions -->
        <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="http://www.mpfo.org/mpfo-0.7/include/stdlib.xml">
            <!-- Define a fallback include in case the stdlib was not found at the remote location -->
            <xi:fallback>
                <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../../../../include/stdlib.xml"/>
            </xi:fallback>
        </xi:include>
    </Include>
    
    <!-- MPFO-XML document definition -->
    <DocumentDefinition>
        <Documents>
            <!-- Initial document revision --> 
            <Document Id="ID.Doc.0" ShortDescription="Initial version of mission profile document for MPFO-XML example 001" 
                 ModificationTimeStamp="2018-05-04T18:13:51.0" Revision="1">
                <Description>This is document revision 1.0.</Description>
                <Creator Name="Max Mustermann" Organization="mpfo.org" ToolName="MPFW" ToolVersion="1.0" CreationTimeStamp="2018-05-04T18:13:51.0"/>
            </Document>
        </Documents>
    </DocumentDefinition>
    
    <!-- Component port definition: 2 electrical resistor ports (N1, N2) -->
    <PortDefinition>
        <Ports>
            <Port Id="ID.Port.N1" Name="N1" ShortDescription="Electrical device instance terminal N1" Type="inout"/>
            <Port Id="ID.Port.N2" Name="N2" ShortDescription="Electrical device instance terminal N2" Type="inout"/>
        </Ports>
    </PortDefinition>
    
    <!-- Component load definitions -->
    <LoadDefinition>
        <Loads>
            <!-- Definition of the resistor input current as DC current i = 123.4 mA -->
            <Load Id="ID.Load.0" ShortDescription="Input current I0">
                <LoadQuantity Id="ID.QLoad.0" Symbol="I0">
                    <Quantity>
                        <SNumber>0.1234</SNumber>
                        <Unit>
                            <mml:math>
                                <mml:csymbol cd="SI_NamedDerivedUnits1">ampere</mml:csymbol>
                            </mml:math>
                        </Unit>
                    </Quantity>
                </LoadQuantity>
            </Load>
            
            <!-- Definition of the resistor output current as DC current i = -123.4 mA as transformed reference to the load "ID.Load.0" -->
            <Load Id="ID.Load.1" ShortDescription="Output current I1">
                <LoadRef ReferenceLoadRef="ID.Load.0">
                    <TransformationFunction>
                        <FormulaRef Ref="ID.STD.Formula.Negation"/>
                    </TransformationFunction>
                </LoadRef>        
            </Load>
            
            <!-- Environment temperature T1 = 298 K present for a certain period of time -->
            <Load Id="ID.Load.Env.0" ShortDescription="Environment temperature T1 = 298 K for 55 h">
                <LoadQuantity Id="ID.QLoad.Env.0" Symbol="T1">
                    <SymbolicFunction>
                        <!-- Re-usable function template that defines a piecewise function to define a time interval later -->
                        <SymbolicFunctionTemplate Id="ID.Function-constant-temperature"  Symbol="T">
                            <Unit>
                                <mml:math>
                                    <mml:csymbol cd="SI_NamedDerivedUnits1">kelvin</mml:csymbol>
                                </mml:math>
                            </Unit>
                            <Arguments>
                                <ArgumentWithUnit Symbol="t">
                                    <Unit>
                                        <mml:math>
                                            <mml:csymbol cd="SI_BaseUnits1">hour</mml:csymbol>
                                        </mml:math>
                                    </Unit>
                                </ArgumentWithUnit>
                            </Arguments>
                            <Parameters>
                                <ParameterWithUnit Symbol="T1" TeX="T_1">
                                    <Unit>
                                        <mml:math>
                                            <mml:csymbol cd="SI_NamedDerivedUnits1">kelvin</mml:csymbol>
                                        </mml:math>
                                    </Unit>
                                </ParameterWithUnit>
                                <ParameterWithUnit Symbol="t1" TeX="t_1">
                                    <Unit>
                                        <mml:math>
                                            <mml:csymbol cd="SI_BaseUnits1">hour</mml:csymbol>
                                        </mml:math>
                                    </Unit>
                                </ParameterWithUnit>
                            </Parameters>
                            <mml:math>
                                <mml:apply>
                                    <!-- define a piecewise linear function between 0 <= t <= t1 where t1 will be defined later -->
                                    <mml:csymbol cd="piece1">piecewise</mml:csymbol>
                                    <mml:apply>
                                        <mml:csymbol cd="piece1">piece</mml:csymbol>
                                        <mml:ci>T1</mml:ci>
                                        <mml:apply>
                                            <mml:csymbol cd="logic1">and</mml:csymbol>
                                            <mml:apply>
                                                <mml:csymbol cd="relation1">geq</mml:csymbol>
                                                <mml:ci>t</mml:ci>
                                                <mml:cn type="real">0</mml:cn>
                                            </mml:apply>
                                            <mml:apply>
                                                <mml:csymbol cd="relation1">leq</mml:csymbol>
                                                <mml:ci>t</mml:ci>
                                                <mml:ci>t1</mml:ci>
                                            </mml:apply>
                                        </mml:apply>
                                    </mml:apply>
                                </mml:apply>
                            </mml:math>
                        </SymbolicFunctionTemplate>
                        
                        <!-- Assign values to the formula parameters --> 
                        <ParameterValues>
                            <!-- Limit the duration to 55 h -->
                            <ParameterValueMagnitude Symbol="t1">
                                <SNumber>55</SNumber>
                            </ParameterValueMagnitude>
                            <!-- Set temperature to 298 K --> 
                            <ParameterValueMagnitude Symbol="T1">
                                <SNumber>298</SNumber>
                            </ParameterValueMagnitude>
                        </ParameterValues>
                    </SymbolicFunction>
                </LoadQuantity>
            </Load>
            
            <!-- Environment temperature T2 = 423 K present for 350 h -->
            <Load Id="ID.Load.Env.1" ShortDescription="Environment temperature T2=423K">
                <LoadQuantity Id="ID.QLoad.Env.1" Symbol="T2">
                    <SymbolicFunction>
                        <!-- Fortunately, we can also re-use previously defined function templates -->
                        <SymbolicFunctionTemplateRef Ref="ID.Function-constant-temperature"/>
                        
                        <!-- Assign values to the formula parameters --> 
                        <ParameterValues>
                            <!-- Limit the duration to 350 hours -->
                            <ParameterValueMagnitude Symbol="t1">
                                <SNumber>350</SNumber>
                            </ParameterValueMagnitude>
                            <!-- Set temperature to 423K --> 
                            <ParameterValueMagnitude Symbol="T1">
                                <SNumber>423</SNumber>
                            </ParameterValueMagnitude>
                        </ParameterValues>
                    </SymbolicFunction>
                </LoadQuantity>
            </Load>
        </Loads>
    </LoadDefinition>
    
    <!-- Assign loads to ports -->
    <ActionDefinition>
        <Actions>
            <!-- Operating phase 1 (loads are assigned directly to the electrical ports for simplicity reasons) -->
            <Action Id="ID.Action.0" ShortDescription="Operating phase 1: Resistor operation at 298 K for 55 h">
                <Assignments>
                    <!-- Assign loads to port N1 -->
                    <Assignment Id="ID.Action.0.Assignment.N1">
                        <PortRefs>
                            <PortRef Ref="ID.Port.N1"/>
                        </PortRefs>
                        <LoadRefs>
                            <LoadRef Ref="ID.Load.0"/>
                            <LoadRef Ref="ID.Load.Env.0"/>
                        </LoadRefs>
                    </Assignment>
                    <!-- Assign loads to port N2 -->
                    <Assignment Id="ID.Action.0.Assignment.N2">
                        <PortRefs>
                            <PortRef Ref="ID.Port.N2"/>
                        </PortRefs>
                        <LoadRefs>
                            <LoadRef Ref="ID.Load.1"/>
                            <LoadRef Ref="ID.Load.Env.0"/>
                        </LoadRefs>
                    </Assignment>
                </Assignments>
            </Action>
            
            <!-- Operating phase 2 (loads are assigned directly to the electrical ports for simplicity reasons) --> 
            <Action Id="ID.Action.1" ShortDescription="Operating phase 2: Resistor operation at 423 K for 350 h">
                <Assignments>
                    <!-- Assign loads to port N1 -->
                    <Assignment Id="ID.Action.1.Assignment.N1">
                        <PortRefs>
                            <PortRef Ref="ID.Port.N1"/>
                        </PortRefs>
                        <LoadRefs>
                            <LoadRef Ref="ID.Load.0"/>
                            <LoadRef Ref="ID.Load.Env.1"/>
                        </LoadRefs>
                    </Assignment>
                    <!-- Assign loads to port N2 -->
                    <Assignment Id="ID.Action.1.Assignment.N2">
                        <PortRefs>
                            <PortRef Ref="ID.Port.N2"/>
                        </PortRefs>
                        <LoadRefs>
                            <LoadRef Ref="ID.Load.1"/>
                            <LoadRef Ref="ID.Load.Env.1"/>
                        </LoadRefs>
                    </Assignment>
                </Assignments>
            </Action>
        </Actions>
        <ActionSets>
            <ActionSet Id="ID.ActionSet.0">
                <References>
                    <ActionRef Ref="ID.Action.0"/>
                </References>
            </ActionSet>
            <ActionSet Id="ID.ActionSet.1">
                <References>
                    <ActionRef Ref="ID.Action.1"/>
                </References>
            </ActionSet>
        </ActionSets>
    </ActionDefinition> 
    
    <!-- Component activity definition: sequence of operating phases -->
    <ActivityDefinition>
        <!-- Define activities -->
        <Activities>
            <!-- Operating phase 1 -->
            <Activity Id="ID.Activity.0">
                <ActionSetRef Ref="ID.ActionSet.0"/>
            </Activity> 
            <!-- Start operating phase 2 after operating phase 1 -->
            <Activity Id="ID.Activity.1">
                <ActionSetRef Ref="ID.ActionSet.1"/>
            </Activity>
        </Activities>
        <!-- Consider operating phase 2 to start after operating phase 1 -->
        <ActivityFlows>
            <ActivityFlow Id="ID.Activity.Flow.0">
                <ActivityRefs>
                    <ActivityRef Ref="ID.Activity.0"/>
                    <ActivityRef Ref="ID.Activity.1"/>
                </ActivityRefs>
            </ActivityFlow>
        </ActivityFlows>
        <!-- Define a activity flow set -->
        <ActivityFlowSets>
            <ActivityFlowSet Id="ID.Activity.FlowSet.0">
                <References>
                    <ActivityFlowRef Ref="ID.Activity.Flow.0"/>
                </References>
            </ActivityFlowSet>
        </ActivityFlowSets>
    </ActivityDefinition>
    
    <!-- Define an activity scenario for the component and apply/use it -->
    <ScenarioDefinition>
        <!-- Define an application scenario with one activity flow -->
        <Scenarios>
            <Scenario Id="ID.Scenario.0">
                <ActivityFlowSetRefs>
                    <ActivityFlowSetRef Ref="ID.Activity.FlowSet.0"/>
                </ActivityFlowSetRefs>
            </Scenario>
        </Scenarios>
        <!-- Apply the scenarios --> 
        <Application Id="ID.Scenario.Application">
            <ScenarioRefs>
                <ScenarioRef Ref="ID.Scenario.0"/>
            </ScenarioRefs>
        </Application>
    </ScenarioDefinition>
</MPFo>