experiments/laser_and_mirrors.py

Wed, 22 Apr 2026 23:46:40 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Wed, 22 Apr 2026 23:46:40 -0500
changeset 6
64bd740b12ed
parent 3
c3a4f4bb87f7
permissions
-rw-r--r--

Add packaging script, remove alg_tools, measures, and pointsource_pde installation instruction from README.

#
# Laser and mirrors convection-diffusion experiment with known diffusivity and convectivity
#
import laser_and_mirrors_aux
from measures import DiscreteMeasure_2_f64
from pointsource_pde import Problem, RegTerm
from pointsource_pde.compose import (
    ComposeFnWithOperator,
    InjectSecond,
)

# Give name to the problem
name = "laser_and_mirrors"

# Override algorithm settings
algorithm_overrides = laser_and_mirrors_aux.algorithm_overrides


# Setup routine
def setup(prefix):
    dat, auxtrue, _μ_bound, μ_true, plot_factory = laser_and_mirrors_aux.generic_setup(
        prefix
    )

    μ0 = DiscreteMeasure_2_f64([])

    reg = RegTerm.NonnegRadon(1.5e-6)

    dat_simple = ComposeFnWithOperator(dat, InjectSecond(auxtrue))
    dat_simple.curvature_bound_components = lambda: (None, None)
    print("Initial data term value:", dat_simple.apply(μ0))
    print("Data term value at true μ:", dat_simple.apply(μ_true))

    return Problem(
        dataterm=dat_simple, regterm=reg, μinit=μ0, plot_factory=plot_factory
    )

mercurial