Asked by Okita Sugoo
on 2 May 2019

Hello,

I have 3 vectors : Vph, If & Isc

I plot Vph versus If (O.C.C) and Isc versus If (S.C.C)

after plotting the two curves i need to draw a horizontal line from a value of Isc vector(Ifl) until it touches the S.C.C curve at Point C and draw a vertical line from that point that touch the O.C.C curve at point B and find the value of Vph at this point(Point B)

i this possible in matlab ?

so far i was managed to draw the horizontal line but i'm unable to get the point where it touches the S.C.C curve.

any guidance would be appreciated.

Worked Exampe:

Ifl=288

Vph=[450;900;1150;1320]

If=[10;20;30;40]

Isc=[---;220;335;---]

*the dashed lines meanes that theres no registered value of Isc to the corresponding value of If.

Point C=(26.5,288)

Vph at Pt B =1060

Answer by dpb
on 3 May 2019

Edited by dpb
on 3 May 2019

Actually, after looking at the drawings some more, I realize you did supply enough originally to make an initial pass at it...

Ifl=288;

Vph=[450;900;1150;1320];

If=[10;20;30;40];

Isc=[nan;220;335;nan]; % for missing data --> NaN

%Point C=(26.5,288)

plot(If,Vph)

hold on,plot(If,Isc)

xlim([0 50]), ylim([0 1500])

% results in sorta' like the drawing plot...looks better if

IfInterp=linspace(If(1),If(end),50); % more points to smooth curve

VphInterp=interp1(If,Vph,IfInterp,'pchip'); % use shape-keeping cubic piecewise poly

plot(IfInterp,VphInterp,'k-') % and show what that looks like...

C=interp1(Isc(2:3),If(2:3),Ifl) % find intersection @ Ifl

C =

25.9130

% result doesn't quite match your value...neighborhood but not actual intersection

% now look for intersection of Vph at C...

>> interp1(If,Vph,C) % linear interpolation

ans =

1.0478e+03

>> format bank

>> ans

ans =

1047.83

>> interp1(If,Vph,C,'pchip') % use the pchip interpolation

ans =

1061.38

>>

The last value is quite close to your estimate...

All you need to do is wrap the above in a function; drawing the horizontal and vertical lines on the plot shouldn't be difficult...as long as you stay within the relatively narrow limits of the SCC curve, it's simply a two-step interpolation process as outlined above.

Sign in to comment.

Opportunities for recent engineering grads.

Apply Today
## 4 Comments

## dpb (view profile)

## Direct link to this comment

https://kr.mathworks.com/matlabcentral/answers/459944-multiple-curve-intersection-plot#comment_701086

## Okita Sugoo (view profile)

## Direct link to this comment

https://kr.mathworks.com/matlabcentral/answers/459944-multiple-curve-intersection-plot#comment_701090

## Okita Sugoo (view profile)

## Direct link to this comment

https://kr.mathworks.com/matlabcentral/answers/459944-multiple-curve-intersection-plot#comment_701091

## dpb (view profile)

## Direct link to this comment

https://kr.mathworks.com/matlabcentral/answers/459944-multiple-curve-intersection-plot#comment_701101

Sign in to comment.