       Re: Problems evaluating Grad

• To: mathgroup at smc.vnet.net
• Subject: [mg39425] Re: Problems evaluating Grad
• From: adam.smith at hillsdale.edu (Adam Smith)
• Date: Fri, 14 Feb 2003 03:24:25 -0500 (EST)
• References: <b2fpvg\$k66\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```The main difficulty here is that the package Calculus`VectorAnalysis`
assumes a default coordinate system Cartesian[Xx,Yy,Zz].  The current
Coordinate system used can be viewed by executing Coordinates[].  The
functions Grad, Div, Curl are very picky about the coordinates as
shown below

In:=
<<Calculus`VectorAnalysis`

In:=
Coordinates[]

Out=
{Xx,Yy,Zz}

Below I get what I expect
In:=

Out=
{1,1,0}
But using x and y instead of Xx and Yy gives me zero, since the
partial derivatives with respect to "Xx" and "Yy" of x+y are zero
In:=

Out=
{0,0,0}

The solution to this is to set the default coordinates coordinates.

In:=
SetCoordinates[Cartesian[x,y,z]]

Out=
Cartesian[x,y,z]

Now for x+y things work as expected

In:=

Out=
{1,1,0}

But your f[a,b] will still give zero because the partial derivatives
of a+b with respect to x and y are zero.

In:=
f[x_,y_]:=x+y

In:=
f[a,b]

Out=
a+b

In:=

Out=
{0,0,0}

I am guessing that you really wanted Grad[f[x,y]]
In:=

Out=
{1,1,0}

"Konrad Den Ende" <chamsterkonrad at bigfoot.com> wrote in message news:<b2fpvg\$k66\$1 at smc.vnet.net>...
> I'd like to detrmine Grad to a function so i go:
> <<Calculus`VectorAnalysis`
> f[x_,y_]:=x+y
>
>
> I get no errors, but the answer is simply the same thing
> that i asked, as if no computation was done. What do i
> do wrong?
>
> Also - when i evaluated the examples in Help i got the same
> behavior. The answer that already is there gets exchanged
> to something else upon my evaluation. Namely, the question
> itself. What is that?!
>
> --
>
> Vänligen
> ---------------------------------------------------
> phone #1:  (+46/0) 708 - 70 73 92
> phone #2: (+46/0) 704 - 79 96 95
> e-mail: chamsterkonrad at bigfoot.com
> -----------------------------------
>
> Sleep - thing used by ineffective people
>             as a substitute for coffee
>
> Ambition - a poor excuse for not having
>                  enough sence to be lazy
> ---------------------------------------------------

```

• Prev by Date: Re: Simple List question. HELP.
• Next by Date: Re: Problems evaluating Grad
• Previous by thread: Re: Problems evaluating Grad
• Next by thread: Re: Problems evaluating Grad