How can I find intersections of curves?

1 view (last 30 days)
Rengin
Rengin on 12 Jun 2015
Answered: Star Strider on 12 Jun 2015
clear all
clc
Reactive_QCP1=[6.708;6.396;6.0911;5.791;5.498;5.210;4.926;4.647;4.371];
Reactive_QCP2= [17.053;13.255;9.590;6.0533;2.632;-0.683;-3.903;-7.034;-10.083];
ReactiveChange=(-40:10:40)';
Graph_1=plot(Reactive_QCP1(:,1),ReactiveChange(:,1),'b');
grid on
hold on
Graph_2=plot(Reactive_QCP2(:,1),ReactiveChange(:,1),'r');
xlabel('Reactive Power Change of WF [p.u]');
ylabel('QCPs [Mvar]');
Graph_3=line([-15 20],[0 0],'color','k');
hleg2=legend('QCP1','QCP2','Location','NorthEastOutside');
% I want to see the coordinates where Graph_1 and Graph_3 intersect.
% How can I do that? Thanks a lot

Answers (1)

Star Strider
Star Strider on 12 Jun 2015
Since ‘Graph3’ is the x-axis where y = 0, you can use interp1 to find the intersection of Graph1:
G1G3Intx = interp1(ReactiveChange, Reactive_QCP1(:,1), 0);
This will give you the value of ‘Reactive_QCP1’ where ‘ReactiveChange’ is zero. Is that what you want?

Community Treasure Hunt

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

Start Hunting!