{"id":17490,"date":"2025-06-23T12:54:41","date_gmt":"2025-06-23T16:54:41","guid":{"rendered":"https:\/\/blogs.mathworks.com\/deep-learning\/?p=17490"},"modified":"2025-07-21T09:31:42","modified_gmt":"2025-07-21T13:31:42","slug":"what-is-physics-informed-machine-learning","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/deep-learning\/2025\/06\/23\/what-is-physics-informed-machine-learning\/","title":{"rendered":"What Is Physics-Informed Machine Learning?"},"content":{"rendered":"<h6><\/h6>\r\n<em>This blog post is from <\/em><a href=\"https:\/\/www.linkedin.com\/in\/mae-markowski-a461b7224\/\">Mae Markowski<\/a><em>, Senior Product Manager at MathWorks.<\/em>\r\n<h6><\/h6>\r\n&nbsp;\r\n<h6><\/h6>\r\nPhysics-informed machine learning is a branch of Scientific Machine Learning (SciML) that combines physical laws with <a href=\"https:\/\/www.mathworks.com\/discovery\/machine-learning.html\">machine learning<\/a> and <a href=\"https:\/\/www.mathworks.com\/discovery\/deep-learning.html\">deep learning<\/a> techniques. This integration is bi-directional: physics principles\u2014such as conservation laws, governing equations, and other domain knowledge\u2014inform <a href=\"https:\/\/www.mathworks.com\/discovery\/artificial-intelligence.html\">artificial intelligence<\/a> (AI) models, improving their accuracy and interpretability, while AI techniques can augment and even uncover governing equations and unknown model parameters, deepening our understanding of physical systems.\r\n<h6><\/h6>\r\nPhysics-informed machine learning enables tasks such as predicting phenomena with greater precision and less data, as well as solving differential equations more efficiently. With MATLAB and Deep Learning Toolbox, you can develop AI models that leverage governing physics to enhance analysis and decision-making in engineering and science. In this blog, I will give you an overview of physics-informed machine learning: what it\u2019s used for, what we mean by physics knowledge and how it informs AI methods, as well as benefits and promising applications of this exciting technology.\r\n<h6><\/h6>\r\nYou can find relevant code and examples in the repository <a href=\"https:\/\/github.com\/matlab-deep-learning\/SciML-and-Physics-Informed-Machine-Learning-Examples\">SciML and Physics-Informed Machine Learning Examples<\/a>. In a future post, we\u2019ll take a closer look at specific techniques for physics-informed machine learning.\r\n<h6><\/h6>\r\n<img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-17655 \" src=\"https:\/\/blogs.mathworks.com\/deep-learning\/files\/2025\/06\/What_is_PhiML_v2.png\" alt=\"Graphical representation of relationship between first-principles modeling, physics-informed machine learning, and AI techniques, ranging from white box to black box approach\" width=\"683\" height=\"240\" \/>\r\n<h6><\/h6>\r\n<strong>Figure:<\/strong> Physics-informed machine learning is a hybrid approach that combines the strengths of first-principles modeling (white box) with data-driven AI techniques (black-box).\r\n<h6><\/h6>\r\n&nbsp;\r\n<h6><\/h6>\r\n<p style=\"font-size: 20px; color: #c04c0b;\"><strong>What Is Physics-Informed Machine Learning Used for?<\/strong><\/p>\r\nTo illustrate the versatility of physics-informed machine learning, let\u2019s use a familiar example: the pendulum. Imagine watching a pendulum swing, like the one below.\r\n<h6><\/h6>\r\n<img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-17496 size-full\" src=\"https:\/\/blogs.mathworks.com\/deep-learning\/files\/2025\/06\/SimulateThePhysicsOfAPendulumsPeriodicSwingExample_10.gif\" alt=\"\" width=\"560\" height=\"420\" \/>\r\n<h6><\/h6>\r\n<strong>Figure:<\/strong> Simulation of a simple pendulum. To learn how to recreate this animation, see the example <a href=\"https:\/\/www.mathworks.com\/help\/symbolic\/simulate-physics-pendulum-swing.html\">Simulate the Motion of the Periodic Swing of a Pendulum<\/a>.\r\n<h6><\/h6>\r\n&nbsp;\r\n<h6><\/h6>\r\nYou might want to:\r\n<h6><\/h6>\r\n<ul>\r\n \t<li>Predict the pendulum\u2019s future motion from data,<\/li>\r\n \t<li>Discover the underlying equations governing its swing, or<\/li>\r\n \t<li>Use a known equation to calculate its motion.<\/li>\r\n<\/ul>\r\nIn each scenario, physics-informed machine learning provides a framework to combine data with physical insights. Here\u2019s how physics-informed machine learning can be applied to each objective:\r\n<h6><\/h6>\r\n<p style=\"font-size: 18px;\"><strong>Modeling Unknown Dynamics<\/strong><\/p>\r\nConsider a scenario where you have measurements of a pendulum\u2019s angle and angular velocity over time. Suppose that the exact governing equation is unknown, but you do know that the total energy of the system is conserved. Certain physics-informed machine learning methods, such as <a href=\"https:\/\/github.com\/matlab-deep-learning\/SciML-and-Physics-Informed-Machine-Learning-Examples\/tree\/main\/hamiltonian-neural-network\">Hamiltonian Neural Networks<\/a>, allow you to build a model that learns from data and predicts the pendulum\u2019s future swings, while accounting for energy conservation.\r\n<h6><\/h6>\r\n<p style=\"font-size: 18px;\"><strong>Discovering Equations<\/strong><\/p>\r\nNow imagine you want to discover an equation that describes the pendulum\u2019s motion over time. Some physics-informed machine learning methods, like SINDy (Sparse Identification of Nonlinear Dynamics), can reveal the underlying mathematical relationships from data. For example, if you suspect there is unmodeled friction in the standard pendulum equation, these equation discovery techniques can be used to uncover a mechanistic model of the friction.\r\n<h6><\/h6>\r\n<p style=\"font-size: 18px;\"><strong>Solving Known Equations<\/strong><\/p>\r\nIn cases where the governing equation is already known, you might want to combine it with experimental data to predict the pendulum\u2019s angle over time or to solve the equation under different conditions, such as varying the forcing function. Methods like <a href=\"https:\/\/www.mathworks.com\/discovery\/physics-informed-neural-networks.html\">Physics-Informed Neural Networks<\/a> can combine governing equations in the form of ordinary and partial differential equations (ODEs and PDEs) with data to find solutions that match both observed data and physical laws. Furthermore, if you have numerical solutions of the governing equations corresponding to different forcing functions, operator learning techniques like <a href=\"https:\/\/github.com\/matlab-deep-learning\/SciML-and-Physics-Informed-Machine-Learning-Examples\/tree\/main\/fourier-neural-operator\">Fourier Neural Operator<\/a> can be used to rapidly predict the solution (e.g. pendulum angle) given a new input (e.g. forcing function).\r\n<h6><\/h6>\r\nBelow is a summary of the three different objectives, each illustrated with a concrete example using the pendulum.\r\n<h6><\/h6>\r\n<table width=\"90%;\">\r\n<tbody>\r\n<tr style=\"border: solid 1px #bfbfbf; border-bottom: solid 2px #bfbfbf;\">\r\n<td style=\"padding: 10px; border: 1px solid #bfbfbf; text-align: left;\"><strong>Objective<\/strong><\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\"><strong>Given Information<\/strong><\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\"><strong>Form of Result<\/strong><\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\"><strong>Pendulum example<\/strong><\/td>\r\n<\/tr>\r\n<tr style=\"border: solid 1px #bfbfbf;\">\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Modeling unknown dynamics<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Measurement data + optional physics insights, like conservation of energy<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Learned model<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Given pendulum data and conservation laws, learn to predict future swings while ensuring energy conservation.<\/td>\r\n<\/tr>\r\n<tr style=\"border: solid 1px #bfbfbf;\">\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Equation discovery<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Measurement data + optional physics insights, like terms in a governing equation<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Explicit equations<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Given pendulum data, discover the equation that governs its motion.<\/td>\r\n<\/tr>\r\n<tr style=\"border: solid 1px #bfbfbf;\">\r\n<td style=\"padding: 10px; border: 1px solid #bfbfbf; text-align: left;\">Solving known equations<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Physical equations (for PINNs) or input-output solution data (for operator learning)<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Solution to ODE\/PDE (PINNs) or learned solution operator (operator learning)<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Use the pendulum\u2019s equation and data to predict its motion (PINN); or, learn to predict motion from forcing inputs (operator learning).<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<h6><\/h6>\r\n<strong>Table:<\/strong> Key objectives of physics-informed machine learning and illustrative examples using a simple pendulum\r\n<h6><\/h6>\r\n&nbsp;\r\n<h6><\/h6>\r\nIn the next blog post, we\u2019ll dive deeper into the specific physics-informed machine learning techniques introduced above, along with a few others, and discuss their MATLAB implementations. For now, let\u2019s explore what \u201cphysics\u201d means in physics-informed machine learning, and how it can \u201cinform\u201d learning algorithms.\r\n<h6><\/h6>\r\n&nbsp;\r\n<h6><\/h6>\r\n<p style=\"font-size: 20px; color: #c04c0b;\"><strong>How Is Physics Knowledge Represented?<\/strong><\/p>\r\nPhysics-informed machine learning relies on representing physical knowledge in forms that can guide, constrain, or inspire the design of AI models. In the pendulum example, this might mean knowledge that total energy is conserved (from Hamiltonian mechanics), or that the governing equation depends on angular acceleration and position, even if some terms (like damping) are unknown.\r\n<h6><\/h6>\r\nIn general, what do we mean by \u201cphysics knowledge\u201d in the context of physics-informed machine learning? And how is this knowledge encoded for use in AI models?\r\n<h6><\/h6>\r\nIn physics-informed machine learning, physics knowledge can include:\r\n<h6><\/h6>\r\n<ul>\r\n \t<li><strong>Governing equations<\/strong> (e.g. the pendulum ODE),<\/li>\r\n \t<li><strong>Conservation laws and symmetries<\/strong> (e.g. energy conservation), <strong>\u00a0<\/strong><\/li>\r\n \t<li><strong>Boundary and initial conditions <\/strong>(e.g. starting angular position and velocity),<\/li>\r\n \t<li><strong>Domain-specific knowledge<\/strong> (e.g. maximum swing angle, periodicity)<\/li>\r\n<\/ul>\r\nThe table below illustrates various types of physics knowledge, with examples relevant to the pendulum.\r\n<h6><\/h6>\r\n<table width=\"90%;\">\r\n<tbody>\r\n<tr style=\"border: solid 1px #bfbfbf; border-bottom: solid 2px #bfbfbf;\">\r\n<td style=\"padding: 10px; border: 1px solid #bfbfbf; text-align: left;\"><strong>Type<\/strong><\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\"><strong>Given Information<\/strong><\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\"><strong>Mathematical Formulation<\/strong><\/td>\r\n<\/tr>\r\n<tr style=\"border: solid 1px #bfbfbf;\">\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Governing equations<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Pendulum equation<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">\\[\\ddot{\\theta}=\\ -\\omega_0^2\\sin{\\theta} \\]<\/td>\r\n<\/tr>\r\n<tr style=\"border: solid 1px #bfbfbf;\">\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Conservation Laws<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Conservation of energy<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">\\[E=\\ \\frac{1}{2}m\\ell^2{\\dot{\\theta}}^2+mg\\ell(1-\\cos{\\theta}) \\]<\/td>\r\n<\/tr>\r\n<tr style=\"border: solid 1px #bfbfbf;\">\r\n<td style=\"padding: 10px; border: 1px solid #bfbfbf; text-align: left;\">Boundary \/ Initial Conditions<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Initial angular position, velocity<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">\\[\\theta\\left(0\\right)=\\ \\theta_0,\\ \\dot{\\theta}(0)=\\ {\\dot{\\theta}}_0 \\]<\/td>\r\n<\/tr>\r\n<tr style=\"border: solid 1px #bfbfbf;\">\r\n<td style=\"padding: 10px; border: 1px solid #bfbfbf; text-align: left;\">Domain knowledge<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Physical limits (e.g. maximum swing angle)<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">\\[|\\theta|\\le\\theta_{max}\\]<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<h6><\/h6>\r\n<strong>Table:\u00a0<\/strong>Examples of how physics knowledge can be represented, illustrated with a simple pendulum. This list is not exhaustive\u2014physics knowledge may also include symmetries, invariances, empirical relationships, and more.\r\n<h6><\/h6>\r\n&nbsp;\r\n<h6><\/h6>\r\nFor more information and examples on how domain knowledge can be integrated with machine learning, see <a href=\"https:\/\/blogs.mathworks.com\/deep-learning\/2024\/05\/30\/building-confidence-in-ai-with-constrained-deep-learning\/\">Building Confidence in AI with Constrained Deep Learning<\/a> and <a href=\"https:\/\/www.mathworks.com\/videos\/estimating-nonlinear-black-box-models-68897.html\">Use Physics-Inspired Estimators for Estimating Nonlinear Dynamics<\/a>.\r\n<h6><\/h6>\r\n&nbsp;\r\n<h6><\/h6>\r\n<p style=\"font-size: 20px; color: #c04c0b;\"><strong>How Is Physics Knowledge Integrated with Machine Learning?<\/strong><\/p>\r\nThe machine learning workflow typically involves the following stages:\r\n<h6><\/h6>\r\n<table width=\"90%;\">\r\n<tbody>\r\n<tr style=\"border: solid 1px #bfbfbf; border-bottom: solid 2px #bfbfbf;\">\r\n<td style=\"padding: 10px; border: 1px solid #bfbfbf; text-align: left;\"><strong>Stage<\/strong><\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\"><strong>Description<\/strong><\/td>\r\n<\/tr>\r\n<tr style=\"border: solid 1px #bfbfbf;\">\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">1. Defining Objective<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Specify what needs to be modeled, including input-output relationships and any known physics.<\/td>\r\n<\/tr>\r\n<tr style=\"border: solid 1px #bfbfbf;\">\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">2. Curating Training Data<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Gather training data through experiments, measurements, or simulations. Preprocess raw data into a format suitable for analysis and modeling.<\/td>\r\n<\/tr>\r\n<tr style=\"border: solid 1px #bfbfbf;\">\r\n<td style=\"padding: 10px; border: 1px solid #bfbfbf; text-align: left;\">3. Building Model<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Choose a <a href=\"https:\/\/www.mathworks.com\/discovery\/machine-learning-models.html\">machine learning algorithm<\/a> or a deep learning architecture that best suits your data and task.<\/td>\r\n<\/tr>\r\n<tr style=\"border: solid 1px #bfbfbf;\">\r\n<td style=\"padding: 10px; border: 1px solid #bfbfbf; text-align: left;\">4. Defining Loss Function<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Create a loss function that quantifies the model\u2019s performance in meeting its objectives, such as matching observed data or adhering to physical laws, during training.<\/td>\r\n<\/tr>\r\n<tr style=\"border: solid 1px #bfbfbf;\">\r\n<td style=\"padding: 10px; border: 1px solid #bfbfbf; text-align: left;\">5. Optimizing Model<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Adjust the model parameters to minimize loss and increase predictive accuracy.<\/td>\r\n<\/tr>\r\n<tr style=\"border: solid 1px #bfbfbf;\">\r\n<td style=\"padding: 10px; border: 1px solid #bfbfbf; text-align: left;\">6. Making Predictions<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Use the trained model to make predictions or simulate system behavior.<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<h6><\/h6>\r\n<strong>Table:<\/strong> Six stages of a traditional machine learning workflow\r\n<h6><\/h6>\r\n&nbsp;\r\n<h6><\/h6>\r\nPhysics can be incorporated at various stages of this workflow but often informs the model\u2019s structure (stage 3) and evaluation (stage 4). Machine-learned components can also supplement physics-based models to address partially unknown dynamics (stage 1).\r\n<h6><\/h6>\r\nA key strategy in physics-informed machine learning is to impose constraints based on physics principles, ensuring predictions are not only accurate but also physically plausible. There are two main approaches for imposing constraints:\r\n<h6><\/h6>\r\n<ul>\r\n \t<li><strong>Soft Enforcement:<\/strong> Add physics-based constraints as regularization terms in the loss function (stage 4). During training, the model is penalized for violating constraints, but once trained, its predictions may not strictly satisfy them.<\/li>\r\n \t<li><strong>Hard Enforcement:<\/strong> Design the model architecture (stage 3) so that physical constraints are always satisfied.<\/li>\r\n<\/ul>\r\nDeep Learning Toolbox provides tools to embed both types of physical constraints into your deep learning workflow, as well as use AI to augment a partially known physics model. For more information, see <a href=\"https:\/\/www.mathworks.com\/discovery\/physics-informed-neural-networks.html\">What are Physics-Informed Neural Networks?<\/a> for soft enforcement and the repository <a href=\"https:\/\/github.com\/matlab-deep-learning\/constrained-deep-learning\">AI Verification: Constrained Deep Learning<\/a> for hard enforcement.\r\n<h6><\/h6>\r\nThe table below summarizes how different types of physics knowledge can be integrated into machine learning models, along with example enforcement strategies and MATLAB code snippets.\r\n<h6><\/h6>\r\n&nbsp;\r\n<table width=\"90%;\">\r\n<tbody>\r\n<tr style=\"border: solid 1px #bfbfbf; border-bottom: solid 2px #bfbfbf;\">\r\n<td style=\"padding: 10px; border: 1px solid #bfbfbf; text-align: left;\"><strong>Physics Knowledge<\/strong><\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\"><strong>Example <\/strong><\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\"><strong>Where Physics is Integrated<\/strong><\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\"><strong>Example Code <\/strong><\/td>\r\n<\/tr>\r\n<tr style=\"border: solid 1px #bfbfbf;\">\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Governing equations<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">\\[ \\ddot{\\theta}=\\ -\\omega_0^2\\sin{\\theta} \\]<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Loss Function<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">\r\n<pre>residual = dllaplacian(Theta,T,1) + omega_0^2*sin(Theta);<\/pre>\r\n<\/td>\r\n<\/tr>\r\n<tr style=\"border: solid 1px #bfbfbf;\">\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Partially known governing equations<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">\\[\r\n\\frac{d}{dt}\r\n\\begin{bmatrix}\r\n\\theta \\\\\r\n\\dot{\\theta}\r\n\\end{bmatrix}\r\n=\r\n\\begin{bmatrix}\r\n\\dot{\\theta} \\\\\r\n-\\omega_0^2 \\sin\\theta + h\r\n\\end{bmatrix}\r\n\\]<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Modeling objective<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">\r\n<pre>gFcn = @(X) [X(2,:); -omega0^2*sin(X(1,:))];\r\ngLayer = functionLayer(gFcn);<\/pre>\r\n<\/td>\r\n<\/tr>\r\n<tr style=\"border: solid 1px #bfbfbf;\">\r\n<td style=\"padding: 10px; border: 1px solid #bfbfbf; text-align: left;\">Conservation Laws<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Conservation of energy<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Architecture and loss function<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">\r\n<pre>% Hamilton\u2019s equations\r\nloss = l2loss(dq,dljacobian(H,p,1)) + l2loss(dp,-dljacobian(H,q,1));<\/pre>\r\n<\/td>\r\n<\/tr>\r\n<tr style=\"border: solid 1px #bfbfbf;\">\r\n<td style=\"padding: 10px; border: 1px solid #bfbfbf; text-align: left;\">Boundary \/ Initial Conditions<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">\\[ \\theta(0) = \\theta_0\\]\r\n<h6><\/h6>\r\n\\[ \\dot{\\theta}(0) = \\dot{\\theta}_0 \\]<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Architecture and\/or Loss Function<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">\r\n<pre>icLoss = l2loss(Theta,theta0) + l2loss(dljacobian(Theta,T0,1),thetaDot0);<\/pre>\r\n<\/td>\r\n<\/tr>\r\n<tr style=\"border: solid 1px #bfbfbf;\">\r\n<td style=\"padding: 10px; border: 1px solid #bfbfbf; text-align: left;\">Domain knowledge<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">\\[ |\\theta| \\leq \\theta_{\\text{max}} \\]<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">Architecture<\/td>\r\n<td style=\"padding: 10px; text-align: left; border: solid 1px #bfbfbf;\">\r\n<pre>[tanhLayer; \r\nscalingLayer(Scale=thetaMax)] \r\n<\/pre>\r\n<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<h6><\/h6>\r\n<h6><\/h6>\r\n<strong>Table: <\/strong>Examples of physics-based constraints for the pendulum, and how they can be represented and enforced in deep learning models using MATLAB\r\n<h6><\/h6>\r\n&nbsp;\r\n<h6><\/h6>\r\n<p style=\"font-size: 20px; color: #c04c0b;\"><strong>Advantages of Physics-Informed Machine Learning<\/strong><\/p>\r\nIf you\u2019ve made it this far, you\u2019re well on your way to thinking like a physics-informed machine learning practitioner! But you might still be wondering: why choose physics-informed machine learning over traditional physics-based or pure AI methods? First-principles models are interpretable and generalizable, but can be computationally expensive to solve and may not be applicable to all systems\u2014especially when the physics is not well understood. On the other hand, AI methods excel at learning complex patterns from data and making fast predictions, but often lack interpretability and might not generalize well beyond their training data.\r\n<h6><\/h6>\r\nBy integrating first-principles modeling with AI, physics-informed machine learning aims to enhance each by leveraging the strengths of the other. That said, physics-informed machine learning should not be viewed as a one-size-fits-all solution: in some cases, traditional methods may still perform better. However, in certain contexts, physics-informed machine learning can offer practical advantages, such as:\r\n<h6><\/h6>\r\n<ol>\r\n \t<li><strong>Enhanced Predictive Accuracy:<\/strong>\u00a0Incorporating physics knowledge can improve predictions, especially with limited or noisy data.<\/li>\r\n \t<li><strong>Improved Transparency and Interpretability:<\/strong>\u00a0Incorporating known physics can make it easier to understand how and why a prediction was made.<\/li>\r\n \t<li><strong>Data Efficiency:<\/strong>\u00a0Leveraging known physics can allow models to achieve high accuracy with less data.<\/li>\r\n \t<li><strong>Better Generalization:<\/strong>\u00a0Physical constraints can help models generalize well to new scenarios.<\/li>\r\n \t<li><strong>Faster Inference:<\/strong>\u00a0Compared to traditional simulations, physics-informed machine learning models can provide rapid predictions.<\/li>\r\n<\/ol>\r\n<h6><\/h6>\r\n<img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-17499 \" src=\"https:\/\/blogs.mathworks.com\/deep-learning\/files\/2025\/06\/PhiML_workflow.png\" alt=\"\" width=\"645\" height=\"161\" \/>\r\n<h6><\/h6>\r\n<strong>Figure: <\/strong>Physics-informed machine learning enhances AI models with known physics, or leverages AI to improve partially known physics models, resulting in methods that are more accurate, interpretable, and efficient.\r\n<h6><\/h6>\r\n&nbsp;\r\n<h6><\/h6>\r\nLet\u2019s look at some of the fields already benefiting from physics-informed machine learning.\r\n<h6><\/h6>\r\n&nbsp;\r\n<h6><\/h6>\r\n<p style=\"font-size: 20px; color: #c04c0b;\"><strong>Applications of Physics-Informed Machine Learning<\/strong><\/p>\r\nPhysics-informed machine learning is making an impact across a wide range of domains, including:\r\n<h6><\/h6>\r\n<ul>\r\n \t<li><a href=\"https:\/\/www.mathworks.com\/discovery\/quantitative-systems-pharmacology.html\"><strong>Quantitative Systems Pharmacology (QSP)<\/strong><\/a>:\u00a0Physics-informed machine learning models can combine mechanistic equations with flexible machine-learned components, allowing researchers to represent both well-understood biological processes and data-driven dynamics. These approaches can help identify or refine governing equations from experimental data, leading to more accurate and robust models of a drug\u2019s <a href=\"https:\/\/www.mathworks.com\/discovery\/pharmacokinetic.html\">pharmacokinetics<\/a>, as well as models of the relationship between the drug\u2019s pharmacokinetics and its pharmacodynamics.<\/li>\r\n<\/ul>\r\n<ul>\r\n \t<li><a href=\"https:\/\/blogs.mathworks.com\/deep-learning\/2023\/08\/11\/virtual-sensors-with-ai-and-model-based-design\/\"><strong>Virtual Sensors<\/strong><\/a>: In engineering, physics-informed models such as thermal neural networks combine the structure of certain heat transfer models with neural networks that capture complex or unknown effects. This hybrid approach enables accurate predictions that are more interpretable than black-box models like <a href=\"https:\/\/www.mathworks.com\/help\/deeplearning\/ug\/long-short-term-memory-networks.html\">Long Short-Term Memory Neural Networks<\/a>, and can be applied to tasks like forecasting temperature distributions in electric motors to reduce reliance on expensive physical sensors.<\/li>\r\n \t<li><strong>PDE Simulations<\/strong>:\u00a0Some physics-informed machine learning approaches are particularly well-suited for solving PDEs, which are prevalent in domains like <a href=\"https:\/\/www.mathworks.com\/help\/pde\/ug\/solve-heat-equation-using-graph-neural-network.html\">heat transfer<\/a>, <a href=\"https:\/\/github.com\/MathWorks-Teaching-Resources\/Computational-Fluid-Dynamics\">fluid dynamics<\/a>, and climate modeling. Some approaches build physical laws directly into the model to ensure predictions are consistent with known equations, while others use data from simulations to quickly predict how systems will behave under different conditions and designs, enabling rapid simulation and design exploration.<\/li>\r\n<\/ul>\r\nBy bridging data-driven and physics-based modeling, physics-informed machine learning is poised to tackle increasingly complex challenges across science and engineering.\r\n<h6><\/h6>\r\n&nbsp;\r\n<h6><\/h6>\r\n<p style=\"font-size: 20px; color: #c04c0b;\"><strong>Summary<\/strong><\/p>\r\nIn this post, we introduced physics-informed machine learning\u2014a paradigm that integrates physical insights, such as governing equations and conservation laws, to enhance AI models, and conversely, leverages AI to augment traditional physics-based modeling. Using the pendulum as a guide, we explored the main objectives of physics-informed machine learning: modeling physical systems from data, discovering underlying physical equations, and learning solutions to known differential equations with the help of data.\r\n<h6><\/h6>\r\nIn the next post, we\u2019ll take a closer look at specific physics-informed machine learning techniques and their MATLAB implementations using the pendulum example. If you\u2019re eager to get hands-on, check out the <a href=\"https:\/\/github.com\/matlab-deep-learning\/SciML-and-Physics-Informed-Machine-Learning-Examples\">Scientific and Physics-Informed Machine Learning<\/a> repository to explore the code and start experimenting.\r\n<h6><\/h6>","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/deep-learning\/files\/2025\/06\/What_is_PhiML_v2.png\" onError=\"this.style.display ='none';\" \/><\/div><p>\r\nThis blog post is from Mae Markowski, Senior Product Manager at MathWorks.\r\n\r\n&nbsp;\r\n\r\nPhysics-informed machine learning is a branch of Scientific Machine Learning (SciML) that combines physical... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/deep-learning\/2025\/06\/23\/what-is-physics-informed-machine-learning\/\">read more >><\/a><\/p>","protected":false},"author":194,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[9,12],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/posts\/17490"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/users\/194"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/comments?post=17490"}],"version-history":[{"count":57,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/posts\/17490\/revisions"}],"predecessor-version":[{"id":18230,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/posts\/17490\/revisions\/18230"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/media?parent=17490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/categories?post=17490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/tags?post=17490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}