Created
January 18, 2024 00:54
-
-
Save Observatorio-de-Matematica/5420f7818d2c2550bbb610c406a3a43d to your computer and use it in GitHub Desktop.
Extracted from https://maxima.sourceforge.io/docs/tutorial/en/gaertner-tutorial-revision/Pages/sources/lineInt.mc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -------------------------------------------------- | |
Compute the line integral of fn along the path path | |
for parameter values from p0 to p1. | |
fn is an expression, | |
path a list of two or three equations, one for each | |
coordinate. The left hand sides of the equations | |
are the names of the coordinates, the right | |
hand sides are expressions in param | |
---------------------------------------------------*/ | |
lineIntegral(fn, path, param, p0, p1) := | |
block ( [substitutedFn, x, xx], | |
substitutedFn: sublis(path, fn), | |
x : ev (substitutedFn, diff), | |
xx: subst(1, Diff(param), x), | |
Integrate(xx, param, p0, p1) | |
)$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment