Line integral and curvilinear integral - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: HP Prime Software Library (/forum-15.html) +--- Thread: Line integral and curvilinear integral (/thread-3851.html) |
Line integral and curvilinear integral - salvomic - 05-15-2015 08:17 PM hi all, here there are two programs (CAS) to calculate Line integral (for vectorial functions fields) and Curvilinear Integral (for scalar functions). intcur: INPUT a scalar function (x,y,z), a parametric form of a curve [r(t), r(t), r(t)], lower and high bound and the programs returns curvilinear integral intlin: INPUT a vectorial function, a parametric form of a curve (as above), lower and high bound and the program returns linear integral. These programs work with 2 or 3 components (parametric expression: [r1(t), r2(t), r3(t)] or [r1(t), r2(t)])... Examples: 1.0 to find the curvilinear integral of z in a circle (parametric: x=COS(t), y=SIN(t), z=t) from 0 to 2π intcur(z, [COS(t), SIN(t), t], 0, 2*π) -> 2*√2*π^2 2. to find the line integral of F=‹x*SIN(y), y› along the path ‹t, t^2› from -1 to 2 intlin([x*SIN(y), y], [t, t^2], -1,2) -> (15/2)+(COS(1)-COS(4))/2 Enjoy! Salvo Micciché Code:
... Code:
EDIT: put above a slightly new code, in which t is a local variable that's now purged first to being used in the integral calculus, to avoid to leave a global variable in CAS Vars. |