问题
Given is the equation:
Y^2 = X^3 + 2*X - 3*X*Y
Assuming the plotted sketch is correct.
Y^2 = X^3 + 2*X - 3*X*Y
Hint:
Y^2 + X^2 =1 ==> Y= sqrt( 1 - X^2 )
The X values are known.
How can I find the corresponding Y values for X values?
E.g. for known X-Values, I expect something like below listed Y-Values (see the plotted sketch):
X= 1 ; Y=0.79
X=2 ; Y=1.58
X=3 ; Y=2.79
X=4 ; Y=4.39
X=5 ; Y=6.33
X=6 ; Y=8.57
X=7 ; Y=11.12
X=8 ; Y=13.92
X=9 ; Y=16.98
X=10 ; Y= 20.29
E.g. I will try to find Y for X=6; then Y will be calculated as follws:
Y^2+X^2=1 ==> Y=sqrt(1 - X^2) = sqrt(1-36) = sqrt(-35) = (0, 5.92i );
Thus:
Y^2 = X^3 + 2*X - 3*X*Y = (228 , -106,49i)
Y = sqrt( 228 , -106,49i) = (15.49 , -3.44i)
Sadly, the calculated Y is wrong! I expect something like (6, 8.57i).
But how can I find Y?
Thanks in advance.
回答1:
just solve it by 'y'. It's not that difficoult, when you treat x like constant value:
y^2 = x^3 + 2x - 3xy
0 = (-1)y^2 + (-3x)y + (x^3 + 2x)
it's Quadratic equation of:
a = -1
b = -3x
c = x^3 + 2x
y1 = (-(-3x) - sqr((-3x)^2 - 4(-1)(x^3+2x)))/2*(-1)
y2 = (-(-3x) + sqr((-3x)^2 - 4(-1)(x^3+2x)))/2*(-1)
finally:
d = x(9*x+4*x^2+8)
y1 = (3x+sqr(d))/(-2)
y2 = (3x-sqr(d))/(-2)
eg.
for x = 6
y1 = -26,5784
y2 = 8,578396
as you may see from the chart there are always two y matched to one x. I think that is clear enaugh :)
回答2:
Have you used a math library with support for complex numbers ? MathJs is one. See this SO answer.
来源:https://stackoverflow.com/questions/43072126/how-to-find-y-for-corresponding-x-values-implicit-function-complex-number