Directional Derivative
01-29-2015, 12:17 PM (This post was last modified: 02-05-2015 07:01 PM by salvomic.)
Post: #1
 salvomic Senior Member Posts: 1,396 Joined: Jan 2015
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)

Salvo
01-29-2015, 04:36 PM (This post was last modified: 02-05-2015 07:02 PM by salvomic.)
Post: #2
 salvomic Senior Member Posts: 1,396 Joined: Jan 2015
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
01-29-2015, 06:57 PM
Post: #3
 Han Senior Member Posts: 1,882 Joined: Dec 2013
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
01-29-2015, 07:08 PM
Post: #4
 salvomic Senior Member Posts: 1,396 Joined: Jan 2015
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!
 « Next Oldest | Next Newest »

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