+ All Categories
Home > Engineering > Scilab Modelica conference 20150921

Scilab Modelica conference 20150921

Date post: 15-Apr-2017
Category:
Upload: ba-systemes
View: 3,453 times
Download: 11 times
Share this document with a friend
38
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
Transcript
Page 1: Scilab Modelica conference 20150921

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

Page 2: Scilab Modelica conference 20150921

Agenda

Introduction

Scilab Use cases

Modelica in Scilab/Xcos

Scilab/Xcos FMI import/export

Demonstrations

Questions - Answers

2© Scilab Enterprises

Page 3: Scilab Modelica conference 20150921

Introduction

Scilab History

Scilab Today

Scilab Distribution

3© Scilab Enterprises

Page 4: Scilab Modelica conference 20150921

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

Page 5: Scilab Modelica conference 20150921

Scilab Today

From www.scilab.org

~ 100 000 monthly installations from 150 countries

5© Scilab Enterprises

Page 6: Scilab Modelica conference 20150921

Scilab Open Source DistributionWorkstation Software:

ScilabPowerful Computation Engine

XcosDynamic Systems Modelling and Simulation

Server Software:

ATOMS ServerModules/Toolboxes Management

6© Scilab Enterprises

Page 7: Scilab Modelica conference 20150921

Scilab Use cases

Main references

Industrial use cases

7© Scilab Enterprises

Page 8: Scilab Modelica conference 20150921

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

Page 9: Scilab Modelica conference 20150921

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

Page 10: Scilab Modelica conference 20150921

Modelling of a metallurgical reactor

Use of odedc (discrete/continuous ordinary differential equations solver)

© Scilab Enterprises 10

Page 11: Scilab Modelica conference 20150921

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

Page 12: Scilab Modelica conference 20150921

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

Page 13: Scilab Modelica conference 20150921

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

Page 14: Scilab Modelica conference 20150921

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

Page 15: Scilab Modelica conference 20150921

Sizelab: Application for mechanical pre-sizing

15© Scilab Enterprises 15

Page 16: Scilab Modelica conference 20150921

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

Page 17: Scilab Modelica conference 20150921

Scilab/Xcos + Modelica/FMI

Scilab / Xcos functional coverage

Modelica in Xcos

FMI: Model-Exchange & Co-simulation

17© Scilab Enterprises

Page 18: Scilab Modelica conference 20150921

© Scilab Enterprises 18

Mathematics

Statistics

Optimization

Signal Processing

Control Systems

A powerful platform with more than 2,000 functions:

Page 19: Scilab Modelica conference 20150921

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

Page 20: Scilab Modelica conference 20150921

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

Page 21: Scilab Modelica conference 20150921

© 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.

Page 22: Scilab Modelica conference 20150921

Model building in Xcos

© Scilab Enterprises 22

To compute and plot the values of I1 and I2:

We obtain that:

Page 23: Scilab Modelica conference 20150921

Modelica integration in Xcos

© Scilab Enterprises 23

Real lifeXcos and Modelica

Page 24: Scilab Modelica conference 20150921

© Scilab Enterprises 24

Xcos standard causal blocks

Equation:

Block: written in C, Scilab language

𝑦 = 𝑓 𝑢

Equation:

Block: written in Modelica language

Xcos acausal blocks

𝑓 𝑦, 𝑢 = 0

Page 25: Scilab Modelica conference 20150921

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

Page 26: Scilab Modelica conference 20150921

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

Page 27: Scilab Modelica conference 20150921

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, …

Page 28: Scilab Modelica conference 20150921

Demonstrations

Automotive suspension with Scilab / Xcos / Modelica

FMI in Xcos

Xcos Parameter identification with fminsearch

Datafitting with Excel data

Xcos solvers

28© Scilab Enterprises

Page 29: Scilab Modelica conference 20150921

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

Page 30: Scilab Modelica conference 20150921

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

Page 31: Scilab Modelica conference 20150921

Causal design with Xcos:Automotive suspension from PSA

© Scilab Enterprises 31

Page 32: Scilab Modelica conference 20150921

Acausal with Modelica blockset in Xcos

© Scilab Enterprises 32

Page 33: Scilab Modelica conference 20150921

Demo Xcos FMI Cruise Control

33© Scilab Enterprises

• Modelled in SCADE Simulated in Xcos

--> Link to established specialized proprietary software

Page 34: Scilab Modelica conference 20150921

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

Page 35: Scilab Modelica conference 20150921

Xcos Parameter identification with fminsearch

35© Scilab Enterprises

Page 36: Scilab Modelica conference 20150921

Datafitting with Excel data

36© Scilab Enterprises

Page 37: Scilab Modelica conference 20150921

Xcos solvers

37© Scilab Enterprises

Page 38: Scilab Modelica conference 20150921

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


Recommended