KMatrix

class glotaran.builtin.models.kinetic_image.k_matrix.KMatrix[source]

Bases: object

A K-Matrix represents a first order differental system.

Attributes Summary

label

matrix

Methods Summary

a_matrix

The resulting A matrix of the KMatrix.

a_matrix_as_markdown

Returns the A Matrix as markdown formatted table.

a_matrix_non_unibranch

The resulting A matrix of the KMatrix for a non-unibranched model.

a_matrix_unibranch

The resulting A matrix of the KMatrix for an unibranched model.

combine

Creates a combined matrix.

eigen

Returns the eigenvalues and eigenvectors of the k matrix.

empty

Creates an empty K-Matrix.

fill

Returns a copy of the {cls._name} instance with all members which are Parameters are replaced by the value of the corresponding parameter in the parameter group.

from_dict

from_list

full

The full representation of the KMatrix as numpy array.

involved_compartments

A list of all compartments in the Matrix.

is_unibranched

Returns true in the KMatrix represents an unibranched model.

matrix_as_markdown

Returns the KMatrix as markdown formatted table.

mprint

rates

The resulting rates of the matrix.

reduced

The reduced representation of the KMatrix as numpy array.

validate

Methods Documentation

a_matrix(initial_concentration: glotaran.builtin.models.kinetic_image.initial_concentration.InitialConcentration)numpy.ndarray[source]

The resulting A matrix of the KMatrix.

Parameters

initial_concentration – The initial concentration.

a_matrix_as_markdown(initial_concentration: glotaran.builtin.models.kinetic_image.initial_concentration.InitialConcentration)str[source]

Returns the A Matrix as markdown formatted table.

Parameters

initial_concentration – The initial concentration.

a_matrix_non_unibranch(initial_concentration: glotaran.builtin.models.kinetic_image.initial_concentration.InitialConcentration)numpy.ndarray[source]

The resulting A matrix of the KMatrix for a non-unibranched model.

Parameters

initial_concentration – The initial concentration.

a_matrix_unibranch(initial_concentration: glotaran.builtin.models.kinetic_image.initial_concentration.InitialConcentration)numpy.array[source]

The resulting A matrix of the KMatrix for an unibranched model.

Parameters

initial_concentration – The initial concentration.

combine(k_matrix: glotaran.builtin.models.kinetic_image.k_matrix.KMatrix)glotaran.builtin.models.kinetic_image.k_matrix.KMatrix[source]

Creates a combined matrix.

Parameters

k_matrix – KMatrix to combine with.

Returns

The combined KMatrix.

Return type

combined

eigen(compartments: list[str])tuple[np.ndarray, np.ndarray][source]

Returns the eigenvalues and eigenvectors of the k matrix.

Parameters

compartments – The compartment order.

classmethod empty(label: str, compartments: list[str])KMatrix[source]

Creates an empty K-Matrix. Useful for combining.

Parameters
  • label – Label of the K-Matrix

  • compartments – A list of all compartments in the model.

fill(model: Model, parameters: ParameterGroup)cls

Returns a copy of the {cls._name} instance with all members which are Parameters are replaced by the value of the corresponding parameter in the parameter group.

Parameters
  • model – A glotaran model.

  • parameter (ParameterGroup) – The parameter group to fill from.

classmethod from_dict(values: dict)cls
classmethod from_list(values: list)cls
full(compartments: list[str])np.ndarray[source]

The full representation of the KMatrix as numpy array.

Parameters

compartments – The compartment order.

involved_compartments()list[str][source]

A list of all compartments in the Matrix.

is_unibranched(initial_concentration: glotaran.builtin.models.kinetic_image.initial_concentration.InitialConcentration)bool[source]

Returns true in the KMatrix represents an unibranched model.

Parameters

initial_concentration – The initial concentration.

property label
property matrix
matrix_as_markdown(compartments: list[str] = None, fill_parameters: bool = False)str[source]

Returns the KMatrix as markdown formatted table.

Parameters
  • compartments – (default = None) An optional list defining the desired order of compartments.

  • fill_parameters (bool) – (default = False) If true, the entries will be filled with the actual parameter values instead of labels.

mprint(parameters: ParameterGroup = None, initial_parameters: ParameterGroup = None)str
rates(initial_concentration: glotaran.builtin.models.kinetic_image.initial_concentration.InitialConcentration)numpy.ndarray[source]

The resulting rates of the matrix.

Parameters

initial_concentration – The initial concentration.

reduced(compartments: list[str])np.ndarray[source]

The reduced representation of the KMatrix as numpy array.

Parameters

compartments – The compartment order.

validate(model: Model, parameters=None)list[str]