symbolic pack¶
19 nodes, in noodlelab[maths] and above.
Symbolic¶
Differentiate¶
symbolic.differentiate
The derivative with respect to variable, order times.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
Default |
|
|
Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
Equation¶
symbolic.equation
An equation, lhs = rhs, for Solve and Solve ODE. Primes are
derivatives: y''(x) is d²y/dx². Without =, the expression equals zero.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
SymPy notation: w*L^2/12, sqrt(x), sin(2 pi f t). Juxtaposition multiplies (2 x, E I). E and I are symbols; e is Euler’s number. {a} … {d} insert linked expressions. Other constants (c, g0, k_B…) are symbols until a Values line names them: g = g0. Default |
|
|
Optional. |
|
|
Optional. |
|
|
Optional. |
|
|
Optional. |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
Equations¶
symbolic.equations
Several equations, one per line, to be solved together with Solve
System or Solve Numerically, or written as a matrix with Linear System:
one balance equation per mass of a structure, say. Lines starting with
# are comments.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
SymPy notation: w*L^2/12, sqrt(x), sin(2 pi f t). Juxtaposition multiplies (2 x, E I). E and I are symbols; e is Euler’s number. {a} … {d} insert linked expressions. Other constants (c, g0, k_B…) are symbols until a Values line names them: g = g0. One equation per line. Default |
|
|
Optional. |
|
|
Optional. |
|
|
Optional. |
|
|
Optional. |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
Evaluate¶
symbolic.evaluate
Put numbers with units into an expression. Units are carried through, so the result has the right dimension: a moment from kN/m and m comes out in kN·m. An array value (a quantity holding many numbers) gives an array.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
|
|
|
Unit of the result; empty: worked out Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
Evaluate Matrix¶
symbolic.evaluate_matrix
Put numbers with units into a symbolic matrix, such as the stiffness matrix from Linear System, for the matrix nodes. A matrix has one unit for every entry: entries that come out in different units are an error (zeros fit any unit). Values with uncertainties are used at their nominal values, since a matrix carries none: use Monte Carlo to propagate them.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
|
|
|
Unit of every entry; empty: worked out Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
Evaluate Over Range¶
symbolic.evaluate_range
Evaluate an expression at evenly spaced values of one variable, such as
the deflection along a beam. peak is the value largest in size (with
its sign) and peak_at where it occurs. Array quantities plot through
Magnitude (Array). Complex values, which have no order, are ranked by
their size |y|: minimum and maximum are then the smallest and the
largest in size.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
|
|
|
Default |
|
|
An expression in the values: 0, L/2 Default |
|
|
An expression in the values: L Default |
|
|
Default |
|
|
Unit of the result; empty: worked out Default |
|
|
Unit of x; empty: that of start Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Expression¶
symbolic.expression
A symbolic expression typed as text. Names that are not functions
become symbols; {a} … {d} insert the linked expressions, so
-E*I*diff({a}, x, 2) differentiates whatever is linked to a.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
SymPy notation: w*L^2/12, sqrt(x), sin(2 pi f t). Juxtaposition multiplies (2 x, E I). E and I are symbols; e is Euler’s number. {a} … {d} insert linked expressions. Other constants (c, g0, k_B…) are symbols until a Values line names them: g = g0. Default |
|
|
Optional. |
|
|
Optional. |
|
|
Optional. |
|
|
Optional. |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
Expression To Math¶
symbolic.to_math
Typst math for the report’s Add Equation node: the expression as it
would be typeset, optionally as left = expression. A system of
equations is typeset one equation per line.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
Optional left-hand side, e.g. M(x) or sigma_max Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
Integrate¶
symbolic.integrate
The integral with respect to variable: indefinite (without a
constant), or between two limits, which may be symbols such as 0 and L.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
Default |
|
|
Empty for an indefinite integral Default |
|
|
Empty for an indefinite integral Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
Iterate¶
symbolic.iterate
Repeat a step until the answer stops changing: a while loop in one node.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
Optional. |
|
|
Default |
|
|
Default |
|
|
The first guess, an expression in the values: 0.02, L/2 Default |
|
|
Stop when a pass changes x by less than 10^-digits of x Default |
|
|
Default |
|
|
Unit of the result; empty: worked out Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Linear System¶
symbolic.linear_system
Write linear equations as a matrix equation, A x = b, with x the unknowns in the order given: the equilibrium of masses on springs gives the stiffness matrix K and the force vector F. Evaluate Matrix puts numbers into both, and Solve Linear System solves it.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
The unknowns, comma separated: x1, x2 Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
|
|
|
Set Value¶
symbolic.set_value
Add a linked value (a quantity or a number from elsewhere in the graph)
to a set of values, under name.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
Optional. |
|
|
Default |
|
|
Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
Simplify¶
symbolic.simplify
Rewrite an expression: simplify (SymPy’s heuristics), factor, expand products and powers, cancel common factors, put over one denominator (together), or simplify trigonometric functions.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
Solve¶
symbolic.solve
Solve an equation (or expression = 0) for one unknown, in symbols.
solution is the solution numbered pick, solutions all of them.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
Default |
|
|
Which solution, when there are several Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
|
|
|
Solve Numerically¶
symbolic.solve_numeric
Solve equations, linear or not, numerically for the unknowns that have
a guess, starting from those guesses (SciPy’s root). Each unknown comes
out in the unit of its guess. The other symbols take values, whose
uncertainties are propagated to the solutions (GUM).
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
A first guess for each unknown, with its unit, one per line: x1 = 1 cm Default |
|
|
Optional. |
|
|
hybr: as many equations as unknowns; lm: least squares, more is fine Default |
|
|
Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Solve ODE¶
symbolic.solve_ode
Solve an ordinary differential equation for function(variable).
With enough conditions the constants of integration are found; without,
they stay as C1, C2, … The result is the right-hand side, y(x).
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
Default |
|
|
Default |
|
|
Boundary or initial conditions, comma separated: y(0) = 0, y’(L) = 0 Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
Solve System¶
symbolic.solve_system
Solve several equations together for several unknowns, in symbols.
answers shows them all (x1 = …, x2 = …), solution is one of them
for Evaluate, and solutions is the column of all of them, in the order
of unknowns. An unknown the equations leave free stays a symbol.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
The unknowns, comma separated: x1, x2 Default |
|
|
The unknown that solution gives, such as x2; empty: the first Default |
|
|
Which solution, when there are several (from 0) Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
Substitute¶
symbolic.substitute
Replace symbols by expressions: x = L/2 gives the value at mid-span,
still in symbols. To put in numbers with units, use Evaluate.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
name = expression; one per line or ; separated Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
Values¶
symbolic.values
Numbers, usually with units, for the symbols of an expression. A value
without a unit is a plain number. A value can also name a constant, with
its unit and uncertainty: g = g0 is standard gravity, and a line that
is just a name, such as c, means c = c. Constants are looked up
before units, so h is Planck’s constant here, not an hour: write
t = 1 h for an hour. A name that means something else as a unit is
flagged with a warning.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
name = value with a unit, one per line: E = 200 GPa, L = 6 m, n = 3. A constant by name: g = g0, or just the line c Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|