Author: Chris Lattner
This repository contains source code of a shallow water partial differential equation (PDE) solver. The solver is written in differentiable Swift which allows end-to-end propagation of derivatives through time. In physics this kind of solution is traditionally called adjoint and it unlocks a new class of algorithms for optimal control of PDEs.
More details about the PDE and how to derive it from general Navier-Stokes equations can found for example on Wikipedia.
The following notebook demonstrates how the differentiability of the solver can be leveraged to solve an otherwise tricky optimal control problem.
Showcase.ipynb
[![ColabBadge]][ShowcaseColabLink]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// SwiftUIWeeklyChallenge01 | |
// | |
// Created by @myridiphis on 02/10/2020. | |
// | |
// not very tidy, but enjoy changing many of magical constants | |
import SwiftUI |