Skip to contents

Implements an unconditionally stable finite volume scheme (implicit Euler) with upwinding for advection.

Usage

solve_pde(pars, u_initial, Delta_l = 1, t_max = 10, Delta_t = 0.05)

Arguments

pars

A list containing the model parameters: k, L_inf, d, m.

u_initial

A numeric vector for the initial condition u(l, 0).

Delta_l

The size step size (cm).

t_max

The maximum simulation time.

Delta_t

The time step size (years). Default is 0.05.

Value

A matrix where each column is the solution u(l, t) at a given time step. Columns correspond to size points and rows to time points.