Adding ODEs, DAEs, and Other Global Equations
When working on complex models, single named degrees of freedom, or states, may be needed to track and update information that is not logically related to any particular point in space. The evolution of these states is generally governed by equations, which are independent of space, but often time-dependent. In particular, such situations arise when modeling physics in interaction with an external system — for example, a controller or an electrical circuit built from standard components. It is often possible to describe such external systems by a system of ordinary differential equations (ODEs) with a limited number of degrees of freedom. It is also possible to create a model in COMSOL Multiphysics that only solves a set of ODEs or DAEs.
The Global ODEs and DAEs Interface has a Global Equations node that is designed for implementing this type of external equation. Such equations are often tightly coupled to a model in a physical domain. The Global Equations node is also available for any of the physics interfaces.
To access the node, right-click the main interface in the Model Builder and select Global Equations.
Use the Global Equations node for ODEs, differential algebraic equations, purely algebraic equations and conditions, and transcendental equations, or to add degrees of freedom to a model using the introduced states. Possible uses include:
An example of the use of an extra state defined using an ODE is to add a state variable that indicates when a condition changes, such as temperature reaching a certain value, where it affects the material properties so that they need to change in the model. You can then add an ODE like
where the indicator variable q is zero as an initial value and remains at zero until T exceeds Tmelt; it then takes on a nonzero positive value. You can then use q to switch from one set of material properties to another set that is valid when it exceeds Tmelt.
Presenting Results for Global Equations
The state variables are scalar values and they are available globally. To view the results for an ODE, use the Line Graph, Point Graph, and Global plot types, and Global Evaluation for displaying the numerical solution.