Errors

pdemagic raises one of four errors, all of them subclasses of pm.PdemagicError. Each carries a message that names what was found.

Error

In short

InvalidProblemError

The problem is inconsistent or incomplete, or has no solution.

UnsupportedProblemError

The problem is fine, and pdemagic cannot solve it yet.

InvalidPlanError

The plan does not fit the problem.

ConvergenceError

An iteration or a time stepping did not reach its tolerance.

exception pdemagic.PdemagicError

Base class of all errors raised by pdemagic.

It is never raised itself. Catch it to catch every error that pdemagic raises.

exception pdemagic.InvalidProblemError

The problem description is malformed or inconsistent.

It is raised when a problem is built, planned or solved and is inconsistent or incomplete, or has no unique solution: a face without a condition, an unknown without an initial value, a symbol that is not a coordinate, a box that resonates. The message says what is wrong, and the remedy is to correct the problem.

exception pdemagic.UnsupportedProblemError

The problem is well-formed, but pdemagic cannot solve it yet.

It is raised by pm.plan and pm.solve when the problem is well formed and no method takes it yet. The message names what it found, and often the form that is taken instead. What is solved where lists the forms, and the page of known limits everything that is refused.

exception pdemagic.InvalidPlanError

The plan is malformed, or does not fit the problem.

It is raised by pm.solve when the plan that it is given cannot be read or does not fit the problem: a method that is not known or does not apply to the domain, a grid with the wrong number of axes. Start again from pm.plan(problem) and change single entries.

exception pdemagic.ConvergenceError

An iterative method did not reach its tolerance.

It is raised by pm.solve when an iteration, Newton’s method or a time stepping did not reach its tolerance within its steps. No result is returned. Raise method.max_iterations or method.max_steps in the plan, loosen method.tolerance, refine the grid, or give Newton’s method another guess.

See also: The planner and its plan and Accuracy and diagnostics.