Skip to contents

PDESystem(eqs, bcs, domain, ivs, dvs, ps, name = ) collects the equations, boundary and initial conditions, domains, independent and dependent variables and parameters of a PDE problem. ModelingToolkit does not discretize PDE systems itself and neither does modelcompR; the object is the input of discretization packages.

Usage

PDESystem(
  eqs,
  bcs,
  domain,
  ivs,
  dvs,
  ps = list(),
  initial_conditions = NULL,
  systems = list(),
  connector_type = NULL,
  metadata = NULL,
  analytic = NULL,
  analytic_func = NULL,
  checks = TRUE,
  description = "",
  name = NULL
)

Arguments

eqs

Equations (formulas or Equation objects).

bcs

Boundary and initial conditions.

domain

Domains: a list of VarDomainPairing() objects or formulas t ~ c(0, 1).

ivs

Independent variables.

dvs

Dependent variables, as applied functions u(t, x).

ps

Parameters.

initial_conditions

Default values (variable map).

systems

Subsystems.

connector_type

Connector type.

metadata

Metadata.

analytic

Analytic solutions, equations u(t, x) ~ expr.

analytic_func

Analytic solution functions, a named list.

checks

Check units, as in System().

description

A description.

name

The name.

Value

An object of class PDESystem.

Details

analytic gives exact solutions u(t, x) ~ expr, from which analytic_func functions are generated, called with the parameter values first and then the independent variables, as f(ps, t, x).

Fields are read with $: pde$eqs, pde$bcs, pde$domain, pde$ivs, pde$dvs, pde$ps, ...; pde$x returns the variable named x.

Examples

t <- independent_variable("t"); x <- independent_variable("x")
u <- Variable("u", list(t, x))
Dt <- Differential(t); Dxx <- Differential(x, 2)
eq <- Dt(u) ~ Dxx(u)
bcs <- list(Function("u")(0, x) ~ sin(pi * x))
pde <- PDESystem(eq, bcs, list(t ~ c(0, 1), x ~ c(0, 1)), list(t, x), list(u),
                 name = "heat")
pde
#> PDESystem heat
#> Equations: Derivative(u(t, x), t) ~ Derivative(u(t, x), (x, 2)) 
#> Boundary Conditions: u(0, x) ~ sin(3.14159265358979*x) 
#> Domain: t ∈ Interval(0, 1), x ∈ Interval(0, 1) 
#> Dependent Variables: u(t, x) 
#> Independent Variables: t, x 
#> Parameters:  
#> Default Parameter Values: none