Almost everything in VisualPDE is customisable. Here, we describe the basic functionality of every option that can be found in the menus of VisualPDE.

Equations

VisualPDE is all about solving equations. In the Equations pane, you can view and define the problem that VisualPDE will solve for you in your browser, complete with initial and boundary conditions. More advanced settings, including variable renaming, can be found under Settings.

Edit

Customise all the terms in the PDEs that you would like to solve using natural syntax. See our discussion of valid expressions for helpful examples that will guide you in posing your own PDE system. Typing in any of the fields will highlight the corresponding term in the typeset PDE above.

• Typeset

Have VisualPDE typeset the specified equations, making use of all the defined diffusion coefficients, functions and parameters. Terms will not be substituted in if they are constants that are not 0 or 1. Toggle this off to see the format of the equations that VisualPDE can interpret.

• $D_u$, $D_v$, $D_w$, …

Set the diffusion coefficients of all the species in the simulation. When Cross diffusion is enabled, you can also set interaction terms, which are written $D_{uv}$ etc. These can be functions of space ($x$, $y$), time ($t$), any of the unknowns ($u$, $v$, $w$, $q$), the size of the domain ($L$, $L_x$, $L_y$), the images ($I_S$, $I_T$) and any quantities defined in Parameters. See our discussion of valid expressions for valid syntax and a list of available in-built functions.

Advanced users seeking diagonal anisotropic diffusion tensors (i.e. distinct diffusion coefficients in the coordinate directions) can define two coefficients at once by separating definitions with a semicolon. For example, 1;2 sets diffusion coefficients of 1 and 2 in the $x$ and $y$ directions, respectively.

• $f_u$, $f_v$, $f_w$, …

Define the inhomogeneities in the equations. These can be functions of space ($x$, $y$), time ($t$), any of the unknowns ($u$, $v$, $w$, $q$), the size of the domain ($L$, $L_x$, $L_y$), the images ($I_S$, $I_T$), and any quantities defined in Parameters. See our discussion of valid expressions for valid syntax and a list of available in-built functions.

Advanced users can also make careful use of RAND, a uniformly random value in $[0,1]$, and RANDN, a normally distributed random number with unit variance and zero mean. This converts the equations into stochastic partial differential equations, which should only be solved using the Forward Euler timestepping scheme. Both RAND and RANDN require manually dividing by sqrt(dt) in non-algebraic equations so that the scheme resembles the Euler-Maruyama method. The solution under other timestepping schemes is undefined.

For convenience, we define WhiteNoise to be a normally distributed random variable with unit variance and zero mean, scaled by $1/sqrt{\dt\dx^N}$ where $N=1,2$ is the spatial dimension. This scales appropriately with timestep and spatial step and is suitable for direct use in PDEs, such as in our stochastic example.

Parameters

This menu contains a list of all the user-specified values that can be used throughout VisualPDE. New parameters can be defined using the empty input field at the bottom of the list of parameters. Parameters can depend on one another, but their definitions cannot be cyclic.

Basics

The basic syntax for defining a parameter is

name = value


which will make the quantity name available to the simulation. You can then freely change value, which will instantly propagate throughout VisualPDE. If you try to use a name that clashes with an internal variable (some of which are only found under the hood of VisualPDE), a warning will appear to inform you of this. Parameters can be removed by deleting the text that defines them. You can even choose a name that includes subscripts, such as k_1u. This will be interpreted as $k_{1u}$ automatically by VisualPDE.

Sliders

name = value in [start,step,stop]


creates a slider for your variable, ranging between the start and stop values in increments of step. The step parameter can be omitted and VisualPDE will choose a step automatically. For example,

a = 0.5 in [0,1]


creates a slider that ranges between 0 and 1, with initial value 0.5 and an automatically determined step size. Parameters with sliders cannot be defined in terms of other parameters.

The configuration of a slider (value, start, step, stop) can be updated by modifying the relevant parts of the expression that defines it. Sliders can be removed by deleting in ... from the parameter definition, and will be removed automatically when the associated parameter is removed.

Boundary conditions

Boundary conditions can be specified for any species in the simulation. The following boundary conditions are available:

• Periodic
• Dirichlet (e.g. $u\onboundary = 0$)
• Neumann (e.g. $\pd{u}{n}\onboundary = 0$)
• Robin (e.g. $(u + \pd{u}{n})\onboundary = 0$)

Boundary conditions that allow you to specify values can be functions of space ($x$, $y$), time ($t$), any of the unknowns ($u$, $v$, $w$, $q$), the size of the domain ($L$, $L_x$, $L_y$), the images ($I_S$, $I_T$) and any quantities defined in Parameters. Robin boundary conditions are the only type supported that allow you to use an unknown in the specification of its own boundary condition. See our discussion of valid expressions for valid syntax and a list of available in-built functions.

An additional option, Mixed…, is also available, which allows you to specify different types of boundary condition on the Left, Right, Top and Bottom sides of rectangular domains.

The easiest way to do this is using the graphical interface by clicking beside the boundary condition selector (unavailable during surface plots). Click the various boundaries to set the desired condition on each. These conditions can also be specified directly as a string, e.g.

Left: Dirichlet = 0; Right: Neumann = 1; Top: Robin = u; Bottom: Dirichlet = sin(x)


for the species $u$ would specify $u = 0$ on the left boundary, $\pd{u}{n} = 1$ on the right boundary, $\pd{u}{n} = u$ on the top boundary and $u = \sin(x)$ on the bottom boundary. Sides can be specified in any order and are case sensitive. Omitting any side will default to periodic boundary conditions (beware, this may have unexpected results if the matching side is not also periodic; using the graphical interface prevents this).

An additional type of condition, ‘Ghost’, can also be specified with Mixed boundary conditions. This advanced option pushes VisualPDE to its limits, overriding the value of the ghost nodes used in the spatial discretisation of the PDE, and should be used with caution. We make use of this option in our Visual Story on virus transmission to effectively double the size of the computational domain in one direction. This must be toggled on in Misc.

Initial conditions

Initial conditions can be specified for any species in the simulation. They can be functions of space ($x$, $y$), the size of the domain ($L$, $L_x$, $L_y$), the images ($I_S$, $I_T$), the random quantity RAND, a uniformly random value in $[0,1]$, the random quantity RANDN, a normally-distributed random number with unit variance and zero mean, and any quantities defined in Parameters. See our discussion of valid expressions for valid syntax and a list of available in-built functions.

Configure additional equation-related settings, including the number of species and the type of terms that will be included.

• Num. species

Specify the number of unknowns (1, 2, 3, or 4) in the simulation.

• Num. algebraic

Choose how many equations you want to be in algebraic form in systems with cross diffusion enabled. The equations will be put in algebraic form in reverse order, e.g. a 4-species system with 1 algebraic species will convert the final equation to be algebraic.

• Species names

Specify custom names for the species in VisualPDE, which often default to $u$, $v$, $w$, $q$. Names can be multi-character and can include letters, numbers, and underscores, but must each be a single ‘word’. For example, T_01 is a valid name (rendered as $T_{01}$) whilst T 01 is not. Space or commas can be used to separate names in the list. Certain names are reserved under the hood, such as H for the Heaviside function, but VisualPDE will warn you if you attempt to use a reserved name. VisualPDE will automatically substitute the names of old species everywhere in the simulation and interface.

• Cross diffusion

Enable cross diffusion in systems with 2 or more species, enabling simulation of a wide range of systems in which a species can depend on the gradient of another.

• Scales

Set per-equation timescales (multiplying any time derivatives) $\tau_u$, $\tau_v$, $\tau_w$, $\tau_q$ to enable simpler entry of some types of systems. For algebraic equations, these quantities are no longer timescales, but retain their notation and function as per-equation scale factors. They can be functions of space ($x$, $y$), time ($t$), any of the unknowns ($u$, $v$, $w$, $q$), their gradients ($u_x$, $u_y$, etc.), the size of the domain ($L$, $L_x$, $L_y$), the images ($I_S$, $I_T$), and any quantities defined in Parameters. See our discussion of valid expressions for valid syntax and a list of available in-built functions.

Importantly, timescales must be non-zero. Setting timescales to zero will result in singularities and are equivalent to large diffusion coefficients, large timesteps, or fast kinetic terms.

Views

There are often multiple ways to visualise a solution to a PDE. In the Views pane, you can select from and customise a range of example-specific display options, or create your own. Everything you customise will be saved in the current View. If you share your simulation via a link, your Views will be sent along too.

New (+)

Create a new view with a placeholder name from the current view configuration.

Non-local evaluation

Sometimes, you might want direct access to the values of a species at points other than (x,y), such as if you wanted to implement a higher order derivative or a lattice dynamical system. You can access a species (e.g. u) at an arbitrary position via the syntax u[x,y], where x and y can be any valid expression that points to somewhere in the domain. For instance, writing u[x+dx,y+dy] - u[x-dx,y-dy] will lookup nearby values of u, offset by the step sizes dx and dy`.

The behaviour of non-local evaluations using these expressions is undefined at boundaries (so that Neumann boundary conditions may not behave as expected, for instance), unless periodic boundary conditions are used.