model module

Implemented models

Model Module documentation

Model of model building.

Inherits from circuit to directly include the equivalent circuit here.

class DMT.extraction.model.Model(model_name, version, nodes, independent_vars)[source]

Bases: object

Base class for compact models that can be evaluated analytically in Python.

Parameters:
model_namestr

Name of the model

versionfloat

Specifies the version of the model

nodes[str]

Nodes of the model

independent_vars[str]

Variables of the models which sould be considered independent, like voltages, currents and temperatures… ‘kwargs’ is added per default

model_resistance_infodict

Dictionary describing the dependencies for the model method ‘model_resistance’. For each key a tuple is expected if it is given. The possible keys are:

  • ‘independent_vars’: Independent variables of this model method.

  • ‘depends’: The model method depends on these other model methods.

  • ‘depends_optional’: The model method CAN depend on these additional model methods to model the full voltage and current range.

Attributes:
model_namestr

Name of the model

versionfloat

Specifies the version of the model

nodes[str]

Nodes of the model

independent_vars[str]

Variables of the models which should be considered independent, like voltages, currents and temperatures…

netlist[CircuitElement]

Netlist of the equivalent circuit of this model.

get_param_list(meq_function, all_parameters=False, dict_info=None)[source]

Returns a list with the McParameter names for meq_function in correct order.

Parameters:
meq_functionfunction

Function of the model equation which shall be used.

all_parameters{False, True}, optional

If True, the independent_vars are ignored and the full parameter list is returned.

Returns:
paramslist

List of parameters for this function

DMT.extraction.model.check_nan_inf(func)[source]

This wrapper for mathematical functions checks if that functions returns Nan or Inf values. If such a value is returned, an error is raised and the function arguments are also given, which is useful to debug model equations.

DMT.extraction.model.memoize(obj)[source]

Decorator that implements memoization for McParameter objects in *args.

DMT.extraction.model.vectorize(func)[source]

This decorator can be used to vectorize model functions. Somehow it slows everything down heavily, it is currently not clear why! https://www.pythonlikeyoumeanit.com/Module3_IntroducingNumpy/VectorizedOperations.html