Line integral, jacobian...

02022015, 08:56 PM
Post: #1




Line integral, jacobian...
hi all,
I need some hints to use with Prime: curve integral (for scalar function by a curve) line integral (vectorial camp by a curve) flux integral and also something to treat with Jacobian Matrix (where line are gradients). Any programs, functions? hints to create my own program easily? Thank a lot in advance! Salvo ∫aL√0mic (IT9CLU), HP Prime 50g 41CX 71b 42s 12C 15C  DM42 WP34s :: Prime Soft. Lib 

02022015, 10:42 PM
(This post was last modified: 02022015 10:57 PM by Han.)
Post: #2




RE: Line integral, jacobian...
(02022015 08:56 PM)salvomic Wrote: hi all, You should be able to do all of these in the CAS. For example, if C is the path from (0,0) to (1,1) then C is described by \( \vec{r}(t) = t\vec{i} + t\vec{j} \) where \( 0 \le t \le 1 \). If the force F is defined by \( \vec{F} = (3x2y)\vec{i} + (4x+1)\vec{j} \) then \[ \int \vec{F}\cdot d\vec{r} \] can be computed by: r:=[t,t]; dr:=diff(r,t); f:=[3*x2*y, 4*x+1]; ft:=subst(f,[x,y]=r); int(dot(ft,dr),t,0,1); If \( \vec{F} \) is pathindependent (i.e. a gradient field; also known as conservative fields) then one can simply apply the fundamental theorem of calculus for vectors. For example, if \[ \mathrm{grad}(f) = 2xy \vec{i} + (x^2+8y^3)\vec{j} \] then you can do something like: f1:=2*x*y; f2:=x^2+8y^3; check if we actually have a real gradient field: diff(f1,y)  diff(f2,x); (simplify if needed; gradient field means difference should be 0). If we have a gradient field, i.e. \( \vec{F} = \mathrm{grad}(f) \), then we can find f by: f:=int(f1,x); dg:=diff(f,y)f2; g:=int(dg,y); f:=simplify(f+g); // can optionally leave out simplify() p:=[0,0]; q:=[1,1]; subst(f,[x,y]:=q)subst(f,[x,y]=p); Edit: A CAS program is really nothing more than copying the manual commands you use in the CAS view into a CASprogram, and making some minor edits and slapping #cas and #end around everything. So I recommend playing around with the CAS view, and once you have what you want, copy it into a program. Graph 3D  QPI  SolveSys 

02022015, 11:05 PM
Post: #3




RE: Line integral, jacobian...
(02022015 10:42 PM)Han Wrote: You should be able to do all of these in the CAS. For example, if C is the path from (0,0) to (1,1) then ... thank you, Han, for this clear explanation. I'll read it again while try on CAS, and then I'll try to make one or more little program by myself, also if I'm still learning Prime's programming... Your hint for subst() is very useful for my purpose. Let's start... Salvo ∫aL√0mic (IT9CLU), HP Prime 50g 41CX 71b 42s 12C 15C  DM42 WP34s :: Prime Soft. Lib 

02032015, 08:55 PM
(This post was last modified: 04042015 12:35 PM by salvomic.)
Post: #4




RE: Line integral, jacobian...
hi Han,
a little idea, following your precious advice (and thanks Snorre for a "C like" approach that's I like), to start; but these functions need some controls to avoid incorrect input and reset... We can use two little programs: intcur: to input scalar function (x,y,z), parametric form of a curve [r(t), r(t), r(t)], lower and high bound to get a curvilinear integral intlin: to input vectorial function, parametric form of a curve, lower, high to get line integral... EDIT: these programs now works with 2 or 3 components (parametric expression: [r(t), r(t), r(t)] or [r(t), r(t)])... Code:
... Code:
∫aL√0mic (IT9CLU), HP Prime 50g 41CX 71b 42s 12C 15C  DM42 WP34s :: Prime Soft. Lib 

02042015, 02:32 PM
Post: #5




RE: Line integral, jacobian...
here my hypothesis for Jacobian Matrix function...
It should works, I hope without errors (please, see if any). Input: [f(1), f(2), ...], [x,y,...] Salvo Code:
Now, please, help me to have a short program to calculate surface integrals and flux integral (Int(f.n)), thank you ∫aL√0mic (IT9CLU), HP Prime 50g 41CX 71b 42s 12C 15C  DM42 WP34s :: Prime Soft. Lib 

09072016, 09:22 PM
(This post was last modified: 09072016 09:24 PM by toshk.)
Post: #6




RE: Line integral, jacobian...
Jacobian:
Transpose(diff(fn,[x,y,z])) or transpose(gradient([f1,f2,f3],[x,y,z]) trn(diff([x*y*z, y^2, x + z], [x, y, z])) Laplacian: divergence(gradient(f(x, y), [x y]),[x,y]) 

09072016, 10:35 PM
Post: #7




RE: Line integral, jacobian...
(09072016 09:22 PM)toshk Wrote: Jacobian: yes, thanks See also here my (and Han) solutions: Linear and curvilinear  Jacobian laplacian(Expr, Vector) is also a command inside the Prime, now... Salvo ∫aL√0mic (IT9CLU), HP Prime 50g 41CX 71b 42s 12C 15C  DM42 WP34s :: Prime Soft. Lib 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)