Click to Edit Master Title Style
Total Page:16
File Type:pdf, Size:1020Kb
Click to edit Master title style APMonitor Modeling Language John Hedengren Brigham Young University Advanced Process Solutions, LLC http://apmonitor.com Overview of APM Software as a service accessible through: MATLAB, Python, Web-browser interface Linux / Windows / Mac OS / Android platforms Solvers 1 1 2 3 3 APOPT , BPOPT , IPOPT , SNOPT , MINOS Problem characteristics: min J (x, y,u, z) Large-scale x s.t. 0 f , x, y,u, z Nonlinear Programming (NLP) t Mixed Integer NLP (MINLP) 0 g(x, y,u, z) Multi-objective 0 h(x, y,u, z) n m m Real-time systems x, y u z Differential Algebraic Equations (DAEs) 1 – APS, LLC 2 – EPL 3 – SBS, Inc. Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC Overview of APM Vector / matrix algebra with set notation Automatic Differentiation st nd Exact 1 and 2 Derivatives Large-scale, sparse systems of equations Object-oriented access Thermo-physical properties Database of preprogrammed models Parallel processing Optimization with uncertain parameters Custom solver or model connections Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC Unique Features of APM Initialization with nonlinear presolve minJ(x, y,u) x s.t. 0 f ,x, y,u min J (x, y,u) t 0 g(x, y,u) 0h(x, y,u) x minJ(x, y,u) x s.t. 0 f ,x, y,u s.t. 0 f , x, y,u t 0 g(x, y,u) t 0 h(x, y,u) minJ(x, y,u) x s.t. 0 f ,x, y,u t 0g(x, y,u) 0h(x, y,u) 0 g(x, y,u) minJ(x, y,u) x s.t. 0 f ,x, y,u t 0 h(x, y,u) 0 g(x, y,u) 0 h(x, y,u) Explicit variable substitution every function call min J (x, y,u) min J (x, y,u) Intermediate s.t. y1 g1(x,u) x Variables s.t. 0 f , x, y,u 0 g (x, y , y ,u) t 2 1 2 0 g(x, y,u) x 0 f , x, y1, y2 ,u 0 h(x, y,u) t 0 h(x, y1, y2 ,u) Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC Unique Features of APM Model development workflow Steady State Dynamic Sequential Simulate147 Estimate 2 5 - Optimize 3 6 - Solve higher index DAEs (Index 3+ with APM) Index-1 only (e.g. MATLAB ode15s) Index-1 + Index-2 Hessenberg (e.g. DASPK) Classes of problems LP, QP, NLP, DAE MILP, MIQP, MINLP, MIDAE Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC Solver Benchmarking – Hock-Schittkowski (116) 100 90 80 70 60 APOPT+BPOPT APOPT 50 1.0 BPOPT 40 1.0 Percentage (%) IPOPT 3.10 30 IPOPT 2.3 SNOPT 20 6.1 MINOS 5.5 10 0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Not worse than 2 times slower than the best solver () Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC Solver Benchmarking - Dynamic Optimization (37) 100 90 80 70 60 APOPT+BPOPT APOPT 1.0 50 BPOPT 1.0 IPOPT 40 3.10 Percentage (%) IPOPT 2.3 30 SNOPT 6.1 MINOS 20 5.5 10 0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Not worse than 2 times slower than the best solver () Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC Solver Benchmarking – SBML (341) 100 90 80 70 APOPT+BPOPT APOPT 1.0 60 BPOPT 1.0 IPOPT 50 3.10 Percentage (%) IPOPT 2.3 40 SNOPT 6.1 MINOS 30 5.5 20 10 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Not worse than 2 times slower than the best solver () Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC Computational Biology Drug treatment and discovery – large-scale models HIV Virus Simulation 6.647 7 6.112 6 5.576 5 5.041 4 4.506 Log(Virus) 3 3.970 2 3.435 1 2 2.899 1.95 2.364 15 10 5 1.828 Log(kr ) 1.9 0 1 time (years) Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC BiologicalClick Kinetic to edit Models Master Modestly title style Sized 120 Mean = 20 100 Median = 10 80 Models 60 of 40 # 20 0 # of Physical Entities Model sizes from 409 curated models in the Biomodels repository (http://www.ebi.ac.uk/biomodels-main/) ModelClick Size toLimited edit Master by Tools title style We need better tools (parameter estimation, optimization) to deal with large models! Large ErbB signalling model (~504 physical entities)* Parameter estimation (simulated annealing) took “24 hours on a 100-node cluster computer” *Chen et al. Mol Syst Biol. 2009;5:239 . Smart Grid Energy Systems Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC Solid Oxide Fuel Cells Fuel Power to Grid Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC Flow Assurance for Oil and Gas Industry Fouling and Plugging largest loss category Billions $$$ per year in lost revenue Predictive Analytics Real-time or Off-line Monitoring Solution Empirical and First Principles Models Safe Operations Reliability Targets Regulatory Reports Maximize Economics Training Simulators Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC Engineering in Remote Locations Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC Environmental Impact Safe, environmentally friendly, and economic operations Safety: Velocity of Inlet Waste Gas Safety: LEL of Waste Gas Economic: Fuel Costs Environmental: Emission Levels Economic: Size / Insulation Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC Unmanned Aerial Systems Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC UAS System Dynamics nd Cable-drogue dynamics using Newton 2 law Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC Dynamic System Example Model Parameters ! time constant tau = 5 ! gain K = 2 ! manipulated variable u = 1 End Parameters Variables ! output or controlled variable x = 1 End Variables Equations ! first order differential equation tau * $x = -x + K * u End Equations End Model Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC Optimization Under Uncertainty 4 u Conservative movement based on opt 3 worst case CV 2 Manipulated 1 0 2 4 6 8 10 12 14 16 18 20 15 x Upper Limit opt 10 Controlled 5 0 0 2 4 6 8 10 12 14 16 18 20 Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC Selecting a Model for Predictive Control Many model forms Continuous Form (SSc ) Linear vs. Non-linear x Ax Bu Steady state vs. Dynamic y Cx Du Empirical vs. First Principles Discrete Form (SSd ) Select the simplest model x[k 1] Ad x[k] Bd u[k] Accuracy requirements y[k] Cd x[k] Dd u[k] Steady State Gain Nonlinear Model Dynamics – Time to Steady State 0 f x, x,u, p,d Speed requirements PID < Linear MPC < Nonlinear MPC 0 g(x,u, p,d) 0 h(x,u, p,d) Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC Friction Stir Welding A rotating tool creates heat and plasticizes the metal. This allows the metal to be “stirred” together Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC Getting Started with APM Download Software at APMonitor.com Bi-weekly Webinars Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC Applications Deployed for Real-time Systems Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC Future Development Plans APM Modeling Language MI-DAE systems Active Development Efforts Mixed Integer solvers that exploit DAE structure Interfaces to other scripting languages Industrial and Academic Collaborators APOPT and BPOPT MINLP solver development Additional information at INFORMS session WC04 Oct 14, 2012 APMonitor.com Advanced Process Solutions, LLC.