Constant Model¶
- class pints.toy.ConstantModel(n, force_multi_output=False)[source]¶
Toy model that’s constant over time, linear over the parameters, mostly useful for unit testing.
For an n-dimensional model, evaluated with parameters
p = [p_1, p_2, ..., p_n], the simulated values are time-invariant, so that for any timet\[f(t) = (p_1, 2 p_2, 3 p_3, ..., n p_n)\]The derivatives with respect to the parameters are time-invariant, and simply equal
\[\begin{split}\frac{\partial{f_i(t)}}{dp_j} = \begin{cases} i, i = j\\0, i \neq j \end{cases}\end{split}\]Extends
pints.ForwardModelS1,pints.toy.ToyModel.- Parameters:
n (int) – The number of parameters (and outputs) the model should have.
force_multi_output (boolean) – Set to
Trueto always return output of the shape(n_times, n_outputs), even ifn_outputs == 1.
Example
times = np.linspace(0, 1, 100) m = pints.ConstantModel(2) m.simulate([1, 2], times)
In this example, the returned output is
[1, 4]at every point in time.- suggested_parameters()¶
Returns an NumPy array of the parameter values that are representative of the model.
For example, these parameters might reproduce a particular result that the model is famous for.
- suggested_times()¶
Returns an NumPy array of time points that is representative of the model