All right, I’ve got a question that I think can best be answered by a differential equation, which is definitely not my specialty.
I’ve got a function f(x, y), and a relationship between discrete changes in x and y. f(x, y) = x/(x + y), and [symbol]D[/symbol]y/([symbol]D[/symbol]x + [symbol]D[/symbol]y) = [symbol]a[/symbol]/([symbol]a[/symbol] + x[sub]0[/sub]). What I want to know is what change in x and y will cause the greatest decrease in f. As I understand it, the gradient will tell me the direction of greatest change, but that could be an increase.
All right, I was totally confused when I wrote the OP. I’ve got the current values of x and y, and I want to find new values of x and y such that f(x[sub]new[/sub], y[sub]new[/sub]) = [symbol]b[/symbol] (a constant) and the cost function c[sub]1[/sub][symbol]D[/symbol]x + c[sub]2[/sub][symbol]D[/symbol]y is minimized.
It seems to me that I’ve got a relationship between [symbol]D[/symbol]x and [symbol]D[/symbol]y, and it works out to be [symbol]D[/symbol]x = x[sub]0[/sub][symbol]D[/symbol]y/[symbol]a[/symbol]. So I’m trying to minimize c[sub]1[/sub]x[sub]0[/sub][symbol]D[/symbol]y/[symbol]a[/symbol] + c[sub]2[/sub][symbol]D[/symbol]y. But I’m not sure how to approach this from here.
So let me get this straight. f(x,y) = x/(x+y), and [symbol]D[/symbol]x = x[sub]0[/sub] [symbol]D[/symbol]y/[symbol]a[/symbol]. Given this, find the value of [symbol]D[/symbol]y such that the decrease in f(x,y) is maximized?
Okay, I’m an idiot. Note to self: read all posts before opening your fat yap.
I think what you want to do is to solve x/(x+y) = [symbol]b[/symbol]. I get x/[symbol]b[/symbol]-1=y. Given this relation, and that [symbol]D[/symbol]x = x[sub]0[/sub] [symbol]D[/symbol]y/[symbol]a[/symbol], solve for [symbol]D[/symbol]y which minimizes the cost function.
Am I right this time, or am I still being an idiot?
Blast! I somehow forgot my parentheses. I’m dreadfully unhelpful and have had one too many glasses of wine, I guess.
Your equation relating [symbol]D[/symbol]x to [symbol]D[/symbol]y is FROM solving f(x,y) = [symbol]b[/symbol], isn’t it? If I haven’t even understood that much, I’m going to go into a corner and cry.
No, the equation relating [symbol]D[/symbol]x to [symbol]D[/symbol]y is independent of f(x, y) = [symbol]b[/symbol]. It’s just another constraint.
Besides, math is more fun when you’re drunk.
I think I made this more complicated than it needs to be. f(x, y) = [symbol]b[/symbol] is equivalent to y = (1 - [symbol]b[/symbol])x/[symbol]b[/symbol], and [symbol]D[/symbol]x = x[sub]0[/sub][symbol]D[/symbol]y/[symbol]a[/symbol] is equivalent to x - x[sub]0[/sub] = x[sub]0[/sub](y - y[sub]0[/sub])/[symbol]a[/symbol]. Those are both linear equations relating x and y.
:smack:
So all we have to do is solve them simultaneously, and we’re good to go. Unfortunately, the algebra gets rather nasty from here on out. It looks like there’s only one point that satisfies the initial conditions, cost function be damned.
I don’t understand what you mean by cost function, so I could be way off base here. But the gradient is a vector that points in the direction of fastest increase. If you want the fastest decrease, you go in the opposite direction.
I have both MathCad and Maple. Both can do differentials and integrals. I have no clue with this stuff, but you tell me how to enter the equations, I can get it to tell you the solution, I think.
Ask them to solve f(x, y) = [symbol]b[/symbol] and [symbol]D[/symbol]x = x[sub]0[/sub][symbol]D[/symbol]y/[symbol]a[/symbol] simultaneously. Use [symbol]D[/symbol]x = x - x[sub]0[/sub] and [symbol]D[/symbol]y = y - y[sub]0[/sub], just for consistency with my notation.
Do you want the direction of greatest decrease in f(x,y), or do you want the minimum of f(x,y), while also satisfying your cost function?
If it’s the latter, you can use Lagrange multipliers. To minimize a function f(x,y) subject to constraint c(x,y) = 0, solve the system of three equations in three unknowns (x,y,g):
c(x,y) = 0
df/dx + g*(dc/dx) = 0
df/dy + g*(dc/dy) = 0
If it’s the former, then I don’t think I understand the question.