Previous topic

Scalar

Next topic

Matrix

This Page

Array

class pybamm.Array(entries, name=None, domain=None, auxiliary_domains=None, entries_string=None)[source]

Node in the expression tree that holds an tensor type variable (e.g. numpy.array)

Parameters
  • entries (numpy.array or list) – the array associated with the node. If a list is provided, it is converted to a numpy array

  • name (str, optional) – the name of the node

  • domain (iterable of str, optional) – list of domains the parameter is valid over, defaults to empty list

  • auxiliary_domainds (dict, optional) – dictionary of auxiliary domains, defaults to empty dict

  • entries_string (str) – String representing the entries (slow to recalculate when copying)

  • *Extends

create_copy()[source]

See pybamm.Symbol.new_copy().

is_constant()[source]

See pybamm.Symbol.is_constant().

property ndim

returns the number of dimensions of the tensor.

set_id()[source]

See pybamm.Symbol.set_id().

property shape

returns the number of entries along each dimension.

to_equation()[source]

Returns the value returned by the node when evaluated.

pybamm.linspace(start, stop, num=50, **kwargs)[source]

Creates a linearly spaced array by calling numpy.linspace with keyword arguments ‘kwargs’. For a list of ‘kwargs’ see the numpy linspace documentation

pybamm.meshgrid(x, y, **kwargs)[source]

Return coordinate matrices as from coordinate vectors by calling numpy.meshgrid with keyword arguments ‘kwargs’. For a list of ‘kwargs’ see the numpy meshgrid documentation