Post Reply 
Help for a "Surface and Flux integrals" program
11-06-2017, 04:37 PM
Post: #32
RE: Help for a "Surface and Flux integrals" program
(11-04-2017 11:39 AM)Arno K Wrote:  I think the help can be implemented in the comments, then the list can be omitted. As the program works like it shall I will add some comments and then put it in the software forum.
Arno

Arno,
as we have privately discussed, to avoid problems with the exportation of u and v vars in CAS variables, in the code it would be better to insert u,v in the local statement and then the two lines purge(u); and purge(v).
The code would be this:
Code:

#cas
sfint(f,g,uvals,vvals):=
BEGIN
local gg, u, v;
purge(u);
purge(v);

//  Help;
//  Usage:sfint(f(x,y,z),[φ1(u,v),φ2(u,v),φ3(u,v)],[ulow,uhigh],[vlow,vhigh])
//  f can be a vector, too, i.e.:[x*y*z,x+y,x^2+z^3]


f:=subst(f,[x,y,z]=g);// perform the substitution in f
gg:=transpose(grad(g,[u,v]));//compute the jacobian
gg:=cross(col(gg,1),col(gg,2));
IF type(f)==DOM_LIST THEN// in case a vector-function is entered
f:=DOT(f,gg);
ELSE
f:=f*ABS(gg);//f is a scalar
END;
f:=int(f,u,uvals[1],uvals[2])
  return int(f,v,vvals[1],vvals[2]);//return the double integral
END;
#end

What you you think about?

Salvo

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Help for a "Surface and Flux integrals" program - salvomic - 11-06-2017 04:37 PM



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