Complex implicit function 2D plot
조회 수: 3 (최근 30일)
이전 댓글 표시
I am trying to plot a implicit function of the form
H2 = 100;
n2 = 2.0;
n1 = 1.47;
rho = 0;
m = 1;
fun = @(x,y) sqrt((2.*pi/x)^2.*n2^2-y^2).*H2-2.*atan( ((n2/n1)^(2.*rho)).*sqrt((y^2-n1^2.*(2.*pi/x)^2)/(n2^2.*(2.*pi/x)^2-y^2)) )-m.*pi;
I already tried
ezplot(fun, [300, 700, 0, 1]);
But it shows no plot and there is a warning
Warning: Function failed to evaluate on array inputs; vectorizing the function may speed up its
evaluation and avoid the need to loop over array elements.
Any help?
Thanks
댓글 수: 8
Walter Roberson
2020년 3월 29일
fun = @(x,y) sqrt((2.*pi./x).^2.*n2.^2-y.^2).*H2-2.*atan( ((n2./n1).^(2.*rho)).*sqrt((y.^2-n1.^2.*(2.*pi./x).^2)./(n2.^2.*(2.*pi./x).^2-y.^2)) )-m.*pi;
fsurf(fun,[300,700,0,0.045]);
The surface is mostly complex-valued. The imaginary portion is 0 for some Y values between about 0.0132 and 0.045. If you do not constrain the plot, you will see almost nothing.
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!