Group Abstract Group Abstract

Message Boards Message Boards

Finding the function given the gradient vector

Posted 5 years ago
Attachments:
POSTED BY: Meryem Aslı
18 Replies

David,

What is the current version of your GrassmannAlgebra application? I tried to find out from the link at https://davidandalicepark.wordpress.com/home-2/mathematica/, but that gives a "page can't be found" error.

[Similar question for your Presentations application! (While recent versions of Mathematica have introduced some built-in complex function plotting tools along with some utility functions for complex numbers, Mathematica still lacks a lot of the functionality of "Presentations" as well as its more flexible paradigm for graphics objects.)]

POSTED BY: Murray Eisenberg

Rename your Grad(f) given above to gf = ... your expression.... and try

D[ gf[[1]], x2] == D[ gf[[2]], x1]
D[ gf[[1]], x3] == D[ gf[[3]], x1]
D[ gf[[2]], x3] == D[ gf[[3]], x2]

That means the function you are looking for does not exist

POSTED BY: Hans Dolhaine
Posted 5 years ago

Thank you so much. I will try to solve the problem using this solution method.

POSTED BY: Meryem Aslı

Hi Meryem,

any progress in your problem?

Did you realize that with your gradf a function giving this gradient does not exist?

What about telling us the background of your problem (without the lengthy Sin and Cos terms)?

Greetings HD

POSTED BY: Hans Dolhaine
Posted 5 years ago

Hello Hans. I could not deal with this question for a long time due to my health problems. Yesterday I looked at the question again and unfortunately there is no function that gives this gradient as you said.

POSTED BY: Meryem Aslı
Posted 5 years ago

Also, since each of the x1, x2, x3 terms are functions dependent on variables, I might not have reached a solution.

POSTED BY: Meryem Aslı

Hello Meryem,

your expressions are indeed somewhat complicated, so I choose a much simpler example which may, at least I hope so, give you a hint.

First of all you should check the "mixed derivatives" of your gradient, that means check the "integrability conditions". That will show if your function f exists.

Now for the example.

Define

grad[f_] := {D[f, x], D[f, y], D[f, z]}

Let's say you have a gradient

gradf = {(2 x)/z, (2 y)/z, -((x^2 + y^2)/z^2)};

Check the mixed derivatives

D[gradf[[1]], y] == D[gradf[[2]], x]
D[gradf[[1]], z] == D[gradf[[3]], x]
D[gradf[[2]], z] == D[gradf[[3]], y]

Each answer is True, so there is indeed a function giving the gradient in question.

Now chose a straight line from { x0, y0, z0 } to { x1, y1, z1 } and the derivative of the line element to calculate

Integrate [ gradf . dr ]

along this line. Set

rule = {x -> x0 (1 - t) + t x1, y -> y0 (1 - t) + t y1, z -> z0 (1 - t) + t z1};
xp = D[{x, y, z} /. rule, t];
df = (gradf /. rule).xp // FullSimplify;

Switch off the output of conditions in Integrate and do the integration, change the variables back to x, y, z and get a function yielding the given gradient

SetOptions[Integrate, GenerateConditions -> False];
ff = Integrate[df, {t, 0, 1}] /. {x1 -> x, y1 -> y, z1 -> z} // FullSimplify
grad[ff]

Of course you may as well integrate along the edges of the cuboid:

fff = Integrate[(gradf[[1]] /. {x -> u, y -> y0, z -> z0}), {u, x0, x1}] +
  Integrate[(gradf[[2]] /. {x -> x1, y -> u, z -> z0}), {u, y0, y1}] +
  Integrate[(gradf[[3]] /. {x -> x1, y -> y1, z -> u}), {u, z0, z1}]
fff = (fff // FullSimplify) /. {x1 -> x, y1 -> y, z1 -> z}
grad[fff]
gradf

I hope you got an idea how to calculate your function f.

POSTED BY: Hans Dolhaine
POSTED BY: Hans Dolhaine
Posted 5 years ago

Here {x1, x2, x3} are not components of x. I named the components of Grad(f) as x1, x2, x3, respectively. So I made a naming as "Grad(f) = {x1, x2, x3}". The "x" is just the name of the surface.

First I computed the N and H values for the x surface. Then I calculated Grad(f) from the equation "<N, Grad(f)> = H" given above.

Grad(f) is in the file I sent. I don't know the function f and my main goal is to find the function f. How can I find a function f using only Grad(f)?

POSTED BY: Meryem Aslı
Anonymous User
Anonymous User
Posted 5 years ago
POSTED BY: Anonymous User
Anonymous User
Anonymous User
Posted 5 years ago
POSTED BY: Anonymous User
Posted 5 years ago
POSTED BY: Meryem Aslı

This remains confusing. On one side there is what looks like a surface of the form z=f(x,y) (so the two parameters are x and y). Later it appear that the surface is instead of the form {f1(s,t),f2(s,t),f3(s,t)} with {s,t} being the parameters.

As a second remark, it seems that you have a gradient and want to recover a potential function? Existence of such a function requires that some second derivative equations be satisfied.

POSTED BY: Daniel Lichtblau
Anonymous User
Anonymous User
Posted 5 years ago

There's allot of free math showing how to find f from the gradient of f. Also the lagrange multiplier method (as well as others) for minimization. And linear algebra algorithms as well.

It's against Community policy to "drop a problem you haven't attempted to solve" in the forum, nor should problems be contrived to be unsolvable by certain methods without being introducing as such.

POSTED BY: Anonymous User
POSTED BY: W. Craig Carter
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard