conatus.expert.Problem

class conatus.expert.Problem(variables, *, name=None, symmetry=None, namespace=None)[source]

Bases: object

Common machinery: variables, equations, LHS/RHS checks, counting, explain().

Parameters:
kind = 'abstract'
add_equation(eq, namespace=None)[source]

Add Equation, (lhs, rhs) or a string "lhs = rhs" (parsed by conatus.ir.parse in the declared namespace: the variables, self.namespace and namespace; no eval).

Parameters:
  • eq (Equation | tuple | str)

  • namespace (Any)

Return type:

Equation

add_bc(*conditions, into=None)[source]

Add boundary conditions and their tau terms (standard tau), declared in explain().

Each condition is an expression meaning expr = 0 or a tuple (lhs, rhs). All conditions of one call act along one coordinate (read off their interp nodes). For each condition one tau variable (constant along that coordinate) is created and lifted into the next highest mode of the target equation’s basis: N-1, N-2, … in the order of the conditions. The target is the only bulk equation along the coordinate, or into (equation index) when there are several: never guessed. With a symmetry subspace the taus and their parities must be declared by hand (refused here).

Parameters:
  • conditions (Any)

  • into (int | None)

Return type:

list[Equation]

symmetry_report()[source]

Parities of the equations and unknowns under each declared reflection.

Return type:

str

check()[source]

Whole-problem consistency checks that single equations cannot see (hook).

Return type:

None

ncc_fields()[source]

Non-variable fields appearing in LHS terms (non-constant coefficients).

Return type:

frozenset[Field]

rank_report()[source]

IR-level counts (before discretization; the discrete rank is Plan.check).

Return type:

RankReport

explain()[source]

Variables, coefficients, parameters, equations, taus and the rank report.

Return type:

str