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 <type ‘float’>, <type ‘int’> with shape (*)

counter
= None¶ A SimPEG.Utils.Counter object

surveyPair
¶ A SimPEG.Survey Class
alias of
BaseSurvey

mapPair
¶ A SimPEG.Map Class
alias of
IdentityMap

solverOpts
= {'accuracyTol': 0.0001}¶ Solver options as a kwarg dict

mesh
= None¶ A discretize instance.

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

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

survey
¶ The survey object for this problem.

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

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.array) – model
 v (numpy.array) – 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.array) – model
 v (numpy.array) – 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.array) – model
 v (numpy.array) – 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.array) – model
 v (numpy.array) – vector to multiply
 f (Fields) – fields
Return type: Returns: JTv

fields
(m)[source]¶ The field given the model.
Parameters: m (numpy.array) – model Return type: numpy.array 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 <type ‘float’>, <type ‘int’> with shape (*)

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]

nT
¶ Number of time steps.

t0
¶

times
¶ Modeling times

timeMesh
¶
 model (
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”}

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

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

srcPair
¶ Source Pair
alias of
BaseSrc

srcList
¶ Source List

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

mesh
¶ Mesh of the paired problem.

ispaired
¶

nD
¶ Number of data

vnD
¶ Vector number of data

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.array) – geophysical model
 f (numpy.array) – fields
Return type: Returns: data residual
The data residual:
\[\mu_\text{data} = \mathbf{d}_\text{pred}  \mathbf{d}_\text{obs}\]

isSynthetic
¶ Check if the data is synthetic.

makeSyntheticData
(m, std=0.05, f=None, force=False)[source]¶ Make synthetic data given a model, and a standard deviation.
Parameters:  m (numpy.array) – geophysical model
 std (numpy.array) – standard deviation
 u (numpy.array) – 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]

rxPair
¶ alias of
BaseRx

rxList
= None¶ SimPEG Receiver List

nD
¶ Number of data

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)

rxType
¶ Receiver Type

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.

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.
