Advanced Tutorial Exercises
16 pages
English

Advanced Tutorial Exercises

-

Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres
16 pages
English
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres

Description

Advanced Modelica TutorialExercisesHilding Elmqvist, DynasimMartin Otter, DLRRefine MultiBody/EngineMake Engine example model a reusable component1. Manage parameters2. Allow changing number of cylinders3. Test rig with replaceable engineAdvanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003 2Use Cylinder from Library MultiBodyAdvanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003 3Package structuringFirst create package Then create models, etc within the packageAdvanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003 4Task 1. Handling of parameters• Now – multiple selectDependent on experimentCommon to all cylindersSpecific for each cylinderOK as defaultAdvanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003 5Parameter record• Introduce parameter record for common parameters– Record gives possible reuse of data in different engine configurations– Propagate record elements to individual parameters– Introduce tabs and groupsAdvanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003 6To build record in the GUICreate record Change of setting neededcylinderParameters and insert parameters.Drag and dropAdvanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003 7Copy and paste alternativeDelete this lineContext menu (after paste)Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003 8Create MyCylinderCreate modelMyCylinder and insert a ...

Informations

Publié par
Nombre de lectures 71
Langue English

Extrait

Advanced Modelica Tutorial Exercises
Hilding Elmqvist, Dynasim Martin Otter, DLR
Refine MultiBody/Engine
Make Engine example model a reusable component 1. Manage parameters 2. Allow changing number of cylinders 3. Test rig with replaceable engine
Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003
2
Use Cylinder from Library MultiBody
Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003
Package structuring
First create package
3
Then create models, etc within the package
Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003
4
Task 1. Handling of parameters
 Now  multiple select
Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003  
Parameter record
Dependent on experiment
Common to all cylinders
Specific for each cylinder OK as default
 Introduce parameter record for common parameters  Record gives possible reuse of data in different engine configurations  Propagate record elements to individual parameters  Introduce tabs and groups
Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003
5
6
To build record in the GUI cCyrlienadtee r r P e a c r o a r m d eters and Change of setting needed insert parameters.
Drag and drop
Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003
Copy and paste alternative
Context menu (after paste)
Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003
7
Delete this line
8
Create MyCylinder Create model MyCylinder and insert a cylinder from the MultiBody library and a parameter record.
Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003
Propagate parameters Propagate each parameter in the record to the corresponding parameter of the MultiBody cylinder. Point to the input field and click the right mouse button and create Component reference.
Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3 4, 2003 -
9
10
Add remaining parameters Add remaining 3 parameters.
Test MyCylinder by creating a component in Unnamed and double clicking it.
Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003
Hierarchical dialogs
Introduce tabs and groups
Resulting dialog with tabs and groups
Improve dialog by introducing tabs and groups.
Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003
11
12
Propagate connectors
Propagate connectors by drawing connections. At end point, click right mouse button and select Create connector
Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003
Resulting Modelica code
Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003
13
14
Introduce World object and Revolute joint
Make MyEngine
 Axis of rotation for Revolute joint is x-axis  Set initial angular velocity to 1 deg/s  Simulate for 0.1 second
Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003
Declare parameter set
Declare a parameter set by extending the parameter record.
Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003
15
16
Make parameter set
Give values to the parameter set by using the Parameter command of the extended class. Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003
Use parameter set
Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003
17
Instead of using the hierarchical parameter dialog, use the Select Record command to create a record constructor referring to the predefined parameter set.
18
Resulting Modelica Code
Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003
Task 2. Array of cylinders
 Make array of cylinders  Propagate parameter record to each cylinder  Introduce arrays of individual angles  Use for loop to connect them
Duplicate MyEngine. Call it MyEngineN. It will contain n cylinders.
Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003
19
20
MyCylinder parameter dialog MyEngineN parameters:
For MyEngineN introduce a parameter record, n and the angle vectors. Introduce an array of cylinders [n] and propagate the parameters. Use the each keyword to the cylinder parameters since all the cylinders have the same set.
Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003
Cylinder array connections
Advanced Modelica Tutorial - Exercises, Modelica'2003, Nov. 3-4, 2003
Use Modelica Text mode to generate a for statement and make the connections.
21
22
  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents