Partial differential equations

19. Partial differential equations#

This chapter gives an introduction to solving partial differential equations (PDEs) using the open source software package Netgen/NGSolve.

19.1. Installation:#

Install a recent Python. Then it should be easy to install NGSolve using

pip install jupyter numpy scipy matplotlib
pip install ngsolve
pip install webgui_jupyter_widgets

To check the installation of NGSolve run in the console:

python3 -c "import ngsolve; print(ngsolve.__version__)"

Then, open jupyter-notebook, create a new notebook, create and execute a cell with

from ngsolve import *
from ngsolve.webgui import Draw
Draw (unit_cube.shape);

Known issues are

  • Use pip3 instead of pip if there is no pip

  • If you get an error like externally-managed-environment, then either use virtual environments, or add the flag --break-system-packages to the pip command, see explanation

If local installation does not work, there are alternatives: