Scicos/Modelica for modeling and simulation

Similar documents
Heterogeneous Modeling: Hybrid Systems

Selection of Variables in Initialization of Modelica Models

Real-Time Execution in NI VeristandTM

Real-Time Execution in LabVIEWTM

Activation Inheritance in Modelica

Modeling Technical Systems [ ] Mag MA MA Schweiger Gerald TU Graz Spring 2017

Modeling and Simulation in Scilab/Scicos with ScicosLab 4.4

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Proceedings of the 4th International Modelica Conference, Hamburg, March 7-8, 2005, Gerhard Schmitz (editor)

Multi-core Simulation of Internal Combustion Engines using Modelica, FMI and xmod

Software-Entwicklungswerkzeuge

Software-Entwicklungswerkzeuge. Modelica Overview. Contents. 1. Modelica Introduction. 2. Modelica Users View. 3. Modelica Libraries

From Physical Modeling to Real-Time Simulation : Feed back on the use of Modelica in the engine control development toolchain

Importing Models from Physical Modeling. Tools Using the FMI Standard

ONE DIMENSIONAL (1D) SIMULATION TOOL: GT-POWER

Hybrid dynamics in Modelica: should all events be considered synchronous. Ramine Nikoukhah INRIA. Modelica/Scicos

Model Based Systems Engineering Engine Control: from concept to validation. Jan Smolders Technical Account Manager

Using SPARK as a Solver for Modelica. Michael Wetter Philip Haves Michael A. Moshier Edward F. Sowell. July 30, 2008

Engine Calibration Process for Evaluation across the Torque- Speed Map

Partitioned Control Challenge Problem

Flow in an Intake Manifold

Variable Structure Modeling for Vehicle Refrigeration Applications

HIGH PERFORMANCE NUMERICAL SIMULATIONS TO SUPPORT SYSTEM LEVEL DESIGN. Joshua D. Carl. Dissertation. Submitted to the Faculty of the

Modeling Kernel Language (MKL)

A Synchronous-based Code Generator For Explicit Hybrid Systems Languages

Introduction to C omputational F luid Dynamics. D. Murrin

Better Building Controls Through Simulation

Modeling Structural - Dynamics Systems in MODELICA/Dymola, MODELICA/Mosilab and AnyLogic

This is the published version of a paper presented at IEEE PES General Meeting 2013.

POTENTIAL AND BENEFITS OF FUNCTIONAL MOCK-UP INTERFACE - FMI FOR VIRTUAL VEHICLE INTEGRATION

A Methodology for Improving Software Design Lifecycle in Embedded Control Systems

Modeling and Simulation for Heterogeneous systems

MapleSim User's Guide

Modeling, Simulation and Analysis of Integrated Building Energy and Control Systems. Michael Wetter. October 8, 2009

Experiment 8 SIMULINK

Debian for Scientific Facilities Days Sylvestre Ledru / June 25, 2012

Progress on Engine LES Using STAR-CD

Engine Plant Model Development and Controller Calibration using Powertrain Blockset TM

SimTK 1.5 Workshop Installation and Components. Jack Middleton September 25, 2008

Object-Oriented Modeling with Rand Model Designer

Using a Single Rotating Reference Frame

Modelling of Hybrid Electric Vehicle Components in Modelica. And Comparison with Simulink THESIS

An Overview of Computational Fluid Dynamics

Creation and Validation of a High-Accuracy, Real-Time-Capable Mean-Value GT-POWER Model

MODELING IN SCILAB: PAY ATTENTION TO THE RIGHT

Physics Tutorial 2: Numerical Integration Methods

Model-Based Development of Multi-Disciplinary Systems Challenges and Opportunities

Modelica3D. Platform Independent Simulation Visualization. Christoph Höger. Technische Universität Berlin Fraunhofer FIRST

Equation-Based Model Data Structure for High Level Physical Modelling, Model Simplification and Modelica-Export

Comparison of Classic and Finned Piston Reciprocating Linear Air Compressor Using COMSOL Multiphysics

Master Class: Diseño de Sistemas Mecatrónicos

Open Compute Stack (OpenCS) Overview. D.D. Nikolić Updated: 20 August 2018 DAE Tools Project,

Flight Systems are Cyber-Physical Systems

How Combustion CFD Makes Design More Robust and Reduces Costs

ICE Roadmap Japanese STAR Conference. Richard Johns

Simulation-Based Design of Robotic Systems

Auto Injector Syringe. A Fluent Dynamic Mesh 1DOF Tutorial

INTRODUCTION. Warning: it is strongly recommended to always verify whether the ECU needs specific software settings to export data.

INTEROPERABILITY WITH FMI TOOLS AND SOFTWARE COMPONENTS. Johan Åkesson

Modeling physical properties. Controller, plant and environment model

Modeling Guidelines and Tools Comparison for Mechatronics System Design in Automotive Applications - Application to a Motorized Hatchback -

An added mass partitioned algorithm for rigid bodies and incompressible flows

QoS support for Intelligent Storage Devices

ELEC 5260/6260/6266 Embedded Computing Systems

INTRODUCTION. Warning: it is strongly recommended to always verify whether the ECU needs specific software settings to export data.

Cold Flow Simulation Inside an SI Engine

Vi-PEC V44 and V88 ECU

DAE Tools: An equation-oriented process modelling and optimization software

Simulation of Mechatronic Systems

1. INTRODUCTION. Constrained Control Allocation for Systems with Redundant Control Effectors

Learning algorithms for physical systems: challenges and solutions

Recent developments in simulation, optimization and control of flexible multibody systems

Computer Controlled Axial Flow Gas Turbine/ Jet Engine, with SCADA TGFAC

Functional Mockup Interface for Tool and Model Interoperability

Create idrawnics enabled SketchUp components with Stick and Flip Data Plates Catalog Lookup Customizable Time and Materials

Requirements for the Simulation of Complex Heterogeneous Systems

Instantaneous Cylinder Pressure Estimation

Introduction to Physical Modelling Rory Adams Senior Application Engineer

Subject: 1999 Nissan Maxima A32, VQ30DE, USA OBD2 Compliant, Consult Data Registers

Applications of ICFD /SPH Solvers by LS-DYNA to Solve Water Splashing Impact to Automobile Body. Abstract

Automotive Fluid-Structure Interaction (FSI) Concepts, Solutions and Applications. Laz Foley, ANSYS Inc.

Scicos is a Scilab toolbox included in the ScicosLab package. The Scicos editor can be opened by the scicos command

Modeling of the wet end part of a paper mill with Dymola

MATLAB Expo Simulation Based Automotive Communication Design using MATLAB- SimEvent. Sudhakaran M Anand H General Motors

Multi-bond Graphs. Table of Contents. A Planar Pendulum

Introduction to Simulink

Coupling of Simulation Tools - Building Controls Virtual Test Bed Michael Wetter. August, 2010

Yosuke Ogata 1) Bruno Loyer 2) Antoine Viel 3)

Modelica. Language, Libraries, Tools, Workshop and EU-Project RealSim

Introduction to Control Systems Design

Development of a CFD methodology for fuel-air mixing and combustion modeling of GDI Engines

Objective Determination of Minimum Engine Mapping Requirements for Optimal SI DIVCP Engine Calibration

Motivation Thermal Modeling

Vi-PEC V44 and V88 ECU

I-7565-DNM FAQ. ICP DAS Co., LTD 1

Experiment 6 SIMULINK

THE STUDY OF SLIDER CRANK MECHANISM USING MATLAB AND SCILAB

Scicos extension for matrix data type

Simulation-based development of automotive control software with Modelica

Characteristic Aspects of SPH Solutions

Transcription:

Scicos/Modelica for modeling and simulation Masoud Najafi, INRIA-Rocquencourt Zakia Benjelloun-Dabaghi, IFP Présentation à la journée LMCS, 17 avril 2008, EDF

Outline Introduction to Scilab & Scicos Modeling approaches Overview on Modelica Idle speed engine control Drilling station 2

Introduction to Scilab and Scicos Scilab: A Free and Open-source software for scientific computing. Scicos: A toolbox in Scilab for Modeling and Simulation of hybrid dynamical systems Available for Unix Work Stations, Linux, Windows, and Mac OSx Available at www.scicos.org 3

4

5

6

7

Modeling approaches A model is build by interconnecting blocks Causal modeling (system based modeling) Acausal modeling (component based modeling) Modeling this physical systems 8

Causal modeling (explicit blocks) Inputs and outputs ports are explicitly defined In the model there is a information flow The input/output behavior is written in C or Fortran They are considered as black boxes by Scicos An explicit block x = Ax + Bu y = Cx + Du 9

Causal modeling (explicit blocks) To model with explicit blocks the user should write all equations manually Then the user should simplify the equations to obtain an ordinary differential equation (ODE/DAE) V C + Vs VR VC = 0 IC VC = C VR = ICR Output = VC V C = VS RC VC RC 10

Causal modeling (explicit blocks) Constructing the model using explicit blocks based on the ODE Time consuming, error prone, no similarity V C V C + V C = VS RC VC RC 11

Acausal modeling (Implicit blocks) Have implicit ports (not a priory inputs or outputs) Each implicit block represents a physical component + V C An implicit block I C = C dv dt C 12

Acausal modeling (Implicit blocks) Connected with special links (no flow direction) Modeling is just connecting the components The model looks like the physical system The behavior is written in the Modelica language 13

Example: Drilling station 14

Example: Drilling station (causal) 15

Example: Drilling station (acausal or component based) 16

What is Modelica? Declarative instead of procedural Object oriented modeling language Typed language Standardized by Modelica consortium Allows heterogeneous models (multi-domain models) Modeling using components Equation based, i.e., using mathematical equations Hybrid modeling, i.e., event-based and continuous-time models. 17

Advantages of Modelica: Modelica is a non property language and exists since 1996. Distributed under GPL. The Modelica models, being independent of the tool, can be simulated on any Modelica simulator. Available tools: Scicos, AMESim, Dymola, OpenModelica, SimulationX, Several free and commercial libraries are available. Non-causal modeling: using a single model for all causalities Symbolic analysis: model size reducing Inverse model is done by changing the input/outputs in the model Parameter sizing is done by the same model 18

Modelica in Scicos Scicos is originally a simulator based on causal systems, i.e., blocks with explicit inputs and outputs In 2002, the RNTL Simpa project with the participation of INRIA, Imagine, EDF, IFP,... started to develop Scicos to support modeling and simulation of Modelica models. 19

Modelica in Scicos In 2006, the ANR Simpa2 project started with the collaboration of INRIA, LMS.Imagine, IFP, EDF, INSA, PSA, Now, Scicos uses a free/open-source Modelica compiler (Modelicac) developed at LMS.Imagine Co. Support for most essential continuous-time features (index-1 DAE) Modeling discrete-time systems and event synchronism 20

Available toolboxes in Scicos Thermo-hydraulic toolbox (EDF) 21

Example: A cooling system (EDF) 22

Available toolboxes in Scicos Electrical (Modelica library) 23

Example: Difference amplifier 24

Short demonstration in Scicos Ball and platform class Ball_Platform parameter Real g=9.8; parameter Real m1=0.50; //platformkg parameter Real m2=0.30;//kg parameter Real k=2; //Kg/sec Real y1(start=11),v1(start=0);//platform Real y2(start=15),v2(start=1);//ball Real y0; discrete Real v1p,v2p; equation der(y1)=v1; m1*der(v1)=if noevent(v1<0.001 and v1>-0.001) then 0 else -m1*g-k*(y1-y0)-0.2*v1; der(y2)=v2; der(v2)=if noevent(v2<0.001 and v2>-0.001) then 0 else -g; when y2<y1 then v1p=(m1*v1+2*m2*v2-m2*v1)/(m1+m2); v2p=(m2*v2+2*m1*v1-m1*v2)/(m1+m2); reinit(v1,v1p*0.98); reinit(v2,v2p*0.98); end when; end Ball_Platform; 25

Two industrial models in Scicos/Modelica

Automotive test case Spark-ignited (SI) four cylinders engine, Mean value engine (0D) Ignoring fast event and high frequency Using average of cyclical dynamics Used in engine control strategy Speed, torque, Manifold pressure Engine control 27

Mean value engine model Principal Sketch of the engine Air intake throttle Intake manifold Canister EGR Combustion chamber Crankshaft dynamics 6 Modelica blocks 28

Mean value engine model - Air intake valve Air Intake throttle Controls the intake air flow rate Modeled as a flow restriction In low pressure air is incompressible In high pressure air is compressible Now backflow Idle air bypass Two explicit ports (to communicate with standard Scicos) Two implicit ports (modeled by connector in Modelica) 29

Mean value engine model - air intake manifold Air intake manifold Three input flows Mixing air flows Output torque control Isothermal manifold 4 implicit ports for input/output air flows 1 output (explicit) port for pressure sensor used in the controller 30

Mean value engine model - Combustion chamber Combustion chamber Air/fuel mixture enters & reacts Burnt gas are expelled Ignoring effects of the air/fuel ratio Torque production Effects of spark timing advance 3 Implicit ports for input/output airflows and crankshaft connector 1 explicit input for timing advance opt τ gen = F( ω, Pman ) Using external C functions (DLL) τ ge η = n = τ opt gen H (SA ) 31

Engine Idle speed control Controllers for idle mode speed regulation PID: developed in Modelica LQG: developed with Scilab/Scicos blocks Control variables (outputs): Throttle bypass air inputs Spark advance time Observable variables (inputs): Engine rotational speed Pressure in the manifold set points Modelica Controller 32

Engine Idle speed control 33

Engine Idle speed control- Advantages of Modelica Idle speed engine control already modeled in Simulink The Simulink model: More than 200 blocks 30 subsystems 5 levels of hierarchy Slow when using a variable step size solver With Modelica in Scicos: Very few blocks Easy to edit and navigate in the model Using components instead of modules with input/outputs Possibility of doing inverse model and model sizing 34

Drilling station Used for drilling oil/gas wells Composed of Rig Drill pipe Drill collar Drill bit The model is used to predict if the system dysfunctions and detects instabilities 35

Drilling station, Rig Supports the weight of drill-string Control inputs Longitudinal force Longitudinal speed Rotary torque (Observable) outputs Rotary speed Implicit port Connection to drill pipes 36

Drilling station, Drill pipe, Drill collars Drill Pipe and Drill Collars: Composed of several hundred short pipes Due to it length exhibiting torsional, longitudinal, and lateral movements. The drill pipe is discretized into N=15 segments The drill collar is considered as a single segment Drill bit Interaction of Longitudinal and rotational dynamics Using external lookup tables (C functions + DLL libs) 37

Drilling station Already modeled in Simulink The Simulink model is built with 116 subsystems >500 blocks 7 levels of hierarchy Difficult to navigate in the model Fixed-step solver does not converge or needs very small step size Variable-step solver is slows Scicos model Very few blocks Easy to edit and navigate in the model Uses SUNDIALS Using components instead of modules 38

Questions/Demonstration. The Scilab 4.2 is released 17 April 2008. Available at www.scicos.org Try Scicos today! 39