The examples of Model Workshop all start from a mathematical model in the form of a differential equation, which is transformed by a process of discretisation, where derivatives are replaced by difference quotients into a system of algebraic equations in a finite number of variables. In a next step the system is expressed in computer code including a solution process, typically some form of time-stepping, which when executed by a computer solves the system of equations and produces a solution to the differential equation.
The key steps are thus:
- Formulate Model as a differential equation DE.
- Transform DE by replacing derivatives by difference quotients on a mesh into a finite system of algebraic equations in a process of discretisation.
- Express the system of equations in computer code including a solution process.
- Let a computer execute the code and thereby produce an approximate solution to the DE = a simulation.
Model Workshop connects to FEniCS and FEniCS-HPC as a computer code or compiler, which translates any given differential equation directly into computer code. FEniCS thus takes us from 1. directly to 4. by automating the discretisation in steps 2. and 3. See University Syllabus under Syllabus. Compare with Automation.
Test online CMU-OLI course.
Watch this key example: Simulation of the airflow around a jumbojet in landing from first principle Newtonian mechanics automatically translated to computer code by FEniCS:
FEniCS makes it possible to fill the mantra of DigiMat of model-simulate-explore-understand-control the World with true meaning. FEniCS is the first software of automated mathematical modeling. The development of FEniCS is closely connected to that of DigiMat.
The main task is then reduced to create models of the World as differential equations in variational form as input to FEniCS, which delivers output as approximate solutions for given data in the model.
- Newtonian mechanics of mass-spring systems
- fluid and solid mechanics including coupled fluid-structure mechanics
- wave propagation in solids and fluids
- electromagnetics, radiation
- atom physics
- biology and medicine
as well as areas of the Digital World including
- image and sound representation
With a basis from the rich code-collection in Model Workshop, DigiMat Pro/FEniCS opens already for a pre-university student a wide world of simulation based on Calculus, and then not simply as a black-box, since the essence of a model is already familiar from simple implementation. DigiMat Pro also invites to plunge into the technicalities of FEniCS for further development.
The concept of DigiMat School + FEniCS thus opens a new avenue for school mathematics.
Introductory Example of Variational Formulation
Recall Basic FEM in 1d.
Consider the differential equation/boundary value problem: Find a function defined on the interval satisfying
- for ,
where is a given function defined on I. A variational formulation is obtained by multiplying the differential equation by an arbitrary test function and integrating over I to first get
and then using that by integrations by parts assuming
to finally get that for any test function satisfying
A variational formulation is then obtained by forming a set of functions V (satisfying the boundary conditions) of finite dimension, for example continuous piecewise linear functions on a mesh, from which the solution is sought as satisfying (1) for all test functions in the set of functions V. The variational formulation thus reads:
- Find such that (1) for all .
This corresponds to a linear set of equations with as many unknowns as equations as the result of discretisation by the finite element method, which is automatically translated to computer code by FEniCS to be executed by a computer to deliver the solution.
An introduction to discretisation by the finite element method is given in World of Finite Elements.
All the examples of Model Workshop invite to variational formulation as input to FEniCS into simulation tools for exploration/prediction/control of the World. Accept the invitation!
DigiMat Pro thus shows how to formulate models of the World as differential equations in variational form as input to FEniCS for automated computation. The World is open to exploration!
If one is interested in the relations between fields which, according to customary academic divisions, belong to different departments, then he will not be welcomed as a builder of bridges, as he might have expected, but will rather be regarded by both sides as an outsider and troublesome intruder. (Rudolf Carnarp)