Version:

This documentation is not for the latest stable Salvus version.

This tutorial is presented as Python code running inside a Jupyter Notebook, the recommended way to use Salvus. To run it yourself you can copy/type each individual cell or directly download the full notebook, including all required files.
Copy
%matplotlib inline
%config Completer.use_jedi = False

import os

SALVUS_FLOW_SITE_NAME = os.environ.get("SITE_NAME", "local")

# Inverting for homogeneous material

In this mini-tutorial, we demonstrate how the mapping function can be used to invert for homogeneous material parameters. Here, the adjoint operation of the mapping class maps the space-dependent physical gradient into the subspace of homogeneous model parameters.

## Take-home message

Selecting scaling="homogeneous" in the mapping function of an InverseProblemConfiguration enables inversion for homogeneous model parameters with full-waveform inversion.
.css-fd3q3g{border-width:0px!important;padding:0px!important;font-size:85%!important;box-shadow:1px 1px 3px 1px rgba(0,0,0,0.48)!important;}Copysn.Mapping(
scaling="homogeneous",
inversion_parameters=[...],
...
)
import matplotlib.pyplot as plt
import numpy as np
import pathlib
import time
import xarray as xr

import salvus.namespace as sn

## Aperture

We consider a simplistic setup with a 2D elastic box domain with a single source-receiver pair.
Check out the full FWI tutorial for more details on the individual steps.
p = sn.Project.from_domain(
path="project",
domain=sn.domain.dim2.BoxDomain(
x0=0.0,
x1=1.0,
y0=0.0,
y1=1.5,
),
)
src = sn.simple_config.source.cartesian.VectorPoint2D(
x=0.33, y=0.0, fx=0.0, fy=1.0e9
)

x=0.67,
y=1.5,
fields=["displacement"],
network_code="REC",
station_code="000",
)

p += sn.Event(event_name="event", sources=src, receivers=rec)
ec = sn.EventConfiguration(
waveform_simulation_configuration=sn.WaveformSimulationConfiguration(
end_time_in_seconds=0.0006
),
wavelet=sn.simple_config.stf.Ricker(center_frequency=10000.0),
)
p.viz.nb.domain()

## Simulations

We consider two different homogeneous isotropic media. The "true" model we seek to reconstruct varies from the initial model in vp, vs and rho. Note that the deviations in the parameters have opposite signs and different magnitudes.
true_model = sn.model.background.homogeneous.IsotropicElastic(
vp=5800.0, vs=3200.0, rho=2600.0
)
initial_model = sn.model.background.homogeneous.IsotropicElastic(
vp=5600.0, vs=3300.0, rho=2400.0
)
for name, model in zip(["true", "init"], [true_model, initial_model]):

sn.SimulationConfiguration(
name=name,
elements_per_wavelength=2,
tensor_order=1,
max_frequency_in_hertz=20000.0,
model_configuration=sn.ModelConfiguration(background_model=model),
event_configuration=ec,
),
overwrite=True,
)

p.simulations.launch(
simulation_configuration=name,
events=p.events.get_all(),
site_name=SALVUS_FLOW_SITE_NAME,
ranks_per_job=1,
)
[2021-07-02 16:33:53,614] INFO: Creating mesh. Hang on.
[2021-07-02 16:33:53,993] INFO: Submitting job ...

ðŸš€  Submitted [email protected]local_cuda
[2021-07-02 16:33:54,218] INFO: Creating mesh. Hang on.
[2021-07-02 16:33:54,261] INFO: Submitting job ...

ðŸš€  Submitted [email protected]local_cuda

p.simulations.query(block=True)
True
This is of course not a realistic setup, but the waveforms differ in both components.
p.viz.nb.waveforms(data=["true", "init"], receiver_field="displacement")

## Inversion

Next, we setup the inverse problem. We are using scaling="homogeneous" in the mapping function, which enforces a homogeneous medium in every iteration. Note that a smoothing preconditioner is not necessary here, because the mapped gradient is already homogeneous.
p += sn.MisfitConfiguration(
name="L2",
observed_data="true",
misfit_function="L2",
)
p += sn.InverseProblemConfiguration(
name="inversion",
prior_model="init",
events=p.events.list(),
mapping=sn.Mapping(
scaling="homogeneous",
inversion_parameters=["VP", "VS", "RHO"],
),
method=sn.TrustRegion(initial_trust_region_linf=100.0),
misfit_configuration="L2",
job_submission=sn.SiteConfig(
site_name=SALVUS_FLOW_SITE_NAME, ranks_per_job=1
),
)
for i in range(10):
p.inversions.iterate(
inverse_problem_configuration="inversion",
timeout_in_seconds=360,
ping_interval_in_seconds=1,
)
[2021-07-02 16:33:56,602] INFO: Adding new iteration #0.
[2021-07-02 16:33:56,618] INFO: Resuming iteration #0.

[2021-07-02 16:33:56,619] INFO: 1 new tasks have been issued.
[2021-07-02 16:33:56,620] INFO: Processing task misfit_and_gradient
[2021-07-02 16:33:56,658] INFO: The following events have been simulated before, but checkpoints are not available for this combination of site_name and ranks_per_job. They will be run again: ['event']
[2021-07-02 16:33:56,690] INFO: Submitting job ...
[2021-07-02 16:33:56,772] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2021-07-02 16:33:57,777] INFO: Processing task misfit_and_gradient
[2021-07-02 16:33:57,891] INFO: Some tasks of iteration #0 are still running. Please check again later.
[2021-07-02 16:33:58,896] INFO: Processing task misfit_and_gradient
[2021-07-02 16:33:59,288] INFO: Submitting job ...
[2021-07-02 16:33:59,385] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2021-07-02 16:33:59,387] INFO: Some tasks of iteration #0 are still running. Please check again later.
[2021-07-02 16:34:00,391] INFO: Processing task misfit_and_gradient
[2021-07-02 16:34:00,529] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:00,623] INFO: Some simulations are still running. Please check again to see if they are finished.
[2021-07-02 16:34:00,624] INFO: Some tasks of iteration #0 are still running. Please check again later.
[2021-07-02 16:34:01,628] INFO: Processing task misfit_and_gradient
[2021-07-02 16:34:01,753] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:01,844] INFO: Some simulations are still running. Please check again to see if they are finished.
[2021-07-02 16:34:01,846] INFO: Some tasks of iteration #0 are still running. Please check again later.
[2021-07-02 16:34:02,850] INFO: Processing task misfit_and_gradient
[2021-07-02 16:34:02,982] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:03,156] INFO:
Iteration 0: Number of events: 1	 chi = 3.7156532079293004e-10	 ||g|| = 3.3910353874486916e-12
pred = ---	ared = ---	norm_update = ---	tr_radius = ---
[2021-07-02 16:34:03,188] INFO: 1 new tasks have been issued.
[2021-07-02 16:34:03,189] INFO: Processing task misfit
[2021-07-02 16:34:03,252] INFO: Submitting job ...
[2021-07-02 16:34:03,352] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2021-07-02 16:34:04,390] INFO: Processing task misfit
[2021-07-02 16:34:04,423] INFO: Some tasks of iteration #0 are still running. Please check again later.
[2021-07-02 16:34:05,486] INFO: Processing task misfit
[2021-07-02 16:34:05,585] INFO: Some tasks of iteration #0 are still running. Please check again later.
[2021-07-02 16:34:06,625] INFO: Processing task misfit
[2021-07-02 16:34:06,793] INFO:
old misfit control group: 3.7156532079293004e-10
new misfit control group: 1.0738902586801198e-10
predicted reduction control group: -2.1653938658274006e-10
actual reduction control group: -2.6417629492491806e-10
1 out of 1 event(s) improved the misfit.
[2021-07-02 16:34:06,793] INFO:
Model update accepted.
[2021-07-02 16:34:06,862] INFO: Succesfully completed iteration #0.
[2021-07-02 16:34:06,865] INFO: Adding new iteration #1.
[2021-07-02 16:34:06,873] INFO: Resuming iteration #1.

[2021-07-02 16:34:06,874] INFO: 1 new tasks have been issued.
[2021-07-02 16:34:06,874] INFO: Processing task gradient
[2021-07-02 16:34:06,975] INFO: Submitting job ...
[2021-07-02 16:34:07,068] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2021-07-02 16:34:08,072] INFO: Processing task gradient
[2021-07-02 16:34:08,156] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:08,203] INFO: Some simulations are still running. Please check again to see if they are finished.
[2021-07-02 16:34:08,204] INFO: Some tasks of iteration #1 are still running. Please check again later.
[2021-07-02 16:34:09,208] INFO: Processing task gradient
[2021-07-02 16:34:09,278] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:09,369] INFO: Some simulations are still running. Please check again to see if they are finished.
[2021-07-02 16:34:09,371] INFO: Some tasks of iteration #1 are still running. Please check again later.
[2021-07-02 16:34:10,377] INFO: Processing task gradient
[2021-07-02 16:34:10,459] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:10,643] INFO:
Iteration 1: Number of events: 1	 chi = 1.0738902586801198e-10	 ||g|| = 1.0372299440474053e-12
pred = -2.1653938658274006e-10	ared = -2.6417629492491806e-10	norm_update = 127.71284392030923	tr_radius = 127.71284392030934
[2021-07-02 16:34:10,692] INFO: 1 new tasks have been issued.
[2021-07-02 16:34:10,693] INFO: Processing task misfit
[2021-07-02 16:34:10,747] INFO: Submitting job ...
[2021-07-02 16:34:10,850] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2021-07-02 16:34:11,890] INFO: Processing task misfit
[2021-07-02 16:34:11,936] INFO: Some tasks of iteration #1 are still running. Please check again later.
[2021-07-02 16:34:12,970] INFO: Processing task misfit
[2021-07-02 16:34:13,066] INFO: Some tasks of iteration #1 are still running. Please check again later.
[2021-07-02 16:34:14,118] INFO: Processing task misfit
[2021-07-02 16:34:14,281] INFO:
old misfit control group: 1.0738902586801198e-10
new misfit control group: 7.296715648731587e-11
predicted reduction control group: -1.8864373922058708e-11
actual reduction control group: -3.442186938069611e-11
1 out of 1 event(s) improved the misfit.
[2021-07-02 16:34:14,281] INFO:
Model update accepted.
[2021-07-02 16:34:14,360] INFO: Succesfully completed iteration #1.
[2021-07-02 16:34:14,362] INFO: Adding new iteration #2.
[2021-07-02 16:34:14,373] INFO: Resuming iteration #2.

[2021-07-02 16:34:14,373] INFO: 1 new tasks have been issued.
[2021-07-02 16:34:14,374] INFO: Processing task gradient
[2021-07-02 16:34:14,464] INFO: Submitting job ...
[2021-07-02 16:34:14,550] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2021-07-02 16:34:15,556] INFO: Processing task gradient
[2021-07-02 16:34:15,632] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:15,695] INFO: Some simulations are still running. Please check again to see if they are finished.
[2021-07-02 16:34:15,697] INFO: Some tasks of iteration #2 are still running. Please check again later.
[2021-07-02 16:34:16,701] INFO: Processing task gradient
[2021-07-02 16:34:16,776] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:16,868] INFO: Some simulations are still running. Please check again to see if they are finished.
[2021-07-02 16:34:16,869] INFO: Some tasks of iteration #2 are still running. Please check again later.

[2021-07-02 16:34:17,877] INFO: Processing task gradient
[2021-07-02 16:34:17,954] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:18,126] INFO:
Iteration 2: Number of events: 1	 chi = 7.296715648731587e-11	 ||g|| = 8.841260843876473e-13
pred = -1.8864373922058708e-11	ared = -3.442186938069611e-11	norm_update = 38.055162004155044	tr_radius = 255.42568784061868
[2021-07-02 16:34:18,188] INFO: 1 new tasks have been issued.
[2021-07-02 16:34:18,189] INFO: Processing task misfit
[2021-07-02 16:34:18,241] INFO: Submitting job ...
[2021-07-02 16:34:18,330] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2021-07-02 16:34:19,367] INFO: Processing task misfit
[2021-07-02 16:34:19,415] INFO: Some tasks of iteration #2 are still running. Please check again later.
[2021-07-02 16:34:20,466] INFO: Processing task misfit
[2021-07-02 16:34:20,562] INFO: Some tasks of iteration #2 are still running. Please check again later.
[2021-07-02 16:34:21,604] INFO: Processing task misfit
[2021-07-02 16:34:21,766] INFO:
old misfit control group: 7.296715648731587e-11
new misfit control group: 7.29925738291249e-12
predicted reduction control group: -5.3947863165836076e-11
actual reduction control group: -6.566789910440339e-11
1 out of 1 event(s) improved the misfit.
[2021-07-02 16:34:21,767] INFO:
Model update accepted.
[2021-07-02 16:34:21,840] INFO: Succesfully completed iteration #2.
[2021-07-02 16:34:21,844] INFO: Adding new iteration #3.
[2021-07-02 16:34:21,859] INFO: Resuming iteration #3.

[2021-07-02 16:34:21,860] INFO: 1 new tasks have been issued.
[2021-07-02 16:34:21,860] INFO: Processing task gradient
[2021-07-02 16:34:21,951] INFO: Submitting job ...
[2021-07-02 16:34:22,032] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2021-07-02 16:34:23,039] INFO: Processing task gradient
[2021-07-02 16:34:23,114] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:23,168] INFO: Some simulations are still running. Please check again to see if they are finished.
[2021-07-02 16:34:23,169] INFO: Some tasks of iteration #3 are still running. Please check again later.
[2021-07-02 16:34:24,177] INFO: Processing task gradient
[2021-07-02 16:34:24,251] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:24,347] INFO: Some simulations are still running. Please check again to see if they are finished.
[2021-07-02 16:34:24,348] INFO: Some tasks of iteration #3 are still running. Please check again later.
[2021-07-02 16:34:25,358] INFO: Processing task gradient
[2021-07-02 16:34:25,446] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:25,618] INFO:
Iteration 3: Number of events: 1	 chi = 7.29925738291249e-12	 ||g|| = 2.108132504453713e-13
pred = -5.3947863165836076e-11	ared = -6.566789910440339e-11	norm_update = 127.71284392030927	tr_radius = 127.71284392030934
[2021-07-02 16:34:25,695] INFO: 1 new tasks have been issued.
[2021-07-02 16:34:25,696] INFO: Processing task misfit
[2021-07-02 16:34:25,752] INFO: Submitting job ...
[2021-07-02 16:34:25,840] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2021-07-02 16:34:26,879] INFO: Processing task misfit
[2021-07-02 16:34:26,924] INFO: Some tasks of iteration #3 are still running. Please check again later.
[2021-07-02 16:34:27,974] INFO: Processing task misfit
[2021-07-02 16:34:28,070] INFO: Some tasks of iteration #3 are still running. Please check again later.
[2021-07-02 16:34:29,114] INFO: Processing task misfit
[2021-07-02 16:34:29,272] INFO:
old misfit control group: 7.29925738291249e-12
new misfit control group: 3.8540128002575315e-12
predicted reduction control group: -3.6255930101841106e-12
actual reduction control group: -3.4452445826549586e-12
1 out of 1 event(s) improved the misfit.
[2021-07-02 16:34:29,273] INFO:
Model update accepted.
[2021-07-02 16:34:29,346] INFO: Succesfully completed iteration #3.
[2021-07-02 16:34:29,350] INFO: Adding new iteration #4.
[2021-07-02 16:34:29,368] INFO: Resuming iteration #4.

[2021-07-02 16:34:29,369] INFO: 1 new tasks have been issued.
[2021-07-02 16:34:29,369] INFO: Processing task gradient
[2021-07-02 16:34:29,458] INFO: Submitting job ...
[2021-07-02 16:34:29,537] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2021-07-02 16:34:30,544] INFO: Processing task gradient
[2021-07-02 16:34:30,641] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:30,792] INFO:
Iteration 4: Number of events: 1	 chi = 3.8540128002575315e-12	 ||g|| = 5.4926787058983487e-14
pred = -3.6255930101841106e-12	ared = -3.4452445826549586e-12	norm_update = 37.63480723091307	tr_radius = 255.42568784061868
[2021-07-02 16:34:30,891] INFO: 1 new tasks have been issued.
[2021-07-02 16:34:30,891] INFO: Processing task misfit
[2021-07-02 16:34:30,947] INFO: Submitting job ...
[2021-07-02 16:34:31,021] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2021-07-02 16:34:32,058] INFO: Processing task misfit
[2021-07-02 16:34:32,103] INFO: Some tasks of iteration #4 are still running. Please check again later.
[2021-07-02 16:34:33,142] INFO: Processing task misfit
[2021-07-02 16:34:33,236] INFO: Some tasks of iteration #4 are still running. Please check again later.
[2021-07-02 16:34:34,278] INFO: Processing task misfit
[2021-07-02 16:34:34,441] INFO:
old misfit control group: 3.8540128002575315e-12
new misfit control group: 3.660823157442789e-12
predicted reduction control group: -1.1396053841229356e-13
actual reduction control group: -1.9318964281474257e-13
1 out of 1 event(s) improved the misfit.
[2021-07-02 16:34:34,442] INFO:
Model update accepted.
[2021-07-02 16:34:34,515] INFO: Succesfully completed iteration #4.
[2021-07-02 16:34:34,525] INFO: Adding new iteration #5.
[2021-07-02 16:34:34,549] INFO: Resuming iteration #5.

[2021-07-02 16:34:34,549] INFO: 1 new tasks have been issued.
[2021-07-02 16:34:34,550] INFO: Processing task gradient
[2021-07-02 16:34:34,640] INFO: Submitting job ...
[2021-07-02 16:34:34,731] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2021-07-02 16:34:35,740] INFO: Processing task gradient
[2021-07-02 16:34:35,822] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:35,879] INFO: Some simulations are still running. Please check again to see if they are finished.
[2021-07-02 16:34:35,879] INFO: Some tasks of iteration #5 are still running. Please check again later.
[2021-07-02 16:34:36,885] INFO: Processing task gradient
[2021-07-02 16:34:36,960] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:37,062] INFO: Some simulations are still running. Please check again to see if they are finished.
[2021-07-02 16:34:37,063] INFO: Some tasks of iteration #5 are still running. Please check again later.

[2021-07-02 16:34:38,071] INFO: Processing task gradient
[2021-07-02 16:34:38,140] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:38,310] INFO:
Iteration 5: Number of events: 1	 chi = 3.660823157442789e-12	 ||g|| = 3.6824744672276836e-14
pred = -1.1396053841229356e-13	ared = -1.9318964281474257e-13	norm_update = 4.998508096121989	tr_radius = 127.71284392030934
[2021-07-02 16:34:38,416] INFO: 1 new tasks have been issued.
[2021-07-02 16:34:38,417] INFO: Processing task misfit
[2021-07-02 16:34:38,465] INFO: Submitting job ...
[2021-07-02 16:34:38,545] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2021-07-02 16:34:39,593] INFO: Processing task misfit
[2021-07-02 16:34:39,736] INFO:
old misfit control group: 3.660823157442789e-12
new misfit control group: 2.9816431483687825e-12
predicted reduction control group: -4.428254663499904e-13
actual reduction control group: -6.791800090740065e-13
1 out of 1 event(s) improved the misfit.
[2021-07-02 16:34:39,736] INFO:
Model update accepted.
[2021-07-02 16:34:39,813] INFO: Succesfully completed iteration #5.
[2021-07-02 16:34:39,818] INFO: Adding new iteration #6.
[2021-07-02 16:34:39,840] INFO: Resuming iteration #6.

[2021-07-02 16:34:39,841] INFO: 1 new tasks have been issued.
[2021-07-02 16:34:39,842] INFO: Processing task gradient
[2021-07-02 16:34:40,043] INFO: Submitting job ...
[2021-07-02 16:34:40,135] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2021-07-02 16:34:41,145] INFO: Processing task gradient
[2021-07-02 16:34:41,240] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:41,282] INFO: Some simulations are still running. Please check again to see if they are finished.
[2021-07-02 16:34:41,283] INFO: Some tasks of iteration #6 are still running. Please check again later.
[2021-07-02 16:34:42,293] INFO: Processing task gradient
[2021-07-02 16:34:42,372] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:42,543] INFO:
Iteration 6: Number of events: 1	 chi = 2.9816431483687825e-12	 ||g|| = 1.1330860186077661e-13
pred = -4.428254663499904e-13	ared = -6.791800090740065e-13	norm_update = 25.921836157166418	tr_radius = 63.85642196015467
[2021-07-02 16:34:42,666] INFO: 1 new tasks have been issued.
[2021-07-02 16:34:42,667] INFO: Processing task misfit
[2021-07-02 16:34:42,730] INFO: Submitting job ...
[2021-07-02 16:34:42,825] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2021-07-02 16:34:43,868] INFO: Processing task misfit
[2021-07-02 16:34:43,924] INFO: Some tasks of iteration #6 are still running. Please check again later.
[2021-07-02 16:34:44,961] INFO: Processing task misfit
[2021-07-02 16:34:45,057] INFO: Some tasks of iteration #6 are still running. Please check again later.
[2021-07-02 16:34:46,112] INFO: Processing task misfit
[2021-07-02 16:34:46,270] INFO:
old misfit control group: 2.9816431483687825e-12
new misfit control group: 1.956955605824089e-12
predicted reduction control group: -6.667472753012403e-13
actual reduction control group: -1.0246875425446934e-12
1 out of 1 event(s) improved the misfit.
[2021-07-02 16:34:46,271] INFO:
Model update accepted.
[2021-07-02 16:34:46,347] INFO: Succesfully completed iteration #6.
[2021-07-02 16:34:46,355] INFO: Adding new iteration #7.
[2021-07-02 16:34:46,387] INFO: Resuming iteration #7.

[2021-07-02 16:34:46,387] INFO: 1 new tasks have been issued.
[2021-07-02 16:34:46,388] INFO: Processing task gradient
[2021-07-02 16:34:46,478] INFO: Submitting job ...
[2021-07-02 16:34:46,561] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2021-07-02 16:34:47,572] INFO: Processing task gradient
[2021-07-02 16:34:47,677] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:47,830] INFO:
Iteration 7: Number of events: 1	 chi = 1.956955605824089e-12	 ||g|| = 1.8080705506040236e-13
pred = -6.667472753012403e-13	ared = -1.0246875425446934e-12	norm_update = 51.84367231433307	tr_radius = 51.843672314332835
[2021-07-02 16:34:47,954] INFO: 1 new tasks have been issued.
[2021-07-02 16:34:47,955] INFO: Processing task misfit
[2021-07-02 16:34:48,012] INFO: Submitting job ...
[2021-07-02 16:34:48,094] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2021-07-02 16:34:49,140] INFO: Processing task misfit
[2021-07-02 16:34:49,190] INFO: Some tasks of iteration #7 are still running. Please check again later.
[2021-07-02 16:34:50,234] INFO: Processing task misfit
[2021-07-02 16:34:50,325] INFO: Some tasks of iteration #7 are still running. Please check again later.
[2021-07-02 16:34:51,370] INFO: Processing task misfit
[2021-07-02 16:34:51,537] INFO:
old misfit control group: 1.956955605824089e-12
new misfit control group: 7.204552743182586e-13
predicted reduction control group: -8.889927227726118e-13
actual reduction control group: -1.2365003315058305e-12
1 out of 1 event(s) improved the misfit.
[2021-07-02 16:34:51,538] INFO:
Model update accepted.
[2021-07-02 16:34:51,617] INFO: Succesfully completed iteration #7.
[2021-07-02 16:34:51,623] INFO: Adding new iteration #8.
[2021-07-02 16:34:51,653] INFO: Resuming iteration #8.

[2021-07-02 16:34:51,654] INFO: 1 new tasks have been issued.
[2021-07-02 16:34:51,655] INFO: Processing task gradient
[2021-07-02 16:34:51,755] INFO: Submitting job ...
[2021-07-02 16:34:51,852] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2021-07-02 16:34:52,861] INFO: Processing task gradient
[2021-07-02 16:34:52,941] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:52,992] INFO: Some simulations are still running. Please check again to see if they are finished.
[2021-07-02 16:34:52,992] INFO: Some tasks of iteration #8 are still running. Please check again later.
[2021-07-02 16:34:54,000] INFO: Processing task gradient
[2021-07-02 16:34:54,086] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:54,181] INFO: Some simulations are still running. Please check again to see if they are finished.
[2021-07-02 16:34:54,183] INFO: Some tasks of iteration #8 are still running. Please check again later.
[2021-07-02 16:34:55,196] INFO: Processing task gradient
[2021-07-02 16:34:55,275] INFO: 1 events have already been submitted. They will not be submitted again.
[2021-07-02 16:34:55,456] INFO:
Iteration 8: Number of events: 1	 chi = 7.204552743182586e-13	 ||g|| = 1.6691438458972463e-13
pred = -8.889927227726118e-13	ared = -1.2365003315058305e-12	norm_update = 83.0521841707508	tr_radius = 103.68734462866567
[2021-07-02 16:34:55,609] INFO: 1 new tasks have been issued.
[2021-07-02 16:34:55,610] INFO: Processing task misfit
[2021-07-02 16:34:55,661] INFO: Submitting job ...
[2021-07-02 16:34:55,761] INFO: Launched simulations for 1 events. Please check again to see if they are finished.

[2021-07-02 16:34:56,804] INFO: Processing task misfit
[2021-07-02 16:34:56,949] INFO:
old misfit control group: 7.204552743182586e-13
new misfit control group: 3.398969256758548e-14
predicted reduction control group: -5.173851366194599e-13
actual reduction control group: -6.864655817506732e-13
1 out of 1 event(s) improved the misfit.
[2021-07-02 16:34:56,950] INFO:
Model update accepted.
[2021-07-02 16:34:57,028] INFO: Succesfully completed iteration #8.
[2021-07-02 16:34:57,035] INFO: Adding new iteration #9.
[2021-07-02 16:34:57,064] INFO: Resuming iteration #9.

[2021-07-02 16:34:57,065] INFO: The total number of iterations in this inversion tree has been reached and no new iteration will be added. If you want to continue with this inversion, you need to adjust max_iterations_global using set_stopping_criteria.


## Validation

Finally, we load the final model and check that it indeed converged to the true model. The reconstruction matches the true model with less than 0.1% error for compressional and shear wave speed and less than 0.2% for density.
p.viz.nb.inversion(inverse_problem_configuration="inversion")