Date post: | 15-Apr-2017 |
Category: |
Engineering |
Upload: | ba-systemes |
View: | 3,453 times |
Download: | 11 times |
Leveraging Modelica & FMI in Scilab open-source engineering software
September 2015
1© Scilab Enterprises
Yann DEBRAY: [email protected]
: +33 1 80 77 04 73: +49 157 51 49 49 15
Agenda
Introduction
Scilab Use cases
Modelica in Scilab/Xcos
Scilab/Xcos FMI import/export
Demonstrations
Questions - Answers
2© Scilab Enterprises
Introduction
Scilab History
Scilab Today
Scilab Distribution
3© Scilab Enterprises
Scilab History1980:
First Scilab Kernel
= Free Matlab
1990 - 2003:
1994: Scilab freely distributed
on the net
2003 - 2012: Scilab
Consortium
2012 - Today: Scilab
Enterprises drives the
evolution of Scilab
4
1980 – 1990:
INRIA – French national research institute for
Informatics & Automation
Integration of ModelicaSince 2005
© Scilab Enterprises
Scilab Today
From www.scilab.org
~ 100 000 monthly installations from 150 countries
5© Scilab Enterprises
Scilab Open Source DistributionWorkstation Software:
ScilabPowerful Computation Engine
XcosDynamic Systems Modelling and Simulation
Server Software:
ATOMS ServerModules/Toolboxes Management
6© Scilab Enterprises
Scilab Use cases
Main references
Industrial use cases
7© Scilab Enterprises
Main Scilab References
Aerospace & Defense: CNES, Astrium, DLR, Safran, Dassault Aviation, DGA, Thales
Automotive: PSA, Renault, Leoni, Valeo, Faurecia, TMD Friction, Continental
Metallurgy: ArcelorMittal, Aperam, Alcan, Eramet
Energy: CEA, EDF, RTE, ABB, Total, IFP, Alstom…
Chemical & Pharmaceutical : Solvay/Rhodia, Sanofi
8© Scilab Enterprises
From R&D to industrial implementation
Execution Engine (based on Scilab)
9
Components from the Model Repository …
… for simulation … in dedicated
applications
Can be used …
© Scilab Enterprises 9
Modelling of a metallurgical reactor
Use of odedc (discrete/continuous ordinary differential equations solver)
© Scilab Enterprises 10
Live Monitoring of Air Handling Units Problem: Heating,
Ventilation, Air Climatisation amounts to60 % of energy bill =500k€/year
oscillations in Air Handling Units control (blue= cooling valve, red= heating valve)
Scilab Solutions:
Energy simulationOPTICLIM (+Excel import)
Energy monitoringModbus over TCP/IP
© Scilab Enterprises 11
Thermal pre-dimensioning of electronic circuit based on Thermal Impedance Goal: Dimension quickly but with enough precision in an early phase
Results: Errors limited to about 3°CBlue = « 0D » Model / Red = CFD Simulations
3 observed points (the 3 junction temperatures)
12© Scilab Enterprises
Post-treatment tools from aero-acoustic data
Thin band spectrum cartographic 2D
Data acquisition (30 GB per test campaign)
Convertion into spectral data (Fourier transform)
Grid definition
Correction matrix
Display
13Fast processing and visualization© Scilab Enterprises
DoE, post-processing and visualization
Modules used
DACE (ATOMS): kriging
NSGA2 : multi-objective optimization
TOPSIS : multicriteria decision making (specific development)
Development of a GUI to explore simulation results (Excel imported)
GUI, graphics, advanced mathematics
© Scilab Enterprises 14
Sizelab: Application for mechanical pre-sizing
15© Scilab Enterprises 15
Scilab used for the mission ROSETTA
Reading/writing inputs/outputs data of Flight Dynamics System (proprietary)
Mission frames transformation
Comets environments
Comets topography andDigital Terrain Model
Statistic and probability analysis
Geometry computations
16
© Scilab Enterprises
Scilab/Xcos + Modelica/FMI
Scilab / Xcos functional coverage
Modelica in Xcos
FMI: Model-Exchange & Co-simulation
17© Scilab Enterprises
© Scilab Enterprises 18
Mathematics
Statistics
Optimization
Signal Processing
Control Systems
A powerful platform with more than 2,000 functions:
Scilab Architecture
19
Scilab
Hardware adaptation
Filetypes
support
GraphicalModelling &
Simulation Xcos
Maths functions
d/dtaX²+bX
Scientific functions
StatsFftw +Signal processing
Optim
User interfaces
Command line Graphing Editor
APIs/extensions:
Language binding
Dynamic linkfunctions
Editor Scinote
HMI/ GUI Builder
Call_scilab
ATOMS Module definition
Sparse Matrix
interpolation
Rand-lib
Language interpreter
AST Types, integer, string, sparse time
Matlab compatibility
compatibility conversion
Development environments
help
LocalizationPreferences
Windows_tools
elementary_functions
Control systems
Xcos: Hybrid Dynamic Systems Modeler & Simulator
Xcos features
GraphicalOutput
GraphicalEditor
HybridSimulation
CustomizablePalettes
Multiphysicssimulation
Simulation Acceleration
Xcos external modules
Finite State Machine
Embedded Code Generation
FunctionalMockupInterface
20© Scilab Enterprises
© Scilab Enterprises 21
Discrete Simulation The observation of a phenomenon is
activated by an event. During the
activation, the state of the system
changes et programs future events.
Continuous Simulation Observation of a phenomenon
during a fixed and regular step time.
Hybrid Simulation The observation of a phenomenon
is made during a fixed time step, but
can also be activated by an event.
Model building in Xcos
© Scilab Enterprises 22
To compute and plot the values of I1 and I2:
We obtain that:
Modelica integration in Xcos
© Scilab Enterprises 23
Real lifeXcos and Modelica
© Scilab Enterprises 24
Xcos standard causal blocks
Equation:
Block: written in C, Scilab language
𝑦 = 𝑓 𝑢
Equation:
Block: written in Modelica language
Xcos acausal blocks
𝑓 𝑦, 𝑢 = 0
How does it work?
© Scilab Enterprises 25
Modelica compiler embedded into Xcos
1. Flattening process
2. Solution of the DAE and
generation of an equivalent
simulation function in C
(causal): the implicit subset is
replaced par an equivalent
superblock for the simulation
3. Compilation and dynamic
linking to Scilab
Conclusion: Scilab+Xcos+Modelica--> mixed Xcos/Modelica modelling
--> Integrated graphical environnement in a powerful pre-/post-processing engine: Scilab!
Modelica compiler written in Ocamlsupport only a subset of Modelica 2.0
--> Help us integrate the OpenModelica Compiler
FMI: Model-Exchange & Co-simulation
Scilab/XcosControl team
Software AThermal team
FMUimport/export
--> Separate the model authoring tool from the model execution tool
--> Deploy from few simulation specialists to designers, domain specialists, …
Demonstrations
Automotive suspension with Scilab / Xcos / Modelica
FMI in Xcos
Xcos Parameter identification with fminsearch
Datafitting with Excel data
Xcos solvers
28© Scilab Enterprises
Three ways for Physical modelling with Scilab/Xcos
1. Scilab: Simple mathematical description with Ordinary Differential Equations
2. Xcos: Causal description with transfert functions
3. Coselica: Acausal description with multi-physical block
example: Automobile suspension
© Scilab Enterprises 29
Ordinary Differential Equations (ODE) in Scilab
function yp=quarter_car_ode(t, y)v = 4; // Speed [m/s]m = 50; c_F = 10000; // [N/m]c_D = 400; // [Ns/m]x = v*t ; yp = [y(2);1/m*(c_D*(v*zp-y(2))+c_F*(z-y(1)))];
endfunction
t = linspace(t0,t1); y= ode("rkf",[0;0],t0,t,quarter_car_ode);
© Scilab Enterprises 30
Causal design with Xcos:Automotive suspension from PSA
© Scilab Enterprises 31
Acausal with Modelica blockset in Xcos
© Scilab Enterprises 32
Demo Xcos FMI Cruise Control
33© Scilab Enterprises
• Modelled in SCADE Simulated in Xcos
--> Link to established specialized proprietary software
Demo Xcos FMI PID Controller
34© Scilab Enterprises
• The same PID Controller natively and imported with model-exchange and co-simulation:
--> Fidelity in simulation, ease to model
Xcos Parameter identification with fminsearch
35© Scilab Enterprises
Datafitting with Excel data
36© Scilab Enterprises
Xcos solvers
37© Scilab Enterprises
Conclusion
Scilab/Xcos + Modelica/FMI =– Advanced simulation technologies, with the strength of
having a powerful computation platform
– Committed to open standards
– Let us do more in this direction together
Adopt Scilab, choose the open source
© Scilab Enterprises 38