Forward Problem¶
Problem Class¶
The problem is a partial differential equation of the form:
Here, \(m\) is the model and u is the field (or fields). Given the model, \(m\), we can calculate the fields \(u(m)\), however, the data we collect is a subset of the fields, and can be defined by a linear projection, \(P\).
For the inverse problem, we are interested in how changing the model transforms the data, as such we can take write the Taylor expansion:
We can linearize and define the sensitivity matrix as:
The sensitivity matrix, and it’s transpose will be used in the inverse problem to (locally) find how model parameters change the data, and optimize!
Working with the general PDE, \(c(m, u) = 0\), where m is the model and u is the field, the sensitivity is defined as:
We can take the derivative of the PDE:
If the forward problem is invertible, then we can rearrange for \(\frac{\partial u}{\partial m}\):
This can often be computed given a vector (i.e. \(J(v)\)) rather than stored, as \(J\) is a large dense matrix.
The API¶
Problem¶

class
SimPEG.Problem.
BaseProblem
(mesh, **kwargs)[source]¶  Problem is the base class for all geophysical forward problems
in SimPEG.
Optional Properties:
model (
Model
): Inversion model., a numpy array of <class ‘float’>, <class ‘int’> with shape (*) or (*, *)

counter
= None¶ A SimPEG.Utils.Counter object

surveyPair
¶ alias of
SimPEG.Survey.BaseSurvey

mapPair
¶ alias of
SimPEG.Maps.IdentityMap

solverOpts
= {}¶ Solver options as a kwarg dict

mesh
= None¶ A discretize instance.

property
mapping
¶ Setting an unnamed mapping has been depreciated in v0.4.0. Please see the release notes for more details.

property
curModel
¶ Setting the curModel is depreciated.
Use SimPEG.Problem.model instead.

property
survey
¶ The survey object for this problem.

deleteTheseOnModelUpdate
= []¶ List of strings, e.g. [‘_MeSigma’, ‘_MeSigmaI’]

clean_on_model_update
= []¶ List of matrix names to have their factors cleared on a model update

property
ispaired
¶ True if the problem is paired to a survey.

Jvec
(m, v, f=None)[source]¶ Effect of J(m) on a vector v.
 Parameters
m (numpy.ndarray) – model
v (numpy.ndarray) – vector to multiply
f (Fields) – fields
 Return type
 Returns
Jv

Jtvec
(m, v, f=None)[source]¶ Effect of transpose of J(m) on a vector v.
 Parameters
m (numpy.ndarray) – model
v (numpy.ndarray) – vector to multiply
f (Fields) – fields
 Return type
 Returns
JTv

Jvec_approx
(m, v, f=None)[source]¶ Approximate effect of J(m) on a vector v
 Parameters
m (numpy.ndarray) – model
v (numpy.ndarray) – vector to multiply
f (Fields) – fields
 Return type
 Returns
approxJv

Jtvec_approx
(m, v, f=None)[source]¶ Approximate effect of transpose of J(m) on a vector v.
 Parameters
m (numpy.ndarray) – model
v (numpy.ndarray) – vector to multiply
f (Fields) – fields
 Return type
 Returns
JTv

fields
(m)[source]¶ The field given the model.
 Parameters
m (numpy.ndarray) – model
 Return type
 Returns
u, the fields

class
SimPEG.Problem.
BaseTimeProblem
(mesh, **kwargs)[source]¶ Sets up that basic needs of a time domain problem.
Optional Properties:
model (
Model
): Inversion model., a numpy array of <class ‘float’>, <class ‘int’> with shape (*) or (*, *)

property
timeSteps
¶ Sets/gets the timeSteps for the time domain problem.
You can set as an array of dt’s or as a list of tuples/floats. Tuples must be length two with […, (dt, repeat), …]
For example, the following setters are the same:
prob.timeSteps = [(1e6, 3), 1e5, (1e4, 2)] prob.timeSteps = np.r_[1e6,1e6,1e6,1e5,1e4,1e4]

property
nT
¶ Number of time steps.

property
t0
¶

property
times
¶ Modeling times

property
timeMesh
¶
Fields¶

class
SimPEG.Fields.
Fields
(mesh, survey, **kwargs)[source]¶ Fancy Field Storage
u[:,’phi’] = phi print(u[src0,’phi’])

knownFields
= None¶ Known fields, a dict with locations, e.g.
{"e": "E", "phi": "CC"}

dtype
¶ alias of
builtins.float

aliasFields
= None¶ Aliased fields, a dict with [alias, location, function], e.g.
{"b": ["e", "F", lambda(F,e,ind)]}

property
approxSize
¶ The approximate cost to storing all of the known fields.

Survey¶

class
SimPEG.Survey.
BaseSurvey
(**kwargs)[source]¶ Survey holds the observed data, and the standard deviations.

std
= None¶ Estimated Standard Deviations

eps
= None¶ Estimated Noise Floor

dobs
= None¶ Observed data

dtrue
= None¶ True data, if data is synthetic

mtrue
= None¶ True model, if data is synthetic

counter
= None¶ A SimPEG.Utils.Counter object

property
srcList
¶ Source List

property
prob
¶ The geophysical problem that explains this survey, use:
survey.pair(prob)

property
mesh
¶ Mesh of the paired problem.

property
ispaired
¶

property
nD
¶ Number of data

property
vnD
¶ Vector number of data

property
nSrc
¶ Number of Sources

dpred
(m, f=None)[source]¶ Create the projected data from a model. The fields, f, (if provided) will be used for the predicted data instead of recalculating the fields (which may be expensive!).
\[d_\text{pred} = P(f(m))\]Where P is a projection of the fields onto the data space.
Note
To use survey.dpred(), SimPEG requires that a problem be bound to the survey. If a problem has not been bound, an Exception will be raised. To bind a problem to the Data object:
survey.pair(myProblem)

eval
(f)[source]¶ This function projects the fields onto the data space.
\[d_\text{pred} = \mathbf{P} f(m)\]

evalDeriv
(f)[source]¶ This function s the derivative of projects the fields onto the data space.
\[\frac{\partial d_\text{pred}}{\partial u} = \mathbf{P}\]

residual
(m, f=None)[source]¶  Parameters
m (numpy.ndarray) – geophysical model
f (numpy.ndarray) – fields
 Return type
 Returns
data residual
The data residual:
\[\mu_\text{data} = \mathbf{d}_\text{pred}  \mathbf{d}_\text{obs}\]

property
isSynthetic
¶ Check if the data is synthetic.

makeSyntheticData
(m, std=None, f=None, force=False)[source]¶ Make synthetic data given a model, and a standard deviation.
 Parameters
m (numpy.ndarray) – geophysical model
std (numpy.ndarray) – standard deviation
u (numpy.ndarray) – fields for the given model (if precalculated)
force (bool) – force overwriting of dobs


class
SimPEG.Survey.
BaseSrc
(rxList, **kwargs)[source]¶ SimPEG Source Object

loc
= None¶ Location [x,y,z]

rxList
= None¶ SimPEG Receiver List

property
nD
¶ Number of data

property
vnD
¶ Vector number of data


class
SimPEG.Survey.
BaseRx
(locs, rxType, **kwargs)[source]¶ SimPEG Receiver Object

knownRxTypes
= None¶ Set this to a list of strings to ensure that srcType is known

projGLoc
= 'CC'¶ Projection grid location, default is CC

storeProjections
= True¶ Store calls to getP (organized by mesh)

locs
= None¶ Locations (nRx x nDim)

property
rxType
¶ Receiver Type

property
nD
¶ Number of data in the receiver.


class
SimPEG.Survey.
BaseTimeRx
(locs, times, rxType, **kwargs)[source]¶ SimPEG Receiver Object

projTLoc
= 'N'¶

times
= None¶ Times when the receivers were active.

property
nD
¶ Number of data in the receiver.

getSpatialP
(mesh)[source]¶ Returns the spatial projection matrix.
Note
This is not stored in memory, but is created on demand.


class
SimPEG.Survey.
Data
(survey, dobs=None, standard_deviation=None, floor=None)[source]¶ Storage of data, standard_deviation and floor storage with fancy [Src,Rx] indexing.
Requried :param Survey survey: The survey descriping the layout of the data
Optional :param ndarray dobs: The data vector matching the src and rx in survey :param ndarray standard_deviation: The standard deviation vector matching the src and rx in survey :param ndarray floor: The floor vector for the data matching the src and rx in survey