experiments/laser_and_mirrors.py

changeset 1
a4137aedcb3a
child 3
c3a4f4bb87f7
equal deleted inserted replaced
0:7ec1cfe19a24 1:a4137aedcb3a
1 #
2 # Laser and mirrors convection-diffusion experiment with known diffusivity and convectivity
3 #
4 import laser_and_mirrors_aux
5 from measures import DiscreteMeasure_2_f64
6 from pointsource_pde import Problem, RegTerm
7 from pointsource_pde.compose import (
8 ComposeFnWithOperator,
9 InjectSecond,
10 )
11
12 # Give name to the problem
13 name = "laser_and_mirrors"
14
15 # Override algorithm settings
16 algorithm_overrides = laser_and_mirrors_aux.algorithm_overrides
17
18
19 # Setup routine
20 def setup(prefix):
21 dat, auxtrue, μ_bound, μ_true, plot_factory = laser_and_mirrors_aux.generic_setup(
22 prefix
23 )
24
25 μ0 = DiscreteMeasure_2_f64([])
26
27 reg = RegTerm.NonnegRadon(
28 10e-7 # 5e-7 # 3e-7
29 )
30
31 dat_simple = ComposeFnWithOperator(dat, InjectSecond(auxtrue), xbound=μ_bound)
32 dat_simple.curvature_bound_components = lambda: (None, None)
33 print("Initial value:", dat_simple.apply(μ0))
34 print("Value at true μ:", dat_simple.apply(μ_true))
35
36 return Problem(
37 dataterm=dat_simple, regterm=reg, μinit=μ0, plot_factory=plot_factory
38 )

mercurial