How to plot complicated implicit function?

6 views (last 30 days)
Rozana Alam on 10 May 2020
Answered: Mathieu NOE on 19 May 2021
PLmax = A /1+aexp(−b[arctan(h /R)−a) + 10log(h2 + R2)+B
Where, PLmax=10 dB
a=12.0810;
b=0.1139;
B=194.2648
A =-21.4000
h,R are implicit .
@MAILAB fimplicit The graph should be like this,but with my code am not getting any output.can anyone modify it?
clc;
clear;
f1=2000E+06;
c=3*10^8;
itaNLOS=23dB;
itaLOS=1.6dB;
y=(4*pi)/c;
z=log10(f1);
B1=(20*z)+(2*log10(y))+23
A=itaLOS-itaNLOS
a=12.0810;
b=0.1139;
P=10dB;
f=@(h,R) (A/1+a*exp((-b)*((atan(h./R))-a)))+10*log10(h.^2+R.^2)+B1
fimplicit(f,[500:500:4500 500:500:4500])
vidawung on 19 May 2021
Have you solve the problem? I meet the same question as yours.

Mathieu NOE on 19 May 2021
hello
I tried a few things to understand where the problem lies. I have to say I am not an expert in this field and I will not find out if thre is a better equation but at least I found a few minor bugs here and there, and made at least the implicit function works but not with the expected P target value , neither with the expected shape . So I wonder if there is still a problem either due to the constants or how we implemented the equations (I did a few variations around the "official" one , but no one gave a satisfatory behaviour)
so to know what typical P value the equation would return for a given h,R pair, I did first a contour plot by generationg a meshgrid for h and R.
you can see that P lies in the range 100 to 130 dB , to this explains why implicit would not any solution if the P target = 10 dB, way out what is to be expected - so again, if P should be 10 dB, then we have a problem either with the constants and / or how we wrote that equation; also P was missing in the function evaluation with implicit
clc;
clearvars;
f1=2000E+06;
c=3*10^8;
itaNLOS=23; % dB;
itaLOS=1.6; % dB;
B1=20*log10(f1)+20*log10(4*pi/c)+itaNLOS;
A=itaLOS-itaNLOS;
a=12.0810;
b=0.1139;
P=10; % dB;
%% first plot using meshgrid
x = 50:50:4500;
y = 50:50:4500;
[h,R] = meshgrid(x,y);
f = A./(1+a*exp(-b*(atan(h./R)-a)))+10*log10(h.^2+R.^2)+B1;
figure(1),contour(x,y,f,10);colorbar('vert');
colormap(jet)
set(gca,'YDir','normal')
% return
%%%%%%%%%
% P=10; % dB;
P=125; % dB;
f=@(h,R) A./(1+a*exp(-b*(atan(h./R)-a)))+10*log10(h.^2+R.^2)+B1 - P
fimplicit(f,[500 4500 500 4500])