\( \newcommand\D{\mathrm{d}} \newcommand\E{\mathrm{e}} \newcommand\I{\mathrm{i}} \newcommand\bigOh{\mathcal{O}} \newcommand{\cat}[1]{\mathbf{#1}} \newcommand\curl{\vec{\nabla}\times} \newcommand{\CC}{\mathbb{C}} \newcommand{\NN}{\mathbb{N}} \newcommand{\QQ}{\mathbb{Q}} \newcommand{\RR}{\mathbb{R}} \newcommand{\ZZ}{\mathbb{Z}} \)
UP | HOME

Abstract Calculus Pattern

Table of Contents

1. Overview

The basic idea is to write functions which encapsulate the conceptual mathematics, using the strategy pattern, so different numerical schemes can be used to solve the problem. For example, something like

(defparameter *equation*
  '(= (d u time) (* -k (laplacian u))))

(defparameter *system*
  '((:dependent-var (u))
    (:independent-var (time x y z))
    (:params ((k 1.0d0)))))

(solve finite-difference-solver *equation* *system* :initial-cond ...)

2. References

  • Damian Rouson, Jim Xia, Xiaofeng Xu, Scientific Software Design: The Object-Oriented Way. Cambridge University Press, 2011; see esp. ch.6

Last Updated 2021-04-11 Sun 12:03.