1 / 33

JuliaSim: Digital Twins for Scientists and Engineers

JuliaSim is an acausal modeling platform designed by JuliaHub to integrate scientific machine learning (SciML) into modern modeling and simulation. This talk was given as part of the 2023 International Modelica Conference to experienced introduce modelers and engineers to the JuliaSim system for developing models with speed and performance. We will showcase how traditional modeling software can be enhanced to allow for sophisticated stochastic modeling, partial differential equations, and more in order to bring modeling and simulation to a form for automated digital twins.

Télécharger la présentation

JuliaSim: Digital Twins for Scientists and Engineers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. JuliaSim: Scientific Machine Learning and Digital Twins for System-Level Modeling September, 2023

  2. Julia Language

  3. Julia is a high-level language that is faster than R and Python expressive

  4. The Julia Community Is Growing!

  5. Julia: The Next Generation Technical Computing Language ● Purpose built from the ground up for technical computing ● Solves the “Two Language Problem” ● Vibrant and growing ecosystem ● 5th most loved programming language according to StackOverflow! More loved that Python (#6), R (#28) and MATLAB (#36)

  6. The SciML Organization

  7. SciML: Open Source Tooling For Modeling and Simulation 1. 50x faster than SciPy 2. 50x faster than MATLAB 3. 100x faster than R’s deSolve 4. Methods that outperform classic C and Fortran methods (CVODE, DASSL) , Christopher, and Qing Nie. "Confederated modular differential equation APIs for accelerated algorithm development and benchmarking." Advances in Engineering Software 132 (2019): 1-6. 5. Specialized situational methods (IMEX, stage parallel, etc.) 6. Parallelism (+ GPUs) https://docs.sciml.ai/SciMLBenchmarksOutput/stable/ Rackauckas, Christopher, and Qing Nie. "Differentialequations.jl–a performant and feature-rich ecosystem for solving differential equations in julia." Journal of Open Research Software 5.1 (2017). Rackauckas, Christopher, and Qing Nie. "Confederated modular differential equation APIs for accelerated algorithm development and benchmarking." Advances in Engineering Software 132 (2019): 1-6.

  8. Modeling and Simulation Tools Across the Spectrum of Mathematics LinearSolve.jl: Unified Linear Solver Interface Optimization.jl: Unified Optimization Interface NonlinearSolve.jl: Unified Nonlinear Solver Interface Integrals.jl: Unified Quadrature Interface DifferentialEquations.jl: Unified Interface for all Differential Equations Unified Partial Differential Equation Interface The SciML Common Interface for Julia Equation Solvers https://scimlbase.sciml.ai/dev/

  9. Data + Physics = Scientific Machine Learning

  10. What is Scientific Machine Learning (SciML)? Scientific Computing ↔ Machine Learning Scientific Computing Scientific Machine Learning Machine Learning Neural Nets Bayesian Modeling Automatic Differentiation ● ● Differentiable Simulators Surrogates and ROM Inverse Problems & Calibration Automatic Equation Discovery Applicable to Small Data ● ● ● ● ● Model Building Robust Solvers Control Systems ● ● ● ● and more …. 10

  11. JuliaSim Model Discovery: Autocompleting Models with SciML Julia Computing

  12. Universal Differential Equations Predict Chemical Processes UDEs in advection-diffusion transform the learning problem to low dimensional spaces where small data is sufficient

  13. Universal Differential Equations Predict Chemical Processes Recovers equations with the same 2nd order Taylor expansion Santana, V. V., Costa, E., Rebello, C. M., Ribeiro, A. M., Rackauckas, C., & Nogueira, I. B. (2023). Efficient hybrid modeling and sorption model discovery for non-linear advection-diffusion-sorption systems: A systematic scientific machine learning approach. Chemical Engineering Science

  14. ModelingToolkit

  15. ModelingToolkit: Acausal Component-Based Modeling Heavily Inspired By Modelica ● ● Fully open source modeling language Comes with the “standard” transformations required for component-based modeling (tearing, Pantelides algorithm, etc.) Fully open source standard library based on the Modelica Standard Library ○ Currently incomplete and taking contributions! Allows users to customize and write their own symbolic model transformations and alternative front ends ● ●

  16. ModelingToolkit: Taking Acausal Component-Based Modeling Beyond DAEs ● Sets up a stochastic delay differential equation (SDDE) with driving white noise ● Solved using (implicit) high-order adaptive SDDE solvers ● Can be used to model difficult components like sensors

  17. ModelingToolkit Feature Highlight: Sophisticated Stochastic Modeling Chemical Reaction Systems as Stochastic Models

  18. ModelingToolkit Feature Highlight: Sophisticated Stochastic Modeling Transform the stochastic model into an approximating deterministic model:

  19. ModelingToolkit Feature Highlight: Sophisticated Stochastic Modeling Transform the stochastic model into an approximating deterministic model Of means and moments This sounds like a problem for a symbolic modeling tool to figure out for you… You can write out the moments…

  20. ModelingToolkit Feature Highlight: Sophisticated Stochastic Modeling Solution for the means and variances computed via an ODE!

  21. ModelingToolkit PDEs: Method Of Lines Finite Difference

  22. ModelingToolkit PDEs: Physics-Informed Neural Networks Easy and Customizable PINN PDE Solving with NeuralPDE.jl, JuliaCon 2021

  23. ModelingToolkit PDEs: Extensible PDE Interface Coming soon: Finite Volume methods Spectral methods Finite element methods … Attempting to unify the difference PDE discretization methods into a one interface compatible with component-based modeling!

  24. JuliaSim

  25. Building an Ecosystem on Open Source Foundations JuliaSim enhances and extends ModelingToolkit for industrial users Transform ModelingToolkit models into digital twins with easy calibration to data. Documentation at: help.juliahub.com

  26. JuliaSim at a Glance

  27. JuliaSim: Accelerate Modeling with Component Libraries 4 more libraries in the roadmap: Media Fluid Aerial Vehicles Process Modeling ● ● ● ● This roadmap is not fixed and is looking for input from you!

  28. ARPA-E Accelerated Simulation of Building Energy Efficiency The Julia implementation is 6x faster than Dymola for the full cycle simulation. 8,000 ODE Highly stiff vapor-compression cycle model Dymola reference model: 35.3 s Julia (as close to) equivalent model: 5.8 s Could be due to details such as the linear solvers, the refrigerant property libraries, etc. More benchmarking to come. ● ● ● Using CTESNs as surrogates improves simulation times between 10x-95x over the Julia baseline. Acceleration depends on the size of the reservoir in the CTESN. The surrogate approximates 20 of the observables. Training set size Reservoir size Prediction time Speedup over baseline 100 1000 0.06 s 95x 1000 2000 0.56 s 10x Error is < 5% in all cases. Total speedup over Dymola: 60-570x

  29. Accelerate large simulations without retraining MODULES JuliaSim Surrogates You bring physics, we bring machine learning. Together we achieve fast simulation. NEURAL NETWORK Accelerate large simulations with ML-surrogates Connect surrogate models in Modeling Toolkit 100x FASTER SIMULATION SYSTEMS MODEL MULTIPHYS ICS MODEL EMBED SURROGATES Total speedup 570x

  30. JuliaSim Batteries overview 2D electrochemical model of a single battery ○ 300 equations, 5 ms solve time Battery pack: repeat the model 200 times ○ Very long simulation time ○ Most tools cannot scale physically-accurate models to full packs ■ ■ 31

  31. Digital Echo on Live Battery Models

  32. Interested to guide the direction of ModelingToolkit? Come talk to us about the MTK Insiders Program! For more information about Julia, ModelingToolkit, and JuliaSim, Contact us at info@juliahub.com October, 2023

More Related