Post Reply 
Directional Derivative
05-15-2015, 08:26 PM (This post was last modified: 05-15-2015 08:28 PM by salvomic.)
Post: #1
Directional Derivative
hi all,
my proposal for a function to calculate directional derivative ( \( \bigtriangledown f \cdot \overrightarrow{v} \) ).
It's a CAS program. Use: derivdir(f,v), where f is a function and v a vector.
I would like to thank Han for his hints in making this program.

Enjoy!
Salvo


Code:

#cas
// Directional derivative: dot(grad(f0), normalize(v))
derivdir(f,v):=
BEGIN
local g:=grad(f,[x,y,z]);
// gradient
local w:=normalize(v);
// versor
m:=dot(g,w);
// dot product
return m;
END;
#end

∫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
05-11-2019, 11:21 AM
Post: #2
RE: Directional Derivative
Nice program.
It works.
Curious that DOT product should be written in lowercase letters. Also "local" seems to be necessary in lowercase.
Thanks
Find all posts by this user
Quote this message in a reply
Post Reply 




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