_Jacobian

it.grypho.scala.leonardo.vector._Jacobian
case class _Jacobian(e: _Expression, coords: Vector[_Variable], system: CoordinateSystem = ...) extends _VectorOperator

jacobian(F, x, y, …) — the m×n matrix of first partials, Jᵢⱼ = ∂Fᵢ/∂xⱼ.

Cartesian only (F_0191): in a curvilinear system the physical-component Jacobian carries scale-factor and connection terms, so the plain partials would be a confidently wrong matrix — jacobian([[r],[0],[0]], r, t, z, cylindrical) has trace 1 where div of the same field is 2. Any other system stays symbolic.

Value parameters

coords

the n coordinates, in order

e

the vector field (m×1)

system

the coordinate system (only Cartesian evaluates)

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait _Expression
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def eval(env: Environment): Either[_Expression, _Value]

Reduces this expression in the given environment.

Reduces this expression in the given environment.

Value parameters

env

variable bindings and display precision

Attributes

Returns

Right(v) when all free variables resolved to concrete values; Left(e) when reduction is partial or impossible

Definition Classes
override def rebuild(c: List[_Expression]): _Expression

Reconstructs the same node shape with replacement sub-expressions.

Reconstructs the same node shape with replacement sub-expressions.

Value parameters

newChildren

replacements in the same order and count as children

Attributes

Definition Classes

Inherited methods

override def children: List[_Expression]

Sub-expressions subject to recursive structural traversal. Binder positions (e.g. the differentiation variable) are excluded.

Sub-expressions subject to recursive structural traversal. Binder positions (e.g. the differentiation variable) are excluded.

Attributes

Definition Classes
Inherited from:
_VectorOperator
protected def column(cs: Vector[_Expression]): _Matrix

columnIn in the Double tier. @param cs the components

columnIn in the Double tier. @param cs the components

Attributes

Inherited from:
_VectorOperator
protected def columnIn(cs: Vector[_Expression])(using exact: Boolean): _Matrix

Builds a column vector from its components, simplified.

Builds a column vector from its components, simplified.

Attributes

Inherited from:
_VectorOperator
protected def componentsOf(x: _Expression, env: Environment): Option[Vector[_Expression]]

Reads e as an n×1 vector field: its components, or None when it is not one.

Reads e as an n×1 vector field: its components, or None when it is not one.

A literal matrix is read without evaluating it, and that ordering is load-bearing: the components must be differentiated before any point is substituted. Evaluating first would collapse [[x^2], [y^3]] to a dense _MatrixValue as soon as the coordinates happen to be bound — every cell a constant, every derivative zero, and a confidently wrong answer rather than a refusal.

Only a non-literal argument is evaluated, which covers the variable-bound-to-a-matrix case (the general lesson that matrix-vs-scalar cannot always be decided at parse time). An Environment holds _Values, so such a binding is necessarily a dense _MatrixValue: its cells are constants and their derivatives are legitimately zero.

A field is a column (n×1); a row vector is a different object and is refused.

Attributes

Inherited from:
_VectorOperator
protected def d(x: _Expression, i: Int): _Expression

dIn in the Double tier. @param x the field @param i the coordinate's index

dIn in the Double tier. @param x the field @param i the coordinate's index

Attributes

Inherited from:
_VectorOperator
protected def dIn(x: _Expression, i: Int)(using exact: Boolean): _Expression

∂x/∂coords(i), simplified, in the operator's tier (F_0273).

∂x/∂coords(i), simplified, in the operator's tier (F_0273).

Attributes

Inherited from:
_VectorOperator
protected def evaluatedIn(env: Environment): Either[_Expression, _Value]

unevaluated evaluated in env (F_0285): a bound coordinate folds, so hessian(f, x, y) with x and y bound is the matrix det and eigen of it see. The node itself when the operator declines.

unevaluated evaluated in env (F_0285): a bound coordinate folds, so hessian(f, x, y) with x and y bound is the matrix det and eigen of it see. The node itself when the operator declines.

Attributes

Inherited from:
_VectorOperator
protected def exactIn(env: Environment): Boolean

Whether this operator computes in the exact tier: its field, the bound values of its names, or the session's exact mode (F_0273, through containsExactIn).

Whether this operator computes in the exact tier: its field, the bound values of its names, or the session's exact mode (F_0273, through containsExactIn).

Attributes

Inherited from:
_VectorOperator
protected def h: Vector[_Expression]

hIn in the Double tier.

hIn in the Double tier.

Attributes

Inherited from:
_VectorOperator
protected def hIn(using exact: Boolean): Vector[_Expression]

The scale factors, or an empty vector when the request is ill-posed (guarded by wellPosed at every use site).

The scale factors, or an empty vector when the request is ill-posed (guarded by wellPosed at every use site).

Attributes

Inherited from:
_VectorOperator
protected def handedness: Int

Orientation of the ordered basis: +1 right-handed, -1 left-handed.

Orientation of the ordered basis: +1 right-handed, -1 left-handed.

Only curl reads this, and it must. The curl formula below is derived for a right-handed (q₁, q₂, q₃); SphericalMaths exchanges the last two coordinates of Spherical, and swapping two basis vectors flips the orientation, so the same formula returns −curl there. grad, div and laplacian involve no cross product and are orientation-free, which is why the sign lives here rather than in each operator.

Attributes

Inherited from:
_VectorOperator
protected def jacobianFactor: _Expression

jacobianFactorIn in the Double tier.

jacobianFactorIn in the Double tier.

Attributes

Inherited from:
_VectorOperator
protected def jacobianFactorIn(using exact: Boolean): _Expression

The Jacobian factor h₁·h₂·…, the volume element's coefficient.

The Jacobian factor h₁·h₂·…, the volume element's coefficient.

Attributes

Inherited from:
_VectorOperator
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
protected def scaleFactors: Option[Vector[_Expression]]

The scale factors (h₁, h₂, …) for this coordinate system and tuple.

The scale factors (h₁, h₂, …) for this coordinate system and tuple.

Every operator below is written once, in terms of these; Cartesian is the h = 1 case, which is why generalising the formulas left its results untouched. None when the system cannot describe this tuple — cylindrical and spherical are three-dimensional, and a request in any other arity is refused rather than answered in the wrong geometry.

Attributes

Inherited from:
_VectorOperator
protected def scaleFactorsIn(exact: Boolean): Option[Vector[_Expression]]

scaleFactors with the unit factors in the computation's tier (F_0273): a Double 1 dividing a component demoted an exact field, div([[x], [y], [z]], x, y, z) answering 3.0.

scaleFactors with the unit factors in the computation's tier (F_0273): a Double 1 dividing a component demoted an exact field, div([[x], [y], [z]], x, y, z) answering 3.0.

Attributes

Inherited from:
_VectorOperator
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Inherited from:
_VectorOperator
protected def total(terms: Vector[_Expression]): _Expression

totalIn in the Double tier. @param terms the terms

totalIn in the Double tier. @param terms the terms

Attributes

Inherited from:
_VectorOperator
protected def totalIn(terms: Vector[_Expression])(using exact: Boolean): _Expression

Sums a list of terms, folding to 0 when empty.

Sums a list of terms, folding to 0 when empty.

Attributes

Inherited from:
_VectorOperator
protected def wellPosed: Boolean

True when the request is one this tier can answer at all: a coordinate tuple with no repeats, in an arity the coordinate system supports. grad(f, x, x) names no basis and is refused rather than silently producing a duplicated component.

True when the request is one this tier can answer at all: a coordinate tuple with no repeats, in an arity the coordinate system supports. grad(f, x, x) names no basis and is refused rather than silently producing a duplicated component.

Attributes

Inherited from:
_VectorOperator

Inherited fields

lazy val freeVars: Set[String]

Cached set of free variable names; O(1) after the first access.

Cached set of free variable names; O(1) after the first access.

Attributes

Inherited from:
_Expression