# Finding the function given the gradient vector

Posted 1 year ago
6017 Views
|
18 Replies
|
6 Total Likes
|
 Hello. The gradient vector Grad(f) of the function f is given as in the file. Question 1: How can I find the smallest value of Grad(f) based on variables x1 and x2 ? Question 2: Given only Grad(f) vector, how can I find the function f ? I will be very happy if those who know this subject can help. Attachments:
18 Replies
Sort By:
Posted 1 year ago
 It is not quite clear to me what you are asking. (first, your syntax is a bit off. You probably want to use a symbol for the lhs, not Grad (f).).A gradient is a vector. When you say "smallest", do you smallest magnitude? And, assuming the gradient was taken with respect to x1,x2, x3, do you want to know the smallest magnitude at each point {x1,x2,x3}.If so, you will have two differential algebraic equations for g[t] in parameters t and s at each point x1,x2,x3. Looking at the equations, it is unlikely that you will be able to find a symbolic solution with Mathematica or any other symbolic algebra package. (I tried, but gave up after Mathematica didn't come back with an answer in 5 minutes). You will also need to give two initial conditions for g.Another strategy may be to expand the magnitude of the gradient, gf.gf to first order in in s,t around s=0,t=0. But, I am not sure if that is helpful for your purpose.
Anonymous User
Anonymous User
Posted 1 year 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 1 year ago
 This question seems to be poorly stated. First, Is this a 2-dimensional problem with coordinates x1 and x2? Then what is the long expression in the right hand side list? Are these the components of a vector field? Then this seems to be a 3-dimensional problem. And what are all these other variables? Do they have a dependence on the coordinates that is not shown? If not why not just condense them to a scalar parameter?In general given a potential field f[coordinates] one can take the gradient and obtain a vector field. But these calculations are more commonly done using differential forms as covectors. Then the vector field is given by the exterior derivative of the potential. But it is not true that every vector field is given by the derivative of a potential function f. The vector field has to be exact, which means in turn that it is closed. That means that the exterior derivative of the vector field is zero. Then one has to define a line integral from some point to every other point to calculate a potential function.Using my GrassmannCalculus application I was able to do the very simplest of cases - using the potential of a gravitational field from a point source to calculate the force field - all done symbolically. Then starting with the force field, showing it was closed and designing line integrals to get back the potential function.In general it's a more difficult topic because it depends on the global topology of the manifold and involves de Rham cohomology theory of which I know little - if anything.
Posted 1 year ago
 Honestly, my English is not enough to express what I want to say. Yes, here is a vector such that Grad(f) = {x1, x2, x3}. The x3 component is the long expression in the list on the right. Yes, these are the components of a vector field. This is a 3 dimensional problem. I wrote the 3rd component x3 in terms of x1 and x2. As you said, I want to know the smallest magnitude at each point {x1,x2,x3}.Here s and t are scalar variables. g(t) is the function dependent on t. a and b are constant numbers. I can summarize the problem I'm trying to solve as follows:There is a surface equation given by this parameterization. --> x := (a + tCos[bs] - g[t]Sin[bs]){Cos[s], Sin[s], 0} + {0, 0, tSin[bs] + g[t]Cos[b*s]}I found the mean curvature (H) and the unit normal vector (N) of the surface.< N , Grad(f) > = HI'm trying to find function '' f '' here. I have no information about the programs and methods that can calculate this.We can choose the variables x1 and x2 as we want. How can I find the smallest magnitude at each point {x1, x2, x3}?
Posted 1 year ago
 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.
Anonymous User
Anonymous User
Posted 1 year ago
 If you put x3 in terms of x1 and x2 and applied the gradient you still would not have the expression first posted (for one thing, the first element of the vector x cannot be x1 after the gradient since that was the value before the gradient). Also if you knew the equation for x then why would post a questionably formulated gradient and as what it was (this is not an arcane puzzle forum)? Also Grad[ x ] evaluates without substitutions. But that doesn't matter.When working with gradients during a calculus course it is easy to apply the Grad operator and get a nasty expressions perhaps hundreds of terms long (many are surprised by this). The answer is not to do it that way. If you are led to a wild expression in your vectors you should do as the book proposes one step at a time to maintain a solvable expressions. You will learn other methods as you advance in Mathematics but you will have to wait. Therefore technique of expressing one vector in terms of another is not "always useful".
Anonymous User
Anonymous User
Posted 1 year ago
 I want to underline what the first responding poster said* a minimization problem (other than 0) requires a constraint which still hasn't been stated. Say, two curves and a condition that says "what is considered minimal" (the distance between them or along them? a mutual distance from the origin?)*You've also said you want f, but I assume f( x ) is the surface you gave, that the surface is not the constraint. If the constraint is the surface and you gave us (grad f)={x1,x2,f[x1,x2]} then you've still withheld (grad f)={x1,x2,x3} meaning before you altered it.I can only guess you mean the direction of greatest change is normal to the surface and of least change is tangent to surface as a condition. In that light you want the equation that is always tangent to the surface and the gradient is not necessary since the surface was given. If r[t,s] = surface given, then r'[t,s] (easily done by mathematica), is tangent to the surface at each point and so the direction of least change. If you have N you should already have T, the tangent vector. (* the vector valued surface *) In[109]:= D[(a + t Cos[b s] - g[t] Sin[b s]) {Cos[s], Sin[s], 0} + {0, 0, t Sin[b s] + g[t] Cos[b s]}, t, s] (* the direction of least change, r'[t,s] *) Out[109]= {Cos[s] (-b Sin[b s] - b Cos[b s] Derivative[1][g][t]) - Sin[s] (Cos[b s] - Sin[b s] Derivative[1][g][t]), Sin[s] (-b Sin[b s] - b Cos[b s] Derivative[1][g][t]) + Cos[s] (Cos[b s] - Sin[b s] Derivative[1][g][t]), b Cos[b s] - b Sin[b s] Derivative[1][g][t]} If you mean minimal curvature K, then since you have a wavy sin cos surface then you may only need the maximum points of the surface to find minimal K or the 0 points for greatest K (ie, it may be a trick question not requiring the kind of solution your looking for).You should ask a teacher or look in the book's "solution guide". And you should ask people this kind of question without the problem FULLY TYPED OUT as the book had it (and page, and name) - which likely requires being in a different forum altogether.
Posted 1 year ago
 It could be that the problem is to:1) First, calculate a scalar potential field,f, from the vector force field. (The statement seems to indicate there is one.)2) Then, as a second step, find the maximum of the potential on the surface specified.Maybe this has somehow all gotten mashed together.A clearer statement of the objective is necessary.
Posted 1 year 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 " = 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 1 year ago
Posted 1 year ago
 In general the procedure may be written as grad[f_] := {D[f, x], D[f, y], D[f, z]} t1 = Integrate[a[u, y0, z0], {u, x0, x}]; t2 = Integrate[b[x, u, z0], {u, y0, y}]; t3 = Integrate[c[x, y, u], {u, z0, z}]; (*Integrability conditions *) rr = { Derivative[1, 0, 0][b][xx__] -> Derivative[0, 1, 0][a][xx], Derivative[1, 0, 0][c][xx__] -> Derivative[0, 0, 1][a][xx], Derivative[0, 1, 0][c][xx__] -> Derivative[0, 0, 1][b][xx] }; F = t1 + t2 + t3; grad[F] grad[F] /. rr
Posted 1 year ago
 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 1 year ago
 Thank you so much. I will try to solve the problem using this solution method.
Posted 1 year ago
 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 1 year 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 1 year ago
 Also, since each of the x1, x2, x3 terms are functions dependent on variables, I might not have reached a solution.