Intersection of two variable functions

2 visualizzazioni (ultimi 30 giorni)
Ts.Gams
Ts.Gams il 29 Lug 2016
Risposto: Walter Roberson il 29 Lug 2016
Hello, I need to find intersection of two variable functions that are real and imaginary parts of complex function.
%%close all;clear; clc
x1=sym('x1','real');
x2=sym('x2','real');
x=x1+1i*x2;
R=8;
S=1+1i;
Ck=0;
for k=20:-1:0
Ak=(k+1)*(k+1);
Bk=-k*(k+1)+1i*2*k*R;
Sk=Bk-(x)-(Ak*Ck)/S;
S=Sk;
Ck=-2*R-1i*2*R*k;
end
Sk(x1,x2)=Sk;
f1=real(Sk);
f2=imag(Sk);
ezplot(f1);
hold on;
ezplot(f2);
grid on;
I want to get this point coordinates if you can help me. Thanks.

Risposte (1)

Walter Roberson
Walter Roberson il 29 Lug 2016
You have function in two variables and you are asking to solve for all of the point coordinates. You are assuming that there are only a finite number of intersections. It appears to me that is not the case, that there are an infinite number. (My experiments agree with that.)
T = simplify(f1-f2);
to get the expression that must hold (be equal to 0) for the real and imaginary parts to equal. This will be an expression in two variables. You can solve() for either one of the variables, and you will find that the result is a polynomial of degree 39 that has as coefficients a mix of constants together with the other variable up to degree 39. Mostly T is like a tilted plane, so there should be a line of solutions. But in addition if you plot at a fine enough resolution in the range x1 = -40 to 30, x2 = -10 to 80 (approximately) then you will see that there are some sharp peaks in T -- and some of those sharp peaks pass from below 0 to above 0, leading to small circle-like areas where the peaks pass through 0, and each of those closed loops consists of an infinite number of points.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by