# 2 unknowns equation

8 replies to this topic

### #1 mireazma

mireazma

GMC Member

• GMC Member
• 282 posts

Posted 29 December 2011 - 11:48 PM

Hello and happy holidays!
Like normal ppl who spend the holidays relaxing, cheering and chilling with friends, here I am wishing to put under the tree a... solution. The problem is although I've begun to study math, I can't think of a way to solve a 2 unknown equation. Normally, I'd use a system or a matrix but this is just awkward because the function is not injective (hope I'm correctly putting the newly learned math to work):

x = 5000; y = 0; f(x,y) = 1;
x = 200000; y = 0; f(x,y) = 1;
x = 5000; y = 1000; f(x,y) = 1.5;
x = 200000; y = 1000; f(x,y) = 1.01;

I know that for a linear 2 unknown equation I need a 2 equation system. But I think I need all 4 to solve it. I don't even know if it has solutions in a linear (1st degree) system.
Could it be the case of 2 composed functions?
I'd appreciate very much not the solution but a way of solving this type of "system" generally.

Think could Santa Claus come to me this year? I've been nice, you know
• 0

### #2 ookami125

ookami125

GMC Member

• GMC Member
• 217 posts
• Version:GM:Studio

Posted 30 December 2011 - 12:07 AM

just wait a minute or 2 ill do my best to solve this
• 0

### #3 ookami125

ookami125

GMC Member

• GMC Member
• 217 posts
• Version:GM:Studio

Posted 30 December 2011 - 01:31 AM

could i get more values like
x = 100000; y = 1000; f(x,y) = ?;
and
x = 400000; y = 1000; f(x,y) = ?;
• 0

### #4 mireazma

mireazma

GMC Member

• GMC Member
• 282 posts

Posted 30 December 2011 - 09:02 AM

From the last 2 pairs in op I realize that a linear equation can be made. I input the values in my graph calculator and came up with
f(x) = -2.5128205E-06*x+1.5125641
it follows that
x = 100000; y = 1000; f(x,y) = 1.2613;
x = 400000; y = 1000; f(x,y) = 0.5074;
I can't relate it though to the first pair. I think I could do the same by eliminating y (being constant) and I'd end up with f(x) = 1
But how can I relate the 2 pairs?
• 0

### #5 chance

chance

GMC Member

• Reviewer
• 5761 posts
• Version:GM:Studio

Posted 30 December 2011 - 01:48 PM

Are you trying to find 2D curves, such as y = f(x), that pass through these particular (x,y) pairs?

Or are you trying to find 3D surfaces that contain the triplet x, y, f(x,y) ?

You can do either one.... even though there are an infinite number of possible curves and surfaces.
• 0

### #6 Tepi

Tepi

GMC Member

• Global Moderators
• 4201 posts
• Version:GM8.1

Posted 30 December 2011 - 02:05 PM

Looks like the 3D case.

The points (x,y,f(x,y)) aren't on the same plane, so f(x,y) can't be linear for x and y. There are infinite possible functions that work for this group of points, though. I can't see why in the world you'd want to find just any of these functions, but maybe that's just me.

One such function would be:
f(x,y) = 1, when x = 5000 and y = 0;
f(x,y) = 1, when x = 200000 and y = 0;
f(x,y) = 1.5, when x = 5000 and y = 1000;
f(x,y) = 1.01, when x = 200000 and y = 1000;
f(x,y) = 0, otherwise.

Solved?

EDIT: Ok, maybe I refrain from being quite the jerk I am, and give you all the linear piecewise solutions where three of the points at a time satisfy the either piece (let the points be (x1,y1), (x2,y2), (x3,y3) and (x4,y4)):
f(x,y) = z1 - ( ( (y2-y1)*(f(x3,y3) - f(x1,y1)) - (y3-y1)*(f(x2,y2) - f(x1,y1)) )*(x-x1) + ( (x3-x1)*(f(x2,y2) - f(x1,y1)) - (x2-x1)*(f(x3,y3) - f(x1,y1)) )*(y-y1) )/( (x2-x1)*(y3-y1) - (x3-x1)*(y2-y1) ), when sgn((x-x2)*(y3-y2) - (x3-x2)*(y-y2)) == sgn((x1-x2)*(y3-y2) - (x3-x2)*(y1-y2));
f(x,y) = z4 - ( ( (y2-y4)*(f(x3,y3) - f(x4,y4)) - (y3-y4)*(f(x2,y2) - f(x4,y4)) )*(x-x4) + ( (x3-x4)*(f(x2,y2) - f(x4,y4)) - (x2-x4)*(f(x3,y3) - f(x4,y4)) )*(y-y4) )/( (x2-x4)*(y3-y4) - (x3-x4)*(y2-y4) ), otherwise.

Edited by Tepi, 30 December 2011 - 02:26 PM.

• 0

### #7 mireazma

mireazma

GMC Member

• GMC Member
• 282 posts

Posted 30 December 2011 - 08:21 PM

Thank you all.
ookami125: I know a mate to be appreciated when I see one but it holds for the rest as well.
chance and Tepi: I know I'll sound like a total amateur, especially to Tepi but this is at most my math level.
Ok. After drawing a graph or two, I realized what resembles a 3D surface. In fact what I really want is a code that "modulates" a value with respect to other 2 values or better put, accepts 2 parameters and returns a third value. It's like mixing inputs from 2 knobs for one control. Here is a model of such a function:

So, f(x) = z and f(y) = z are both linear; so a cross-section of the surface delimited by the green lines on any axis, is a line. Apart from this, to me it doesn't appear to be the result of infinite equations but of one. There has to be something simpler than what you wrote, Tepi. Anyway that looks like a recursive function and you put it there just for proof.
My mind can't think of complex things and I'm counting on this too that the equation is simple and intuitive. It's right there but can't put my finger on it.
• 0

### #8 Tepi

Tepi

GMC Member

• Global Moderators
• 4201 posts
• Version:GM8.1

Posted 30 December 2011 - 09:31 PM

What I posted was just a function of form:
f(x,y) = a1*x + b1*y + c1, <in some region>
f(x,y) = a2*x + b2*y + c2, otherwise

Looking for something else? I think you could make up a function of form f(x,y) = a*(x - *(y - c) + d;
Mathematica gives {a = -2.51282*10^-9, b = 203980, c = 0, d = 1}.

This is a hyperbolic paraboloid, quite simple and intuitive I think.

Edited by Tepi, 30 December 2011 - 09:53 PM.

• 0

### #9 mireazma

mireazma

GMC Member

• GMC Member
• 282 posts

Posted 03 January 2012 - 10:44 AM

Thank you very much.
I'll take a look into Mathematica (hope it has a trial version). I noticed Graph 4.3 which I'm using, gives erroneous functions for the trendline of a set of points (sometimes) and it doesn't have 3D. Anyway, not comparable, of course.

If a concept so simple and intuitive has the form of that equation, then math is simpler than it looks
• 0

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users