Post Reply 
Directional Derivative
01-29-2015, 12:17 PM (This post was last modified: 02-05-2015 07:01 PM by salvomic.)
Post: #1
Directional Derivative
hi all,
would like anybody to help me to get a program for Directional Derivative?
Starting with this: it's the dot product between Gradient of v and person of u, ( {tex} \( \bigtriangledown f \cdot \overrightarrow{v} \) {/tex} ) so
dot (grad(u) , v/normalize(v)) could be good, but if use it with "Define" it doesn't works, as "dot" (lowercase) is always changed in "DOT" (uppercase) and the function gives error "dot vector Error: bad argument value"...

(I'm using CAS)

Thank you in advance!

Salvo
Visit this user's website Find all posts by this user
Quote this message in a reply
01-29-2015, 04:36 PM (This post was last modified: 02-05-2015 07:02 PM by salvomic.)
Post: #2
RE: Directional Derivative
I'm trying this program:

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

It seems to works with f as a function (expression), f(0), like (x^2-x*y) and v as vector (also not normalized), like [3,4] or [x,3y]; the program first normalize the vector finding its versor, and then return the symbolic directional derivative in the direction of that vector...

Any help to make it better?
There is a way to have the function listed in the Toolbox -> User?

Thank you :-)

salvo
Visit this user's website Find all posts by this user
Quote this message in a reply
01-29-2015, 06:57 PM
Post: #3
RE: Directional Derivative
(01-29-2015 04:36 PM)salvomic Wrote:  There is a way to have the function listed in the Toolbox -> User?

Thank you :-)

salvo

Make a non-CAS wrapper.

DDER(f,v)
BEGIN
derivdir(f,v);
END;

Since DDER is a non-CAS program, you would then have to enter your arguments as strings:

DDER("x^2*y+z","[3,4,1]");

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
01-29-2015, 07:08 PM
Post: #4
RE: Directional Derivative
(01-29-2015 06:57 PM)Han Wrote:  Make a non-CAS wrapper.

DDER(f,v)
BEGIN
derivdir(f,v);
END;

Since DDER is a non-CAS program, you would then have to enter your arguments as strings:

DDER("x^2*y+z","[3,4,1]");

I'll try, thank you Han!
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




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