% Developed by: Mehrnoush Masihpour 30.12.2009 % Appendix is co-authored by Agbinya JI % This code copyrighted and is supplied as is and must be referenced % in all works where it is used % It is part of the book: Principles of Inductive Communications for % Internet of Things (Agbinya JI) % By installing or using it on your computers, you take full % responsibility for any adverse effects it may or may not have on % your computers % Development of this code is permitted provide all enhancements are reported to the authors % j.agbinya@latrobe.edu.au and masihpour.mehrnoush@gmail.com % Magnetic Communication Link Budget _ GUI(home page) %File name: chainGUI.m %sub-programs: air.m; twograph.m; minoo.m; minooGUI.m; NFMIC.m; NFMICGUI.m clc clear all close all % Fiure to create the user interface figure1 = figure('Color',[0.2 0.2 0.4],'Name',... ' Near Field Magnetic Induction Communication_(C)Copyright Reserved (Univercity of Technology,Sydney,Australia)__Mehrnoush Masihpour',... 'NumberTitle','off','Position',[25 50 900 650]); % Image image1= subplot('Position',[0.0 0.06 0.56 0.56]); image(imread('chain','jpg')); %axis square; axis off; Text_11=uicontrol(gcf,'Style','text','Position',[505 580 395 70],... 'String','GUIDE','FontSize',24,... 'HorizontalAlignment','center','BackgroundColor',[0.99 0.89 0.2]); Text_22=uicontrol(gcf,'Style','text','Position',[505 490 395 90],... 'String',' *** To see the distance graph vs. different parameters for a set of predefined values and compare the trend for a ferrite and air-cored coil, please press the first push button ','FontSize',10,... 'HorizontalAlignment','left','BackgroundColor',[0.99 0.89 0.2]); Text_33=uicontrol(gcf,'Style','text','Position',[505 410 395 90],... 'String','*** To see the distance graph vs. different parameters and calculate the range for your desirable set of input values please press the second push button','FontSize',10,... 'HorizontalAlignment','left','BackgroundColor',[0.99 0.89 0.2]); Text_44=uicontrol(gcf,'Style','text','Position',[505 330 395 90],... 'String','***To calculate the received power and see the graph of the received power vs. different coil characteristics for your desirable set of values, please press the third push button '... ,'FontSize',10,... 'HorizontalAlignment','left','BackgroundColor',[0.99 0.89 0.2]); Text_55=uicontrol(gcf,'Style','text','Position',[505 260 395 90],... 'String','','FontSize',10,... 'HorizontalAlignment','left','BackgroundColor',[0.99 0.89 0.2]); Text_66=uicontrol(gcf,'Style','text','Position',[505 190 395 90],... 'String','','FontSize',10,... 'HorizontalAlignment','left','BackgroundColor',[0.99 0.89 0.2]); Text_77=uicontrol(gcf,'Style','text','Position',[505 120 395 90],... 'String','','FontSize',10,... 'HorizontalAlignment','left','BackgroundColor',[0.99 0.89 0.2]); Text_88=uicontrol(gcf,'Style','text','Position',[505 30 395 90],... 'String','','FontSize',10,... 'HorizontalAlignment','left','BackgroundColor',[0.99 0.89 0.2]); Text_99=uicontrol(gcf,'Style','text','Position',[505 0 395 30],... 'String','***Developed by:Mehrnoush Masihpour *********************Jan-2010','FontSize',9,... 'HorizontalAlignment','left','BackgroundColor',[0.99 0.89 0.2]); %**************************************************************** hb1 = uicontrol('Style','pushbutton','position',[5 550 500 30], 'FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','BackgroundColor',[1 0.7 0.7],... 'String','Comparison between antennas using air-core and ferrite-cored coil'); set(hb1,'Callback','twogragh') hb2 = uicontrol('Style','pushbutton','position',[5 500 500 30], 'FontName','Arial',... 'FontSize',12,'FontWeight','normal','BackgroundColor',[1 0.7 0.7],'HorizontalAlignment','left',... 'String','Set the input to calculate the range and see the graphs'); set(hb2,'Callback','minoogui') hb3 = uicontrol('Style','pushbutton','position',[5 450 500 30], 'FontName','Arial',... 'FontSize',12,'FontWeight','normal','BackgroundColor',[1 0.7 0.7],'HorizontalAlignment','left',... 'String','Set the inputs to calculate the power at the receiver and see the graph'); set(hb3,'Callback','NFMICgui') Text_0=uicontrol(gcf,'Style','text','Position',[60 600 380 30],... 'String','Please Choose one of the Functions','fontSize',14,... 'HorizontalAlignment','center','BackgroundColor',[0.8 0.8 1]); %CLOSE BUTTON p1 = uicontrol(gcf,'Style','pushbutton','Position',[10 10 70 25],... 'String','Close','BackgroundColor',[1 0.4 0.5],'FontName','Arial',... 'FontSize',14,'FontWeight','normal',... 'HorizontalAlignment','center','CallBack','close'); p2 = uicontrol('Style','pushbutton','position',[420 10 70 25], 'FontName','Arial',... 'FontSize',14,'FontWeight','normal','BackgroundColor',[1 0.4 0.5],'HorizontalAlignment','center',... 'String','Reset'); set(p2,'Callback','chaingui') %*************************************************************** %*************************************************************** % THE END %*************************************************************** %*************************************************************** %developed by: Mehrnoush Masihpour 14.12.2009 %Magnetic Communication Link Budget %file name: Twograph.m %sub-programs: air.m clear all clc close all %creating the main window %**************************************** f1 = figure('Color',[0.6 0.8 0.9],'Name',... ' Magnetic Communication Link Budget_(C)Copyrigh Reserved(University of Technology, Sydney, Australia)__Mehrnoush Masihpour ',... 'NumberTitle','off','Position',[30 40 900 650]); %******************************************** Text_1=uicontrol(gcf,'Style','text','Position',[200 625 500 25],... 'String',' Magnetic Communication Link Budget',... 'FontSize',14,'HorizontalAlignment',... 'center','BackgroundColor',[.9 .5 .8]) ; Text_2=uicontrol(gcf,'Style','text','Position',[300 575 300 25],... 'String',' AIR CORE[relative permeability=1]',... 'FontSize',12,'HorizontalAlignment',... 'center','BackgroundColor',[.6 .8 .95]) ; Text_3=uicontrol(gcf,'Style','text','Position',[300 260 300 25],... 'String',' FERRITE CORE[relative perm.=10000]',... 'FontSize',12,'HorizontalAlignment',... 'center','BackgroundColor',[.6 .8 .95]) ; Text_4=uicontrol(gcf,'Style','text','Position',[25 575 200 25],... 'String',' Constant Inputs',... 'FontSize',12,'HorizontalAlignment',... 'center','BackgroundColor',[.9 .5 .8]) ; % line*********************************************************** line1=uicontrol(gcf,'Style','text','Position',[270 25 3 540],... 'String',' ','BackgroundColor',[0.2 1 1]); %****************************************************************** Text_TxP=uicontrol(gcf,'Style','text','Position',[10 520 200 20],... 'String',' TX_Power [dBm] ','FontSize',13,... 'HorizontalAlignment','left','BackgroundColor',[1 1 1]); Text_Txpv=uicontrol(gcf,'Style','text','Position',[215 520 50 20],... 'String','23','FontSize',13,... 'HorizontalAlignment','left','BackgroundColor',[1 1 1]); Text_RxP=uicontrol(gcf,'Style','text','Position',[10 495 200 20],... 'String',' RX_Power [dBm] ','FontSize',13,... 'HorizontalAlignment','left','BackgroundColor',[1 1 1]); Text_RxPv=uicontrol(gcf,'Style','text','Position',[215 495 50 20],... 'String','0','FontSize',13,... 'HorizontalAlignment','left','BackgroundColor',[1 1 1]); Text_TxQ=uicontrol(gcf,'Style','text','Position',[10 470 200 20],... 'String',' TX_Quality Factor ','FontSize',13,... 'HorizontalAlignment','left','BackgroundColor',[1 1 1]); Text_TxQv=uicontrol(gcf,'Style','text','Position',[215 470 50 20],... 'String','1000','FontSize',13,... 'HorizontalAlignment','left','BackgroundColor',[1 1 1]); Text_RxQ=uicontrol(gcf,'Style','text','Position',[10 445 200 20],... 'String',' RX_Quality Factor ','FontSize',13,... 'HorizontalAlignment','left','BackgroundColor',[1 1 1]); Text_RxQv=uicontrol(gcf,'Style','text','Position',[215 445 50 20],... 'String','1000','FontSize',13,... 'HorizontalAlignment','left','BackgroundColor',[1 1 1]); Text_TxE=uicontrol(gcf,'Style','text','Position',[10 420 200 20],... 'String',' TX_Efficiency','FontSize',13,... 'HorizontalAlignment','left','BackgroundColor',[1 1 1]); Text_TxEv=uicontrol(gcf,'Style','text','Position',[215 420 50 20],... 'String','0.98','FontSize',13,... 'HorizontalAlignment','left','BackgroundColor',[1 1 1]); Text_RxE=uicontrol(gcf,'Style','text','Position',[10 395 200 20],... 'String',' RX_Efficiency','FontSize',13,... 'HorizontalAlignment','left','BackgroundColor',[1 1 1]); Text_RxEv=uicontrol(gcf,'Style','text','Position',[215 395 50 20],... 'String','0.98','FontSize',13,... 'HorizontalAlignment','left','BackgroundColor',[1 1 1]); Text_Txmu=uicontrol(gcf,'Style','text','Position',[10 370 200 20],... 'String',' TX_permeability','FontSize',13,... 'HorizontalAlignment','left','BackgroundColor',[1 1 1]); Text_Txmuv=uicontrol(gcf,'Style','text','Position',[215 370 50 20],... 'String','10000','FontSize',13,... 'HorizontalAlignment','left','BackgroundColor',[1 1 1]); Text_Rxmu=uicontrol(gcf,'Style','text','Position',[10 345 200 20],... 'String',' RX_permeability','FontSize',13,... 'HorizontalAlignment','left','BackgroundColor',[1 1 1]); Text_Rxmuv=uicontrol(gcf,'Style','text','Position',[215 345 50 20],... 'String','10000','FontSize',13,... 'HorizontalAlignment','left','BackgroundColor',[1 1 1]); Text_TXr=uicontrol(gcf,'Style','text','Position',[10 320 200 20],... 'String',' TX_Radius[cm] ','FontSize',13,... 'HorizontalAlignment','left','BackgroundColor',[1 1 1]); Text_TXrv=uicontrol(gcf,'Style','text','Position',[215 320 50 20],... 'String','2.5','FontSize',13,... 'HorizontalAlignment','left','BackgroundColor',[1 1 1]); Text_RXr=uicontrol(gcf,'Style','text','Position',[10 295 200 20],... 'String','RX_Radius[cm] ','FontSize',13,... 'HorizontalAlignment','left','BackgroundColor',[1 1 1]); Text_RXrv=uicontrol(gcf,'Style','text','Position',[215 295 50 20],... 'String','1.5','FontSize',13,... 'HorizontalAlignment','left','BackgroundColor',[1 1 1]); %********************ferrite subplot('Position',[0.38 0.06 0.6 0.33]); axis on; sr=1; % (Fig. type) pPopupmenuf=uicontrol(gcf,'Style','popupmenu','Position',[600 260 300 25],... 'String',{'distance vs radius of transmitter (ferrite core)','distance vs radius of receiver (ferrite core)',... 'distance vs transmission power (ferrite core)','distance vs receiver power(ferrite core)',... 'distance vs efficiency of transmitter and receiver (ferrite core)',... 'distance vs efficiency of receiver (ferrite core)','distance vs efficiency of transmitter (ferrite core)',... 'distance vs quality factor of transmitter and receiver (ferrite core)',... 'distance vs quality factor of transmitter (ferrite core)',... 'distance vs quality factor of receiver (ferrite core)',... 'distance vs permeability of transmitter and receiver (ferrite core)',... 'distance vs permeability of transmitter (ferrite core)',... 'distance vs permeability of receiver (ferrite core)'}...... ,'value',sr,... 'BackgroundColor',[1 1 1],'ForeGroundColor',[0 0 0],... 'FontSize',12,'FontWeight','normal',... 'HorizontalAlignment','center','FontName','Arial',... 'CallBack','sr=get(pPopupmenuf,''value'');f=2; air'); %********air subplot('Position',[0.38 0.49 0.6 0.37]); axis on; st=1; % (Fig. type) pPopupmenu=uicontrol(gcf,'Style','popupmenu','Position',[600 575 300 25],... 'String',{'distance vs radius of transmitter (air core)','distance vs radius of receiver (air core)',... 'distance vs transmission power (air core)','distance vs receiver power(air core)',... 'distance vs efficiency of transmitter and receiver (air core)',... 'distance vs efficiency of receiver (air core)','distance vs efficiency of transmitter (air core)',... 'distance vs quality factor of transmitter and receiver (air core)',... 'distance vs quality factor of transmitter (air core)',... 'distance vs quality factor of receiver (air core)'}... ,'value',st,... 'BackgroundColor',[1 1 1],'ForeGroundColor',[0 0 0],... 'FontSize',12,'FontWeight','normal',... 'HorizontalAlignment','center','FontName','Arial',... 'CallBack','st=get(pPopupmenu,''value''); f=1; air'); %close************************ pushbutton_close= uicontrol(gcf,'Style','pushbutton','Position',... [80 25 100 30],'FontSize',12,'FontWeight','Bold','String',... 'Close','CallBack','close'); hb000 = uicontrol('Style','pushbutton','position',[80 115 100 30], 'FontName','Arial',... 'FontSize',14,'FontWeight','normal','HorizontalAlignment','left',... 'String','Back'); set(hb000,'Callback','chaingui') %*************************************************************** %*************************************************************** % THE END %*************************************************************** %*************************************************************** %developed by: Mehrnoush Masihpour 27.12.2009 %Magnetic Communication Link Budget _ GUI_ gets the value of each parameter %and return the value of distance also the graphs of distance vs. different %variable %file name: minooGUI.m % sub_program: minoo.m clc clear all close all % ************************************************************************* % Figure for GUI figure1 = figure('Color',[0.6 0.5 0.9],'Name',... ' Magnetic Induction Communication Link Budget_(C)Copyright Reserved(University of Technology,Sydney, Australia)__Mehrnoush Masihpour ',... 'NumberTitle','off','Position',[25 50 900 650]); % input initial data***************************************************** RXQ=1000 TXQ=1000 RXmu=0.012 TXmu=0.012 RXp=0 TXp=23 RXr=1.5 TXr=2.5 TXeff=0.9 RXeff=0.9 mu0=log10(4.*pi.* 10.^-7); TXmu1=log10(TXmu) RXmu1=log10(RXmu) % text box and variable box for each parameter **************************** Text_1=uicontrol(gcf,'Style','text','Position',[25 570 150 20],... 'String',' TX_radius [cm] ','FontSize',12,... 'HorizontalAlignment','left','BackgroundColor',[.9 0.9 1]); Edit_1=uicontrol(gcf,'Style','edit','Position',[175 570 60 20],... 'String',TXr,'FontSize',12,'BackgroundColor',[1 1 1],'Callback',... 'TXr=str2num(get(Edit_1,''String''));'); Text_2=uicontrol(gcf,'Style','text','Position',[25 550 150 20],... 'String',' RX_radius [cm] ','FontSize',12,... 'HorizontalAlignment','left','BackgroundColor',[.9 0.9 1]); Edit_2=uicontrol(gcf,'Style','edit','Position',[175 550 60 20],... 'String',RXr,'FontSize',12,'BackgroundColor',[1 1 1],'Callback',... 'RXr=str2num(get(Edit_2,''String''));'); Text_3=uicontrol(gcf,'Style','text','Position',[25 530 150 20],... 'String',' TX_Power [dBm] ','FontSize',12,... 'HorizontalAlignment','left','BackgroundColor',[.9 0.9 1]); Edit_3=uicontrol(gcf,'Style','edit','Position',[175 530 60 20],... 'String',TXp,'FontSize',12,'BackgroundColor',[1 1 1],'Callback',... 'TXp=str2num(get(Edit_3,''String''));'); Text_4=uicontrol(gcf,'Style','text','Position',[25 510 150 20],... 'String',' RX_Sensitivity [dBm] ','FontSize',12,... 'HorizontalAlignment','left','BackgroundColor',[.9 0.9 1]); Edit_4=uicontrol(gcf,'Style','edit','Position',[175 510 60 20],... 'String',RXp,'FontSize',12,'BackgroundColor',[1 1 1],'Callback',... 'RXp=str2num(get(Edit_4,''String''));'); Text_5=uicontrol(gcf,'Style','text','Position',[25 490 150 20],... 'String',' TX_QuaityFactor','FontSize',12,... 'HorizontalAlignment','left','BackgroundColor',[.9 0.9 1]); Edit_5=uicontrol(gcf,'Style','edit','Position',[175 490 60 20],... 'String',TXQ,'FontSize',12,'BackgroundColor',[1 1 1],'Callback',... 'TXQ=str2num(get(Edit_5,''String''));'); Text_6=uicontrol(gcf,'Style','text','Position',[25 470 150 20],... 'String','RX_QuaityFactor','FontSize',12,... 'HorizontalAlignment','left','BackgroundColor',[.9 0.9 1]); Edit_6=uicontrol(gcf,'Style','edit','Position',[175 470 60 20],... 'String',RXQ,'FontSize',12,'BackgroundColor',[1 1 1],'Callback',... 'RXQ=str2num(get(Edit_6,''String''));'); Text_7=uicontrol(gcf,'Style','text','Position',[25 450 150 20],... 'String','TX_permeability','FontSize',12,... 'HorizontalAlignment','left','BackgroundColor',[.9 0.9 1]); Edit_7=uicontrol(gcf,'Style','edit','Position',[175 450 60 20],... 'String',TXmu,'FontSize',12,'BackgroundColor',[1 1 1],'Callback',... 'TXmu=str2num(get(Edit_7,''String''));'); Text_8=uicontrol(gcf,'Style','text','Position',[25 430 150 20],... 'String','RX_permeability ','FontSize',12,... 'HorizontalAlignment','left','BackgroundColor',[.9 0.9 1]); Edit_8=uicontrol(gcf,'Style','edit','Position',[175 430 60 20],... 'String',RXmu,'FontSize',12,'BackgroundColor',[1 1 1],'Callback',... 'RXmu=str2num(get(Edit_8,''String''));'); Text_9=uicontrol(gcf,'Style','text','Position',[25 410 150 20],... 'String','TX_Efficiency','FontSize',12,... 'HorizontalAlignment','left','BackgroundColor',[.9 0.9 1]); Edit_9=uicontrol(gcf,'Style','edit','Position',[175 410 60 20],... 'String',TXeff,'FontSize',12,'BackgroundColor',[1 1 1],'Callback',... 'TXeff=str2num(get(Edit_9,''String''));'); Text_10=uicontrol(gcf,'Style','text','Position',[25 390 150 20],... 'String','RX_Efficiency','FontSize',12,... 'HorizontalAlignment','left','BackgroundColor',[.9 0.9 1]); Edit_10=uicontrol(gcf,'Style','edit','Position',[175 390 60 20],... 'String',RXeff,'FontSize',12,'BackgroundColor',[1 1 1],'Callback',... 'RXeff=str2num(get(Edit_10,''String''));minoo'); %RADIO BUTTON_showing the graphs for air and ferrite core coils **************************** option=1; radiobutton1 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[10 350 230 20],... 'Min',0,'Max',1,'BackgroundColor',[1 1 0.4],... 'String','Distance vs TX_radius','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=1; minoo'); radiobutton2 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[10 325 230 20],... 'Min',0,'Max',1,'BackgroundColor',[1 1 0.4],... 'String','Distance vs RX_radius','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=2; minoo'); radiobutton3 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[10 300 230 20],... 'Min',0,'Max',1,'BackgroundColor',[1 1 0.4],... 'String','Distance vs TX_power','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=3; minoo'); radiobutton4 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[10 275 230 20],... 'Min',0,'Max',1,'BackgroundColor',[1 1 0.4],... 'String','Distance vs RX_power','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=4; minoo'); radiobutton5 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[10 250 230 20],... 'Min',0,'Max',1,'BackgroundColor',[1 1 0.4],... 'String','Distance vs TX_QualityFactor','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=5; minoo'); radiobutton6 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[10 225 230 20],... 'Min',0,'Max',1,'BackgroundColor',[1 1 0.4],... 'String','Distance vs RX_QualityFactor','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=6; minoo'); radiobutton7 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[10 200 230 20],... 'Min',0,'Max',1,'BackgroundColor',[1 1 0.4],... 'String','Distance vs TX_permeability','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=7; minoo'); radiobutton8 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[10 175 230 20],... 'Min',0,'Max',1,'BackgroundColor',[1 1 0.4],... 'String','Distance vs RX_permeability','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=8; minoo'); radiobutton9 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[10 150 230 20],... 'Min',0,'Max',1,'BackgroundColor',[1 1 0.4],... 'String','Distance vs TX_efficiency','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=9; minoo'); radiobutton10 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[10 125 230 20],... 'Min',0,'Max',1,'BackgroundColor',[1 1 0.4],... 'String','Distance vs RX_efficiency','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=10; minoo'); radiobutton11 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[1 90 250 20],... 'Min',0,'Max',1,'BackgroundColor',[1 1 0.4],... 'String','Distance vs RX&TX_efficiency','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=11; minoo'); radiobutton12 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[1 65 250 20],... 'Min',0,'Max',1,'BackgroundColor',[1 1 0.4],... 'String','Distance vs RX&TX_permeability','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=12; minoo'); radiobutton13 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[1 40 250 20],... 'Min',0,'Max',1,'BackgroundColor',[1 1 0.4],... 'String','Distance vs RX&TX_QualityFactor','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=13; minoo'); %CREATING THE LINE ******************************************************* line1=uicontrol(gcf,'Style','text','Position',[250 20 3 606],... 'String',' ','BackgroundColor',[1 0 0]); %TEXT BOXES ************************************************************ Text_11=uicontrol(gcf,'Style','text','Position',[10 600 230 25],... 'String','Initial Input Data',... 'FontSize',14,'HorizontalAlignment',... 'center','BackgroundColor',[.9 0.9 1]); Text_22=uicontrol(gcf,'Style','text','Position',[460 610 450 25],... 'String','Air Core Coil',... 'FontSize',14,'HorizontalAlignment',... 'center','BackgroundColor',[1 1 .5]); Text_33=uicontrol(gcf,'Style','text','Position',[460 290 450 25],... 'String','Ferrite Core Coil',... 'FontSize',14,'HorizontalAlignment',... 'center','BackgroundColor',[1 1 .5]); %Axis ****************************************************************** plot1=subplot('Position',[0.35 0.05 0.63 0.35]); axis on; plot2=subplot('Position',[0.35 0.55 0.63 0.35]); axis on; % Push buttons ******************************************************* %CLOSE BUTTON p3 = uicontrol(gcf,'Style','pushbutton','Position',[160 10 70 25],... 'String','Close','BackgroundColor',[.8 1 1],'FontName','Arial',... 'FontSize',14,'FontWeight','normal',... 'HorizontalAlignment','center','CallBack','close'); %CALCULATION BUTTON (AIR) p4 = uicontrol(gcf,'Style','pushbutton','Position',[260 610 200 25],... 'String','Calculate the distance (cm)','FontName','Arial',... 'FontSize',12,'FontWeight','normal',... 'HorizontalAlignment','center','CallBack','x=2; minoo'); %CALCULATION BUTTON (FERRITE) p5 = uicontrol(gcf,'Style','pushbutton','Position',[260 290 200 25],... 'String','Calculate the distance (cm)','FontName','Arial',... 'FontSize',12,'FontWeight','normal',... 'HorizontalAlignment','center','CallBack','x=3; minoo'); hb11 = uicontrol('Style','pushbutton','position',[80 10 70 25], 'FontName','Arial',... 'FontSize',14,'FontWeight','normal','BackgroundColor',[.8 1 1],'HorizontalAlignment','left',... 'String','Back'); set(hb11,'Callback','chaingui') %********************************************************************* %********************************************************************* % THE END %********************************************************************* %********************************************************************* %developed by: Mehrnoush Masihpour 25.12.2009 %Magnetic Communication Link Budget _ GUI_ gets the value of each parameter %and return the value of received power also the graphs of received power vs. %different system parameters %file name: nfmicGUI.m % sub_program: NFMIC.m clc clear all close all % ************************************************************************* % Fiure for GUI figure1 = figure('Color',[0.7 0.9 0.99],'Name',... ' Magnetic Induction Communication Power Equation_(C)Copyright Reserved(University of Technology, Sydney, Australia)__Mehrnoush Masihpour',... 'NumberTitle','off','Position',[25 50 900 650]); % input initial data ***************************************************** txp=23; qr0=1000; qt0=1000; reff0=0.98; teff0=0.98; rmu0=10000; tmu0=10000; tr=2.5; rr=1.5; d=50; mu0=log10(4.*pi.* 10.^-7); qr=log10(qr0); qt=log10(qt0); reff=log10(reff0); teff=log10(teff0); rmu=log10(rmu0)-mu0; tmu=log10(tmu0)-mu0; mu0=log10(4.*pi.* 10.^-7); % text box and variable box for each parameter **************************** Text_1=uicontrol(gcf,'Style','text','Position',[25 570 150 20],... 'String',' TX_radius [cm] ','FontSize',12,... 'HorizontalAlignment','left','BackgroundColor',[.7 0.8 1]); Edit_1=uicontrol(gcf,'Style','edit','Position',[175 570 50 20],... 'String',tr,'FontSize',12,'BackgroundColor',[1 1 1],'Callback',... 'tr=str2num(get(Edit_1,''String''));'); Text_2=uicontrol(gcf,'Style','text','Position',[25 550 150 20],... 'String',' RX_radius [cm] ','FontSize',12,... 'HorizontalAlignment','left','BackgroundColor',[.9 0.9 1]); Edit_2=uicontrol(gcf,'Style','edit','Position',[175 550 50 20],... 'String',rr,'FontSize',12,'BackgroundColor',[1 1 1],'Callback',... 'rr=str2num(get(Edit_2,''String''));'); Text_3=uicontrol(gcf,'Style','text','Position',[25 530 150 20],... 'String',' TX_Power [dBm] ','FontSize',12,... 'HorizontalAlignment','left','BackgroundColor',[.7 0.8 1]); Edit_3=uicontrol(gcf,'Style','edit','Position',[175 530 50 20],... 'String',txp,'FontSize',12,'BackgroundColor',[1 1 1],'Callback',... 'txp=str2num(get(Edit_3,''String''));'); Text_4=uicontrol(gcf,'Style','text','Position',[25 510 150 20],... 'String',' Distance [cm] ','FontSize',12,... 'HorizontalAlignment','left','BackgroundColor',[.9 0.9 1]); Edit_4=uicontrol(gcf,'Style','edit','Position',[175 510 50 20],... 'String',d,'FontSize',12,'BackgroundColor',[1 1 1],'Callback',... 'd=str2num(get(Edit_4,''String''));'); Text_5=uicontrol(gcf,'Style','text','Position',[25 490 150 20],... 'String',' TX_QuaityFactor ','FontSize',12,... 'HorizontalAlignment','left','BackgroundColor',[.7 0.8 1]); Edit_5=uicontrol(gcf,'Style','edit','Position',[175 490 50 20],... 'String',qt0,'FontSize',12,'BackgroundColor',[1 1 1],'Callback',... 'qt0=str2num(get(Edit_5,''String''));'); Text_6=uicontrol(gcf,'Style','text','Position',[25 470 150 20],... 'String','RX_QuaityFactor','FontSize',12,... 'HorizontalAlignment','left','BackgroundColor',[.9 0.9 1]); Edit_6=uicontrol(gcf,'Style','edit','Position',[175 470 50 20],... 'String',qr0,'FontSize',12,'BackgroundColor',[1 1 1],'Callback',... 'qr0=str2num(get(Edit_6,''String''));'); Text_7=uicontrol(gcf,'Style','text','Position',[25 450 150 20],... 'String','TX_permeability','FontSize',12,... 'HorizontalAlignment','left','BackgroundColor',[.7 0.8 1]); Edit_7=uicontrol(gcf,'Style','edit','Position',[175 450 50 20],... 'String',tmu0,'FontSize',12,'BackgroundColor',[1 1 1],'Callback',... 'tmu0=str2num(get(Edit_7,''String''));'); Text_8=uicontrol(gcf,'Style','text','Position',[25 430 150 20],... 'String','RX_permeability','FontSize',12,... 'HorizontalAlignment','left','BackgroundColor',[.9 0.9 1]); Edit_8=uicontrol(gcf,'Style','edit','Position',[175 430 50 20],... 'String',rmu0,'FontSize',12,'BackgroundColor',[1 1 1],'Callback',... 'rmu0=str2num(get(Edit_8,''String''));'); Text_9=uicontrol(gcf,'Style','text','Position',[25 410 150 20],... 'String','TX_Efficiency','FontSize',12,... 'HorizontalAlignment','left','BackgroundColor',[.7 0.8 1]); Edit_9=uicontrol(gcf,'Style','edit','Position',[175 410 50 20],... 'String',teff0,'FontSize',12,'BackgroundColor',[1 1 1],'Callback',... 'teff0=str2num(get(Edit_9,''String''));'); Text_10=uicontrol(gcf,'Style','text','Position',[25 390 150 20],... 'String','RX_Efficiency','FontSize',12,... 'HorizontalAlignment','left','BackgroundColor',[.9 0.9 1]); Edit_10=uicontrol(gcf,'Style','edit','Position',[175 390 50 20],... 'String',reff0,'FontSize',12,'BackgroundColor',[1 1 1],'Callback',... 'reff0=str2num(get(Edit_10,''String''));'); %RADIO BUTTON_ showing the graphs for air and ferrite core coils **************************** Option=1; radiobutton1 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[10 350 230 20],... 'Min',0,'Max',1,'BackgroundColor',[1 .7 0.8],... 'String','RX_power vs RX_radius','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=1; NFMIC'); radiobutton2 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[10 325 230 20],... 'Min',0,'Max',1,'BackgroundColor',[1 .7 0.8],... 'String','RX_power vs TX_radius','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=2; NFMIC'); radiobutton3 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[10 300 230 20],... 'Min',0,'Max',1,'BackgroundColor',[1 .7 0.8],... 'String','RX_power vs TX_power','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=3; NFMIC'); radiobutton4 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[10 275 230 20],... 'Min',0,'Max',1,'BackgroundColor',[1 .7 0.8],... 'String','RX_power vs Distance','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=4; NFMIC'); radiobutton5 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[10 250 230 20],... 'Min',0,'Max',1,'BackgroundColor',[1 .7 0.8],... 'String','RX_power vs TX_Q-Factor','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=5; NFMIC'); radiobutton6 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[10 225 230 20],... 'Min',0,'Max',1,'BackgroundColor',[1 .7 0.8],... 'String','RX_power vs RX_Q-Factor','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=6; NFMIC'); radiobutton7 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[10 200 230 20],... 'Min',0,'Max',1,'BackgroundColor',[1 .7 0.8],... 'String','RX_power vs TX_permeability','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=7; NFMIC'); radiobutton8 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[10 175 230 20],... 'Min',0,'Max',1,'BackgroundColor',[1 .7 0.8],... 'String','RX_power vs RX_permeability','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=8; NFMIC'); radiobutton9 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[10 150 230 20],... 'Min',0,'Max',1,'BackgroundColor',[1 .7 0.8],... 'String','RX_power vs TX_efficiency','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=9; NFMIC'); radiobutton10 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[10 125 230 20],... 'Min',0,'Max',1,'BackgroundColor',[1 .7 0.8],... 'String','RX_power vs RX_efficiency','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=10; NFMIC'); radiobutton11 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[1 90 250 20],... 'Min',0,'Max',1,'BackgroundColor',[1 .7 0.8],... 'String','RX_power vs RX&TX_efficiency','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=11; NFMIC'); radiobutton12 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[1 65 250 20],... 'Min',0,'Max',1,'BackgroundColor',[1 .7 0.8],... 'String','RX_power vs RX&TX_permeability','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=12; NFMIC'); radiobutton13 = uicontrol(gcf,'Style','radiobutton','Value',0,'Position',[1 40 250 20],... 'Min',0,'Max',1,'BackgroundColor',[1 .7 0.8],... 'String','RX_power vs RX&TX_Q-Factor','FontName','Arial',... 'FontSize',12,'FontWeight','normal','HorizontalAlignment','left','CallBack','x=1; Option=13; NFMIC'); %CREATING THE LINE ******************************************************* line1=uicontrol(gcf,'Style','text','Position',[250 20 3 606],... 'String',' ','BackgroundColor',[1 0 0]); %TEXT BOXES ************************************************************ Text_11=uicontrol(gcf,'Style','text','Position',[10 600 230 25],... 'String','Initial Input Data',... 'FontSize',14,'HorizontalAlignment',... 'center','BackgroundColor',[.8 .9 .5]); %Axis ****************************************************************** plot1=subplot('Position',[0.35 0.45 0.63 0.45]); axis on; %************************************************************************** %CLOSE BUTTON p3 = uicontrol(gcf,'Style','pushbutton','Position',[160 10 70 25],... 'String','Close','BackgroundColor',[.8 .9 .5],'FontName','Arial',... 'FontSize',14,'FontWeight','normal',... 'HorizontalAlignment','center','CallBack','close'); %CALCULATION BUTTON (FERRITE) p5 = uicontrol(gcf,'Style','pushbutton','Position',[280 200 600 35],'BackgroundColor',[.8 .9 .5],... 'String','To calculate the power (dBm) at the receiver click here please','FontName','Arial',... 'FontSize',14,'FontWeight','normal',... 'HorizontalAlignment','center','CallBack','x=2; NFMIC'); hb99 = uicontrol('Style','pushbutton','position',[80 10 70 25], 'FontName','Arial',... 'FontSize',14,'FontWeight','normal','BackgroundColor',[.8 .9 .5],'HorizontalAlignment','left',... 'String','Back'); set(hb99,'Callback','chaingui') %********************************************************************* %********************************************************************* % THE END %********************************************************************* %********************************************************************* %developed by: Mehrnoush Masihpour 12.12.2009 %file name: air.m mu0=log10(4.*pi.* 10.^-7); axis on if f==1 subplot('Position',[0.38 0.49 0.6 0.37]); axis on; if st==1 %Distance as a function of transmitter coil radius Ptx=23; % power at the transmitter Prx=0; % power at the receiver qur=1000; qut=1000; Qrx=log10(qut); % Quality factor of the transmitter Qtx=log10(qur); % Quality factor of the receiver eff1=0.98; eff2=0.98; EFICIENCYtx=log10(eff1); %Efficiency of the transmitter EFICIENCYrx=log10(eff2); %Efficiency of the receiver { mu0=log10(4.*pi.* 10.^-7); radius_tx=(0:0.005:8); % radius of the transmitter coil {cm} radius_rx =1.5;% radius of the receiver coil {cm} distance_pr=10.^((Ptx+mu0+mu0+Qtx+Qrx+EFICIENCYtx+EFICIENCYrx+30.*log10(radius_rx.*radius_tx)-Prx)./60).*1.5; distance_del=10.^(-0.5.*log10(1+(radius_tx./distance_pr).^2)); distance_c= distance_pr.*distance_del; line11=0:0.05:8;% straight line for comparison between the graph trend and a liniar pattern line22=5.*line11; plot(radius_tx,distance_c,'-',radius_tx,distance_pr,'--') %plot of distance as a function of transmitter ciol radius xlabel('Transmitter Coil Radius (cm)') ylabel('Distance (cm)') legend('with delta d consideration','without delta d consideration',2) end if st==2 %Distance as a function of receiver coil radius TxP=23; % power at the transmitter {dBm} RxP=0; % power at the receiver {dBm} qur=1000; qut=1000; RxQ=log10(qut); % Quality factor of the transmitter TxQ=log10(qur); % Quality factor of the receiver eff1=0.98; eff2=0.98; TxE=log10(eff1); %Efficiency of the transmitter RxE=log10(eff2); %Efficiency of the receiver TXr=2.5; % radius of the transmitter coil {cm} RXr=(0.001:0.005:7);% radius of the receiver coil {cm} distance_pr=10.^((TxP+mu0+mu0+TxQ+RxQ+TxE+RxE+30.*log10(RXr.*TXr)-RxP)./60).*1.5; distance_del=10.^(-0.5.*log10(1+(TXr./distance_pr).^2)); distance_c= distance_pr.*distance_del; line11=0:0.05:7;% straight line for comparison between the ghraph trend and a liniar pattern line22=7.*line11; plot(RXr,distance_c,'-',RXr,distance_pr,'--') %plot of distance as a function of receiver ciol radius xlabel('Receiver Coil Radius (cm)') ylabel('Distance (cm)') legend('with delta d consideration' ,'without delta d consideration',2) %text(4.55,22,'(X=4.55,Y=22)'); end if st==3 %Distance as a function of transmission power Prx=0; % power at the transmitter {dBm} Ptx=(0:0.05:70); % power at the receiver {dBm} qur=1000; qut=1000; Qrx=log10(qut); % Quality factor of the transmitter Qtx=log10(qur); % Quality factor of the receiver { eff1=0.98; eff2=0.98; EFICIENCYrx=log10(eff1); %Efficiency of the transmitter EFICIENCYtx=log10(eff2); %Efficiency of the receiver radius_tx=2.5 ; % radius of the transmitter coil {cm} radius_rx =1.5;% radius of the receiver coil {cm} distance_pr=10.^((Ptx+mu0+mu0+Qtx+Qrx+EFICIENCYtx+EFICIENCYrx+30.*log10(radius_rx.*radius_tx)-Prx)./60).*1.5; distance_del=10.^(-0.5.*log10(1+(radius_tx./distance_pr).^2)); distance_c= distance_pr.*distance_del; plot(Ptx,distance_c,'-',Ptx,distance_pr,'--') %plot of distance as a function of transmission power xlabel('Transmission Power(dBm)') ylabel('Distance (cm)') legend('with delta d consideration','without delta d consideration',2) end if st==4 %Distance as a function of receiver power Ptx=23; % power at the transmitter Prx=(0:0.05:23); % power at the receiver qur=1000; qut=1000; Qrx=log10(qut); % Quality factor of the transmitter Qtx=log10(qur); % Quality factor of the receiver eff1=0.98; eff2=0.98; EFICIENCYrx=log10(eff1); %Efficiency of the transmitter EFICIENCYtx=log10(eff2); %Efficiency of the receiver radius_tx=2.5 ; % radius of the transmitter coil {cm} radius_rx =1.5;% radius of the receiver coil {cm} distance_pr=10.^((Ptx+mu0+mu0+Qtx+Qrx+EFICIENCYtx+EFICIENCYrx+30.*log10(radius_rx.*radius_tx)-Prx)./60).*1.5; distance_del=10.^(-0.5.*log10(1+(radius_tx./distance_pr).^2)); distance_c= distance_pr.*distance_del; plot(Prx,distance_c,'-',Prx,distance_pr,'--') %plot of distance as a function of reception power xlabel('Received Power(dBm)') ylabel('Distance(cm)') legend('with delta d consideration','without delta d consideration') end if st==5 % Distance as a function of efficiency of receiver and transmitter coil Ptx=23; % power at the transmitter {dBm} Prx=0; % power at the receiver {dBm} qur=1000; qut=1000; Qrx=log10(qut); % Quality factor of the transmitter Qtx=log10(qur); % Quality factor of the receiver eff1=0.01:0.05:1 eff2=0.01:0.05:1; EFICIENCYtx=log10(eff1); %Efficiency of the transmitter EFICIENCYrx=log10(eff2); %Efficiency of the receiver radius_tx=2.5; % radius of the transmitter coil {cm} radius_rx =1.5;% radius of the receiver coil {cm} distance_pr=10.^((Ptx+mu0+mu0+Qtx+Qrx+EFICIENCYtx+EFICIENCYrx+30.*log10(radius_rx.*radius_tx)-Prx)./60).*1.5; distance_del=10.^(-0.5.*log10(1+(radius_tx./distance_pr).^2)); distance_c= distance_pr.*distance_del; plot(eff1,distance_c,'-',eff2,distance_pr,'--') %plot of distance as a function of receiver coil efficiency xlabel('Receiver and Transmitter Coil Efficiency') ylabel('Distance (cm)') legend('with delta d consideration','without delta d consideration',2) end if st==6 % Distance as a function of efficiency of receiver coil Ptx=23; % power at the transmitter {dBm} Prx=0; % power at the receiver {dBm} qur=1000; qut=1000; Qrx=log10(qut); % Quality factor of the transmitter Qtx=log10(qur); % Quality factor of the receiver eff1=0.98; eff2=0.01:0.05:1; EFICIENCYtx=log10(eff1); %Efficiency of the transmitter EFICIENCYrx=log10(eff2); %Efficiency of the receiver radius_tx=2.5; % radius of the transmitter coil {cm} radius_rx =1.5;% radius of the receiver coil {cm} distance_pr=10.^((Ptx+mu0+mu0+Qtx+Qrx+EFICIENCYtx+EFICIENCYrx+30.*log10(radius_rx.*radius_tx)-Prx)./60).*1.5; distance_del=10.^(-0.5.*log10(1+(radius_tx./distance_pr).^2)); distance_c= distance_pr.*distance_del; plot(eff2,distance_c,'-',eff2,distance_pr,'--') %plot of distance as a function of receiver coil efficiency xlabel('Receiver Coil Efficiency') ylabel('Distance (cm)') legend('with delta d consideration' ,'without delta d consideration',2) end if st==7 %Distance as a function of efficiency of transmitter coil Ptx=23; % power at the transmitter {dBm} Prx=0; % power at the receiver {dBm} qur=1000; qut=1000; Qrx=log10(qut); % Quality factor of the transmitter Qtx=log10(qur); % Quality factor of the receiver eff2=0.98; eff1=0.01:0.05:1; EFICIENCYtx=10.*log10(eff1); %Efficiency of the transmitter EFICIENCYrx=10.*log10(eff2); %Efficiency of the receiver radius_tx=2.5 ; % radius of the transmitter coil {cm} radius_rx =1.5;% radius of the receiver coil {cm} distance_pr=10.^((Ptx+mu0+mu0+Qtx+Qrx+EFICIENCYtx+EFICIENCYrx+30.*log10(radius_rx.*radius_tx)-Prx)./60).*1.5; distance_del=10.^(-0.5.*log10(1+(radius_tx./distance_pr).^2)); distance_c= distance_pr.*distance_del; plot(eff1,distance_c,'-',eff1,distance_pr,'--') %plot of distance as a function of transmitter ciol efficiency xlabel('Transmitter Coil Efficiency') ylabel('Distance (cm)') legend('with delta d consideration','without delta d consideration',2) end if st==8 %Distance as a function of Quality factor of receiver and transmitter coil Ptx=23; % power at the transmitter Prx=0; % power at the receiver qut=0.01:0.05:1000; qur=0.01:0.05:1000; Qrx=log10(qut); % Quality factor of the transmitter Qtx=log10(qur); % Quality factor of the receiver eff1=0.98; eff2=0.98; EFICIENCYtx=log10(eff1); %Efficiency of the transmitter EFICIENCYrx=log10(eff2); %Efficiency of the receiver radius_tx=2.5 ; % radius of the transmitter coil {cm} radius_rx =1.5;% radius of the receiver coil {cm} distance_pr=10.^((Ptx+mu0+mu0+Qtx+Qrx+EFICIENCYtx+EFICIENCYrx+30.*log10(radius_rx.*radius_tx)-Prx)./60).*1.5; distance_del=10.^(-0.5.*log10(1+(radius_tx./distance_pr).^2)); distance_c= distance_pr.*distance_del; plot(qur,distance_c,'-',qur,distance_pr,'--') %plot of distance as a function of Quality factor of receiver coil xlabel('Receiver and Transmitter Coil Quality Factor') ylabel('Distance (cm)') legend('with delta d consideration' ,'without delta d consideration',2) end if st==9 %Distance as a function of Quality factor of transmitter coil Ptx=23; % power at the transmitter {dBm} Prx=0; % power at the receiver {dBm} qut=0.01:0.05:1000; qur=1000; Qrx=log10(qut); % Quality factor of the transmitter Qtx=log10(qur); % Quality factor of the receiver eff1=0.98; eff2=0.98; EFICIENCYtx=log10(eff1); %Efficiency of the transmitter EFICIENCYrx=log10(eff2); %Efficiency of the receiver radius_tx=2.5; % radius of the transmitter coil {cm} radius_rx =1.5;% radius of the receiver coil {cm} distance_pr=10.^((Ptx+mu0+mu0+Qtx+Qrx+EFICIENCYtx+EFICIENCYrx+30.*log10(radius_rx.*radius_tx)-Prx)./60).*1.5; distance_del=10.^(-0.5.*log10(1+(radius_tx./distance_pr).^2)); distance_c= distance_pr.*distance_del; plot(qut,distance_c,'-',qut,distance_pr,'--'); %plot of distance as a function of Quality factor of transmitter coil xlabel('Transmitter Coil Quality Factor') ylabel('Distance (cm)') legend('with delta d consideration','without delta d consideration',2) end if st==10 %Distance as a function of Quality factor of receiver coil Ptx=23; % power at the transmitter Prx=0; % power at the receiver qur=0.01:0.05:1000; qut=1000; Qrx=log10(qut); % Quality factor of the transmitter Qtx=log10(qur); % Quality factor of the receiver eff1=0.98; eff2=0.98; EFICIENCYtx=log10(eff1); %Efficiency of the transmitter EFICIENCYrx=log10(eff2); %Efficiency of the receiver radius_tx=2.5 ; % radius of the transmitter coil {cm} radius_rx =1.5;% radius of the receiver coil {cm} distance_pr=10.^((Ptx+mu0+mu0+Qtx+Qrx+EFICIENCYtx+EFICIENCYrx+30.*log10(radius_rx.*radius_tx)-Prx)./60).*1.5; distance_del=10.^(-0.5.*log10(1+(radius_tx./distance_pr).^2)); distance_c= distance_pr.*distance_del; plot(qur,distance_c,'-',qur,distance_pr,'--') %plot of distance as a function of Quality factor of receiver coil xlabel('Receiver Coil Quality Factor') ylabel('Distance (cm)') legend('with delta d consideration','without delta d consideration',2) end elseif f==2 subplot('Position',[0.38 0.06 0.6 0.33]); axis on; if sr==1 %Distance as a function of transmitter coil radius (ferrite core coil) Ptx_dBm=23; % power at the transmitter {dBm} Prx_dBm=0; % power at the receiver {dBm} qur=1000; qut=1000; Qrx_dB=log10(qut); % Quality factor of the transmitter Qtx_dB=log10(qur); % Quality factor of the receiver eff1=0.98; eff2=0.98; EFICIENCYtx_dB=log10(eff1); %Efficiency of the transmitter EFICIENCYrx_dB=log10(eff2); %Efficiency of the receiver mu0=log10(4.*pi.* 10.^-7); mu1p=10000; mu1rel=log10(mu1p); MU_tx=mu1rel-mu0; mu2p=10000; mu2rel=log10(mu2p); MU_rx=mu2rel-mu0; radius_tx_cm=(0:0.005:8); % radius of the transmitter coil {cm} radius_rx_cm =1.5;% radius of the receiver coil {cm} distance_prime=10.^((Ptx_dBm+Qtx_dB+Qrx_dB+EFICIENCYtx_dB+EFICIENCYrx_dB+30.*log10(radius_rx_cm.*radius_tx_cm)-Prx_dBm+MU_tx+MU_rx)./60).*1.5; distance_delta=10.^(-0.5.*log10(1+(radius_tx_cm./distance_prime).^2)); distance_cm= distance_prime.*distance_delta; line1=0:0.05:8; line2=30.*line1; plot(radius_tx_cm,distance_cm,'-',radius_tx_cm,distance_prime,'--'); %plot of distance as a function of transmitter ciol radius xlabel('Transmitter Coil Radius (cm)') ylabel('Distance (cm)') legend('with delta d consideration','without delta d consideration',2) end if sr==2 %Distance as a function of receiver coil radius(ferrite core coil) Ptx_dBm=23; % power at the transmitter {dBm} Prx_dBm=0; % power at the receiver {dBm} qur=1000; qut=1000; Qrx=log10(qut); % Quality factor of the transmitter Qtx=log10(qur); % Quality factor of the receiver mu0=log10(4.*pi.* 10.^-7); eff1=0.98; eff2=0.98; EFICIENCYtx_dB=log10(eff1); %Efficiency of the transmitter EFICIENCYrx_dB=log10(eff2); %Efficiency of the receiver mu1p=10000; %range of the permeability of the transmitting coil mu1rel=log10(mu1p); MU_tx=mu1rel-mu0; mu2p=10000; mu2rel=log10(mu2p); MU_rx=mu2rel-mu0; radius_tx_cm=2.5; % radius of the transmitter coil {cm} radius_rx_cm=(0:0.005:7);% radius of the receiver coil {cm} distance_prime=10.^((Ptx_dBm+Qtx_dB+Qrx_dB+EFICIENCYtx_dB+EFICIENCYrx_dB+30.*log10(radius_rx_cm.*radius_tx_cm)-Prx_dBm+MU_tx+MU_rx)./60).*1.5; distance_delta=10.^(-0.5.*log10(1+(radius_tx_cm./distance_prime).^2)); distance_cm= distance_prime.*distance_delta; line1=0:0.05:7; line2=30.*line1; plot(radius_rx_cm,distance_cm,'-',radius_rx_cm,distance_prime,'--') %plot of distance as a function of receiver ciol radius xlabel('Receiver Coil Radius (cm)') ylabel('Distance (cm)') legend('with delta d consideration','without delta d consideration',2) end if sr==3 %Distance as a function of transmission power (ferrite core coil) Prx_dBm=0; % power at the transmitter Ptx_dBm=(0.001:0.05:40); % power at the receiver qur=1000; qut=1000; Qrx=log10(qut); % Quality factor of the transmitter Qtx=log10(qur); % Quality factor of the receiver mu0=log10(4.*pi.* 10.^-7); eff1=0.98; eff2=0.98; EFICIENCYtx_dB=log10(eff1); %Efficiency of the transmitter EFICIENCYrx_dB=log10(eff2); %Efficiency of the receiver mu1p=10000; %range of the permeability of the transmitting coil mu1rel=log10(mu1p); MU_tx=mu1rel-mu0; mu2p=10000; mu2rel=log10(mu2p); MU_rx=mu2rel-mu0; radius_tx_cm=2.5 ; % radius of the transmitter coil {cm} radius_rx_cm =1.5;% radius of the receiver coil {cm} distance_prime=10.^((Ptx_dBm+Qtx_dB+Qrx_dB+EFICIENCYtx_dB+EFICIENCYrx_dB+30.*log10(radius_rx_cm.*radius_tx_cm)-Prx_dBm+MU_tx+MU_rx)./60).*1.5; distance_delta=10.^(-0.5.*log10(1+(radius_tx_cm./distance_prime).^2)); distance_cm= distance_prime.*distance_delta; plot(Ptx_dBm,distance_cm,'-',Ptx_dBm,distance_prime,'--') %plot of distance as a function of transmission power xlabel('Transmission Power(dBm)') ylabel('Distance (cm)') legend('with delta d consideration','without delta d consideration',2) end if sr==4 %Distance as a function of receiver power (ferrite core coil) Ptx_dBm=23; % power at the transmitter {dBm} Prx_dBm=(0.001:0.05:23); % power at the receiver {dBm} qur=1000; qut=1000; Qrx=log10(qut); % Quality factor of the transmitter Qtx=log10(qur); % Quality factor of the receiver mu0=log10(4.*pi.* 10.^-7); eff1=0.98; eff2=0.98; EFICIENCYtx_dB=log10(eff1); %Efficiency of the transmitter EFICIENCYrx_dB=log10(eff2); %Efficiency of the receiver mu1p=10000; mu1rel=log10(mu1p); MU_tx=mu1rel-mu0; mu2p=10000; % permeability of the receiver coil mu2rel=log10(mu2p); MU_rx=mu2rel-mu0; radius_tx_cm=2.5 ; % radius of the transmitter coil {cm} radius_rx_cm =1.5;% radius of the receiver coil {cm} distance_prime=10.^((Ptx_dBm+Qtx_dB+Qrx_dB+EFICIENCYtx_dB+EFICIENCYrx_dB+30.*log10(radius_rx_cm.*radius_tx_cm)-Prx_dBm+MU_tx+MU_rx)./60).*1.5; distance_delta=10.^(-0.5.*log10(1+(radius_tx_cm./distance_prime).^2)); distance_cm= distance_prime.*distance_delta; plot(Prx_dBm,distance_cm,'-',Prx_dBm,distance_prime,'--') %plot of distance as a function of reception power xlabel('Received Power(dBm)') ylabel('Distance (cm)') legend('with delta d consideration','without delta d consideration') end if sr==5 % Distance as a function of efficiency of receiver and transmitter coil(ferrite core coil) Ptx_dBm=23; % power at the transmitter Prx_dBm=0; % power at the receiver qur=1000; qut=1000; Qrx=log10(qut); % Quality factor of the transmitter Qtx=log10(qur); % Quality factor of the receiver mu0=log10(4.*pi.* 10.^-7); eff1=0.01:0.005:1; eff2=0.01:0.005:1; EFICIENCYtx_dB=log10(eff1); %Efficiency of the transmitter EFICIENCYrx_dB=log10(eff2); %Efficiency of the receiver mu1p=10000; %range of the permeability of the transmitting coil mu1rel=log10(mu1p); MU_tx=mu1rel-mu0; mu2p=10000; %range of the permeability of the receiver coil mu2rel=log10(mu2p); MU_rx=mu2rel-mu0; radius_tx_cm=2.5; % radius of the transmitter coil {cm} radius_rx_cm =1.5;% radius of the receiver coil {cm} distance_prime=10.^((Ptx_dBm+Qtx_dB+Qrx_dB+EFICIENCYtx_dB+EFICIENCYrx_dB+30.*log10(radius_rx_cm.*radius_tx_cm)-Prx_dBm+MU_tx+MU_rx)./60).*1.5; distance_delta=10.^(-0.5.*log10(1+(radius_tx_cm./distance_prime).^2)); distance_cm= distance_prime.*distance_delta; plot(eff2,distance_cm,'-',eff2,distance_prime,'--') %plot of distance as a function of receiver coil efficiency xlabel('Receiver and Transmitter Coil Efficiency') ylabel('Distance (cm)') legend('with delta d consideration','without delta d consideration',2) end if sr==6 % Distance as a function of efficiency of receiver coil(ferrite core coil) Ptx_dBm=23; % power at the transmitter {dBm} Prx_dBm=0; % power at the receiver {dBm} qur=1000; qut=1000; Qrx=log10(qut); % Quality factor of the transmitter Qtx=log10(qur); % Quality factor of the receiver mu0=log10(4.*pi.* 10.^-7); eff1=0.98; eff2=0.01:0.005:1; EFICIENCYtx_dB=log10(eff1); %Efficiency of the transmitter EFICIENCYrx_dB=log10(eff2); %Efficiency of the receiver mu1p=10000; %range of the permeability of the transmitting coil mu1rel=log10(mu1p); MU_tx=mu1rel-mu0; mu2p=10000; %range of the permeability of the receiver coil mu2rel=log10(mu2p); MU_rx=mu2rel-mu0; radius_tx_cm=2.5; % radius of the transmitter coil {cm} radius_rx_cm =1.5;% radius of the receiver coil {cm} distance_prime=10.^((Ptx_dBm+Qtx_dB+Qrx_dB+EFICIENCYtx_dB+EFICIENCYrx_dB+30.*log10(radius_rx_cm.*radius_tx_cm)-Prx_dBm+MU_tx+MU_rx)./60).*1.5; distance_delta=10.^(-0.5.*log10(1+(radius_tx_cm./distance_prime).^2)); distance_cm= distance_prime.*distance_delta; plot(eff2,distance_cm,eff2,distance_prime,'--') %plot of distance as a function of receiver coil efficiency xlabel('Receiver Coil Efficiency') ylabel('Distance (cm)') legend('with delta d consideration','without delta d consideration',2) end if sr==7 %Distance as a function of efficiency of transmitter coil (ferrite core coil) Ptx_dBm=23; % power at the transmitter Prx_dBm=0; % power at the receiver qur=1000; qut=1000; Qrx=log10(qut); % Quality factor of the transmitter Qtx=log10(qur); % Quality factor of the receiver mu0=log10(4.*pi.* 10.^-7); eff21=0.98; eff1=0.01:0.005:1; EFICIENCYtx_dB=log10(eff1); %Efficiency of the transmitter EFICIENCYrx_dB=log10(eff2); %Efficiency of the receiver mu1p=10000; %range of the permeability of the transmitting coil mu1rel=log10(mu1p); MU_tx=mu1rel-mu0; mu2p=10000; %range of the permeability of the receiver coil mu2rel=log10(mu2p); MU_rx=mu2rel-mu0; radius_tx_cm=2.5 ; % radius of the transmitter coil {cm} radius_rx_cm =1.5;% radius of the receiver coil {cm} distance_prime=10.^((Ptx_dBm+Qtx_dB+Qrx_dB+EFICIENCYtx_dB+EFICIENCYrx_dB+30.*log10(radius_rx_cm.*radius_tx_cm)-Prx_dBm+MU_tx+MU_rx)./60).*1.5; distance_delta=10.^(-0.5.*log10(1+(radius_tx_cm./distance_prime).^2)); distance_cm= distance_prime.*distance_delta; plot(eff1,distance_cm,'-',eff1,distance_prime,'--') %plot of distance as a function of transmitter ciol efficiency xlabel('Transmitter Coil Efficiency') ylabel('Distance(cm)') legend('with delta d consideration','without delta d consideration',2) end if sr==8 %Distance as a function of Quality factor of receiver and transmitter coil Ptx_dBm=23; % power at the transmitter {dBm} Prx_dBm=0; % power at the receiver {dBm} qur=0.0001:0.005:1000; qut=0.0001:0.005:1000; mu0=log10(4.*pi.* 10.^-7); Qrx_dB=log10(qut); % Quality factor of the transmitter Qtx_dB=log10(qur); % Quality factor of the receiver mu1p=10000; %range of the permeability of the transmitting coil mu1rel=log10(mu1p); MU_tx=mu1rel-mu0; mu2p=10000; %range of the permeability of the receiver coil mu2rel=log10(mu2p); MU_rx=mu2rel-mu0; eff2=0.98; eff1=0.98; EFICIENCYtx_dB=log10(eff1); %Efficiency of the transmitter EFICIENCYrx_dB=log10(eff2); %Efficiency of the receiver radius_tx_cm=2.5 ; % radius of the transmitter coil {cm} radius_rx_cm =1.5;% radius of the receiver coil {cm} distance_prime=10.^((Ptx_dBm+Qtx_dB+Qrx_dB+EFICIENCYtx_dB+EFICIENCYrx_dB+30.*log10(radius_rx_cm.*radius_tx_cm)-Prx_dBm+MU_rx+MU_tx)./60).*1.5; distance_delta=10.^(-0.5.*log10(1+(radius_tx_cm./distance_prime).^2)); distance_cm= distance_prime.*distance_delta; plot(qur,distance_cm,'-',qur,distance_prime,'--') %plot of distance as a function of Quality factor of receiver coil xlabel('Receiver and Transmitter Coil Quality Factor') ylabel('Distance (cm)') legend('with delta d consideration','without delta d consideration',2) end if sr==9 %Distance as a function of Quality factor of transmitter coil (ferrite core coil) Ptx_dBm=23; % power at the transmitter {dBm} Prx_dBm=0; % power at the receiver qur=1000; qut=0.0001:0.005:1000; Qrx_dB=log10(qut); % Quality factor of the transmitter Qtx_dB=log10(qur); % Quality factor of the receiver eff2=0.98; eff1=0.98; mu0=log10(4.*pi.* 10.^-7); EFICIENCYtx_dB=log10(eff1); %Efficiency of the transmitter EFICIENCYrx_dB=log10(eff2); %Efficiency of the receiver mu1p=10000; %permeability of the transmitting coil mu1rel=log10(mu1p); MU_tx=mu1rel-mu0; mu2p=10000; %permeability of the receiver coil mu2rel=log10(mu2p); MU_rx=mu2rel-mu0; radius_tx_cm=2.5; % radius of the transmitter coil {cm} radius_rx_cm =1.5;% radius of the receiver coil {cm} distance_prime=10.^((Ptx_dBm+Qtx_dB+Qrx_dB+EFICIENCYtx_dB+EFICIENCYrx_dB+30.*log10(radius_rx_cm.*radius_tx_cm)-Prx_dBm+MU_tx+MU_rx)./60).*1.5; distance_delta=10.^(-0.5.*log10(1+(radius_tx_cm./distance_prime).^2)); distance_cm= distance_prime.*distance_delta; plot(qut,distance_cm,'-',qut,distance_prime,'--'); %plot of distance as a function of Quality factor of transmitter coil xlabel('Transmitter Coil Quality Factor ') ylabel('Distance (cm)') legend('with delta d consideration','without delta d consideration',2) end if sr==10 %Distance as a function of Quality factor of receiver coil (ferrite core coil) Ptx_dBm=23; % power at the transmitter Prx_dBm=0; % power at the receiver qur=0.0001:0.005:1000; qut=1000; Qrx_dB=log10(qut); % Quality factor of the transmitter Qtx_dB=log10(qur); % Quality factor of the receiver mu0=log10(4.*pi.* 10.^-7); eff2=0.98; eff1=0.98; EFICIENCYtx_dB=log10(eff1); %Efficiency of the transmitter EFICIENCYrx_dB=log10(eff2); %Efficiency of the receiver mu1p=10000; %range of the permeability of the transmitting coil mu1rel=log10(mu1p); MU_tx=mu1rel-mu0; mu2p=10000; %range of the permeability of the receiver coil mu2rel=log10(mu2p); MU_rx=mu2rel-mu0;radius_tx_cm=2.5 ; % radius of the transmitter coil {cm} radius_rx_cm =1.5;% radius of the receiver coil {cm} distance_prime=10.^((Ptx_dBm+Qtx_dB+Qrx_dB+EFICIENCYtx_dB+EFICIENCYrx_dB+30.*log10(radius_rx_cm.*radius_tx_cm)-Prx_dBm+MU_tx+MU_rx)./60).*1.5; distance_delta=10.^(-0.5.*log10(1+(radius_tx_cm./distance_prime).^2)); distance_cm= distance_prime.*distance_delta; plot(qur,distance_cm,'-',qur,distance_prime,'--') %plot of distance as a function of Quality factor of receiver coil xlabel('Receiver Coil Quality Factor') ylabel('Distance (cm)') legend('with delta d consideration','without delta d consideration',2) end if sr==11 %Distance as a function of transmitter and receiver coil core permeability (ferrite core coil) Prx_dBm=0; % power at the receiver Ptx_dBm=23; qur=1000; qut=1000; mu0=log10(4.*pi.* 10.^-7); Qrx=log10(qut); % Quality factor of the transmitter Qtx=log10(qur); % Quality factor of the receiver eff2=0.98; eff1=0.98; EFICIENCYtx_dB=log10(eff1); %Efficiency of the transmitter EFICIENCYrx_dB=log10(eff2); %Efficiency of the receiver mu1p=1:0.005:10000; %range of the permeability of the transmitting coil mu1rel=log10(mu1p); MU_tx=mu1rel-mu0; mu2p=1:0.005:10000; %range of the permeability of the receiver coil mu2rel=log10(mu2p); MU_rx=mu2rel-mu0; radius_tx_cm=2.5; % radius of the transmitter coil {cm} radius_rx_cm =1.5;% radius of the receiver coil {cm} distance_prime=10.^((Ptx_dBm+Qtx_dB+Qrx_dB+EFICIENCYtx_dB+EFICIENCYrx_dB+30.*log10(radius_rx_cm.*radius_tx_cm)-Prx_dBm+MU_tx+MU_rx)./60).*1.5; distance_delta=10.^(-0.5.*log10(1+(radius_tx_cm./distance_prime).^2)); distance_cm= distance_prime.*distance_delta; plot(mu1p,distance_cm,'-',mu1p,distance_prime,'--'); %plot of distance as a function of transmitter ciol radius xlabel('Transmitter and Receiver Coil Relative Permeability') ylabel('Distance (cm)') legend('with delta d consideration','without delta d consideration',2) end if sr==12 Prx_dBm=0; Ptx_dBm=23;% power at the transmitter {dBm} mu0=log10(4.*pi.* 10.^-7); qur=1000; qut=1000; Qrx=log10(qut); % Quality factor of the transmitter Qtx=log10(qur); % Quality factor of the receiver eff2=0.98; eff1=0.98; EFICIENCYtx_dB=log10(eff1); %Efficiency of the transmitter EFICIENCYrx_dB=log10(eff2); %Efficiency of the receiver mu1p=1:0.005:10000; %range of the permeability of the transmitting coil mu1rel=log10(mu1p); MU_tx=mu1rel-mu0; mu2p=10000; %range of the permeability of the receiver coil mu2rel=log10(mu2p); MU_rx=mu2rel-mu0; radius_tx_cm=2.5; % radius of the transmitter coil {cm} radius_rx_cm =1.5;% radius of the receiver coil {cm} distance_prime=10.^((Ptx_dBm+Qtx_dB+Qrx_dB+EFICIENCYtx_dB+EFICIENCYrx_dB+30.*log10(radius_rx_cm.*radius_tx_cm)-Prx_dBm+MU_tx+MU_rx)./60).*1.5; distance_delta=10.^(-0.5.*log10(1+(radius_tx_cm./distance_prime).^2)); distance_cm= distance_prime.*distance_delta; plot(mu1p,distance_cm,'-',mu1p,distance_prime,'--'); %plot of distance as a function of transmitter ciol radius xlabel('Transmitter Coil relative Permeability') ylabel('Distance(cm)') legend('with delta d consideration','without delta d consideration',2) end if sr==13 Prx_dBm=0; % power at the receiver {dBm} Ptx_dBm=23; mu0=log10(4.*pi.* 10.^-7); qur=1000; qut=1000; Qrx=10.*log10(qut); % Quality factor of the transmitter Qtx=10.*log10(qur); % Quality factor of the receiver) eff2=0.98; eff1=0.98; EFICIENCYtx_dB=log10(eff1); %Efficiency of the transmitter EFICIENCYrx_dB=log10(eff2); %Efficiency of the receiver } mu1p=10000; %the permeability of the transmitting coil mu1rel=log10(mu1p); MU_tx=mu1rel-mu0; mu2p=1:0.005:10000; mu2rel=log10(mu2p); MU_rx=mu2rel-mu0; radius_tx_cm=2.5; % radius of the transmitter coil {cm} radius_rx_cm =1.5;% radius of the receiver coil {cm} distance_prime=10.^((Ptx_dBm+Qtx_dB+Qrx_dB+EFICIENCYtx_dB+EFICIENCYrx_dB+30.*log10(radius_rx_cm.*radius_tx_cm)-Prx_dBm+MU_tx+MU_rx)./60).*1.5; distance_delta=10.^(-0.5.*log10(1+(radius_tx_cm./distance_prime).^2)); distance_cm= distance_prime.*distance_delta; plot(mu2p,distance_cm,'-',mu2p,distance_prime,'--'); %plot of distance as a function of transmitter ciol radius xlabel('Receiver Coil relative Permeability') ylabel('Distance (cm)') legend('with delta d consideration','without delta d consideration',2) end end hb = uicontrol('Style','pushbutton','position',[80 160 100 30], 'FontName','Arial',... 'FontSize',14,'FontWeight','normal',... 'String','Reset'); set(hb,'Callback','twogragh') %********************************************************************* %********************************************************************* % THE END %********************************************************************* %********************************************************************* %developed by: Mehrnoush Masihpour 18.12.2009 %file name: minoo.m if x==1 % -------------------------------------------------- if Option==1 set (radiobutton1, 'Value',1); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); TXQ1=log10(TXQ); RXQ1=log10(RXQ); TXeff1=log10(TXeff); RXeff1=log10(RXeff); TXmu1=log10(TXmu); RXmu1=log10(RXmu); mu0=log10(4.*pi.* 10.^-7); r1=0.0001:0.005:8; %range of transmitter coil radius d1=10.^((mu0+mu0+TXp+TXQ1+RXQ1+TXeff1+RXeff1+30.*log10(RXr.*r1)-RXp)./60).*1.5; d2=10.^(-0.5.*log10(1+(r1./d1).^2)); da=d1.*d2; subplot('Position',[0.35 0.55 0.63 0.35]); axis on; plot(r1,da); xlabel('Transmitter Coil Radius (cm)') ylabel('Distance (cm)') d11=10.^((RXmu1+TXmu1+TXp+TXQ1+RXQ1+TXeff1+RXeff1+30.*log10(RXr.*r1)-RXp)./60).*1.5; d22=10.^(-0.5.*log10(1+(r1./d11).^2)); df= d11.*d22; subplot('Position',[0.35 0.05 0.63 0.35]); axis on; plot(r1,df); xlabel('Transmitter Coil Radius (cm)') ylabel('Distance (cm)') elseif Option==2 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',1); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); r2=0.0001:0.005:7; %range of receiver coil radius d1=10.^((mu0+mu0+TXp+TXQ1+RXQ1+TXeff1+RXeff1+30.*log10(r2.*TXr)-RXp)./60).*1.5; d2=10.^(-0.5.*log10(1+(TXr./d1).^2)); da= d1.*d2; subplot('Position',[0.35 0.55 0.63 0.35]); axis on; plot(r2,da); xlabel('Receiver Coil Radius (cm)') ylabel('Distance (cm)') d11=10.^((RXmu1+TXmu1+TXp+TXQ1+RXQ1+TXeff1+RXeff1+30.*log10(r2.*TXr)-RXp)./60).*1.5; d22=10.^(-0.5.*log10(1+(TXr./d11).^2)); df= d11.*d22; subplot('Position',[0.35 0.05 0.63 0.35]); axis on; plot(r2,df); xlabel('Receiver Coil Radius (cm)') ylabel('Distance (cm)') elseif Option==3 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',1); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); p1=0.0001:0.005:25; %transmission power range subplot('Position',[0.35 0.55 0.63 0.35]); axis on; d1=10.^((mu0+mu0+p1+TXQ1+RXQ1+TXeff1+RXeff1+30.*log10(RXr.*TXr)-RXp)./60).*1.5; d2=10.^(-0.5.*log10(1+(TXr./d1).^2)); da= d1.*d2; plot(p1,da); xlabel('Transmission Power (dBm)') ylabel('Distance (cm)') subplot('Position',[0.35 0.05 0.63 0.35]); axis on; d11=10.^((RXmu1+TXmu1+p1+TXQ1+RXQ1+TXeff1+RXeff1+30.*log10(RXr.*TXr)-RXp)./60).*1.5; d22=10.^(-0.5.*log10(1+(TXr./d11).^2)); df= d11.*d22; plot(p1,df); xlabel('Transmission Power (dBm)') ylabel('Distance (cm)') elseif Option==4 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',1); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); p2=0.0001:0.005:20; %range of the power at the receiver subplot('Position',[0.35 0.55 0.63 0.35]); axis on; d1=10.^((mu0+mu0+TXp+TXQ1+RXQ1+TXeff1+RXeff1+30.*log10(RXr.*TXr)-p2)./60).*1.5; d2=10.^(-0.5.*log10(1+(TXr./d1).^2)); da= d1.*d2; plot(p2,da); xlabel('Power at the Receiver (dBm)') ylabel('Distance (cm)') subplot('Position',[0.35 0.05 0.63 0.35]); axis on; d11=10.^((RXmu1+TXmu1+TXp+TXQ1+RXQ1+TXeff1+RXeff1+30.*log10(RXr.*TXr)-p2)./60).*1.5; d22=10.^(-0.5.*log10(1+(TXr./d11).^2)); df= d11.*d22; plot(p2,df); xlabel('Power at the Receiver (dBm)') ylabel('Distance (cm)') elseif Option==5 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',1); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); TXQ1=log10(TXQ); RXQ1=log10(RXQ); TXeff1=log10(TXeff); RXeff1=log10(RXeff); TXmu1=log10(TXmu); RXmu1=log10(RXmu); mu0=log10(4.*pi.* 10.^-7); q1p=0.0001:0.005:1000; q1=log10(q1p) ; subplot('Position',[0.35 0.55 0.63 0.35]); axis on; d1=10.^((mu0+mu0+TXp+q1+RXQ1+TXeff1+RXeff1+30.*log10(RXr.*TXr)-RXp)./60).*1.5; d2=10.^(-0.5.*log10(1+(TXr./d1).^2)); da= d1.*d2; plot(q1p,da); xlabel('Transmitter Coil Quality Factor ') ylabel('Distance (cm)') subplot('Position',[0.35 0.05 0.63 0.35]); axis on; d11=10.^((RXmu1+TXmu1+TXp+q1+RXQ1+TXeff1+RXeff1+30.*log10(RXr.*TXr)-RXp)./60).*1.5; d22=10.^(-0.5.*log10(1+(TXr./d11).^2)); df= d11.*d22; plot(q1p,df); xlabel('Transmitter Coil Quality Factor') ylabel('Distance (cm)') elseif Option==6 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',1); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); TXQ1=log10(TXQ); RXQ1=log10(RXQ); TXeff1=log10(TXeff); RXeff1=log10(RXeff); TXmu1=log10(TXmu); RXmu1=log10(RXmu); mu0=log10(4.*pi.* 10.^-7); q2p=0.0001:0.005:10000; q2=log10(q2p) ; subplot('Position',[0.35 0.55 0.63 0.35]); axis on; d1=10.^((mu0+mu0+TXp+TXQ1+q2+TXeff1+RXeff1+30.*log10(RXr.*TXr)-RXp)./60).*1.5; d2=10.^(-0.5.*log10(1+(TXr./d1).^2)); da= d1.*d2; plot(q2p,da); xlabel('Receiver Coil Quality Factor') ylabel('Distance (cm)') subplot('Position',[0.35 0.05 0.63 0.35]); axis on; d11=10.^((RXmu1+TXmu1+TXp+TXQ1+q2+TXeff1+RXeff1+30.*log10(RXr.*TXr)-RXp)./60).*1.5; d22=10.^(-0.5.*log10(1+(TXr./d11).^2)); df= d11.*d22; plot(q2p,df); xlabel('Receiver Coil Quality Factor') ylabel('Distance (cm)') elseif Option==7 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',1); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); TXQ1=log10(TXQ); RXQ1=log10(RXQ); TXeff1=log10(TXeff); RXeff1=log10(RXeff); TXmu1=log10(TXmu); RXmu1=log10(RXmu); mu0=log10(4.*pi.* 10.^-7); mu1p=1:0.005:10000; mu1rel=log10(mu1p); mu1=mu1rel-mu0; plot2=subplot('Position',[0.35 0.55 0.63 0.35]); axis off; delete(plot2); subplot('Position',[0.35 0.05 0.63 0.35]); axis on; d11=10.^((mu0+mu0+RXmu1+mu1+TXp+TXQ1+RXQ1+TXeff1+RXeff1+30.*log10(RXr.*TXr)-RXp)./60).*1.5; d22=10.^(-0.5.*log10(1+(TXr./d11).^2)); df= d11.*d22; plot(mu1p,df); xlabel('Transmitter Coil Relative permeability') ylabel('Distance (cm)') elseif Option==8 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',1); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); TXQ1=log10(TXQ); RXQ1=log10(RXQ); TXeff1=log10(TXeff); RXeff1=log10(RXeff); TXmu1=log10(TXmu); RXmu1=log10(RXmu); mu0=log10(4.*pi.* 10.^-7); mu2p=1:0.005:1000; mu2rel=log10(mu2p); mu2=mu2rel-mu0; plot2=subplot('Position',[0.35 0.55 0.63 0.35]); axis off; delete(plot2); subplot('Position',[0.35 0.05 0.63 0.35]); axis on; d11=10.^((mu2+TXmu1+TXp+TXQ1+RXQ1+TXeff1+RXeff1+30.*log10(RXr.*TXr)-RXp)./60).*1.5; d22=10.^(-0.5.*log10(1+(TXr./d11).^2)); df= d11.*d22; plot(mu2p,df); xlabel('receiver Coil Relative permeability') ylabel('Distance (cm)') elseif Option==9 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',1); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); eff1p=0.01:.005:1; %range of the transmitter coil efficiency eff1=log10(eff1p); subplot('Position',[0.35 0.55 0.63 0.35]); axis on; d1=10.^((mu0+mu0+TXp+TXQ1+RXQ1+eff1+RXeff1+30.*log10(RXr.*TXr)-RXp)./60).*1.5; d2=10.^(-0.5.*log10(1+(TXr./d1).^2)); da= d1.*d2; plot(eff1p,da); xlabel('Transmitter Coil Efficiency ') ylabel('Distance (cm)') subplot('Position',[0.35 0.05 0.63 0.35]); axis on; d11=10.^((RXmu1+TXmu1+TXp+TXQ1+RXQ1+eff1+RXeff1+30.*log10(RXr.*TXr)-RXp)./60).*1.5; d22=10.^(-0.5.*log10(1+(TXr./d11).^2)); df= d11.*d22; plot(eff1p,df); xlabel('Transmitter Coil Efficiency ') ylabel('Distance (cm)') elseif Option==10 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',1); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); eff2p=0.01:0.005:1; eff2=log10(eff2p); subplot('Position',[0.35 0.55 0.63 0.35]); axis on; d1=10.^((mu0+mu0+TXp+TXQ1+RXQ1+TXeff1+eff2+30.*log10(RXr.*TXr)-RXp)./60).*1.5; d2=10.^(-0.5.*log10(1+(TXr./d1).^2)); da= d1.*d2; plot(eff2p,da); xlabel('Receiver Coil Efficiency') ylabel('Distance (cm)') subplot('Position',[0.35 0.05 0.63 0.35]); axis on; d11=10.^((RXmu1+TXmu1+TXp+TXQ1+RXQ1+TXeff1+eff2+30.*log10(RXr.*TXr)-RXp)./60).*1.5; d22=10.^(-0.5.*log10(1+(TXr./d11).^2)); df= d11.*d22; plot(eff2p,df); xlabel('Receiver Coil Efficiency') ylabel('Distance (cm)') elseif Option==11 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',1); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); eff11p=0.01:0.005:1; eff12p=0.01:0.005:1; eff11=log10(eff11p); eff12=log10(eff12p); subplot('Position',[0.35 0.55 0.63 0.35]); axis on; d1=10.^((mu0+mu0+TXp+TXQ1+RXQ1+eff11+eff12+30.*log10(RXr.*TXr)-RXp)./60).*1.5; d2=10.^(-0.5.*log10(1+(TXr./d1).^2)); da= d1.*d2; plot(eff12,da); xlabel('Receiver and Transmitter Coil Efficiency') ylabel('Distance (cm)') subplot('Position',[0.35 0.05 0.63 0.35]); axis on; d11=10.^((RXmu1+TXmu1+TXp+TXQ1+RXQ1+eff11+eff12+30.*log10(RXr.*TXr)-RXp)./60).*1.5; d22=10.^(-0.5.*log10(1+(TXr./d11).^2)); df= d11.*d22; plot(eff12,df); xlabel('Receiver and Transmitter Coil Efficiency') ylabel('Distance (cm)') elseif Option==12 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',1); set (radiobutton13, 'Value',0); TXQ1=log10(TXQ); RXQ1=log10(RXQ); TXeff1=log10(TXeff); RXeff1=log10(RXeff); TXmu1=log10(TXmu); RXmu1=log10(RXmu); mu0=log10(4.*pi.* 10.^-7); mu11p=1:0.005:10000; mu12p=1:0.005:10000; mu11rel=log10(mu11p); mu12rel=log10(mu12p); mu11=mu11rel-mu0; mu12=mu12rel-mu0; plot2=subplot('Position',[0.35 0.55 0.63 0.35]); axis on; delete(plot2); subplot('Position',[0.35 0.05 0.63 0.35]); axis on; d11=10.^((mu11+mu12+TXp+TXQ1+RXQ1+TXeff1+RXeff1+30.*log10(RXr.*TXr)-RXp)./60).*1.5; d22=10.^(-0.5.*log10(1+(TXr./d11).^2)); df= d11.*d22; plot(mu11p,df); xlabel('Receiver and Transmitter Coil Relative Permeability') ylabel('Distance (cm)') elseif Option==13 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',1); q11p=0.001:0.005:1000; %range of the transmitter coil quality factor q12p=0.001:0.005:1000; %range of the receiver coil quality factor(identical to the transmitter's) q11=log10(q11p); q12=log10(q12p); subplot('Position',[0.35 0.55 0.63 0.35]); axis on; d1=10.^((mu0+mu0+TXp+q11+q12+TXeff1+RXeff1+30.*log10(RXr.*TXr)-RXp)./60).*1.5; d2=10.^(-0.5.*log10(1+(TXr./d1).^2)); da= d1.*d2; plot(q11p,da); xlabel('Receiver and Transmitter Coil Quality Factor') ylabel('Distance (cm)') subplot('Position',[0.35 0.05 0.63 0.35]); axis on; d11=10.^((RXmu1+TXmu1+TXp+q11+q12+TXeff1+RXeff1+30.*log10(RXr.*TXr)-RXp)./60).*1.5; d22=10.^(-0.5.*log10(1+(TXr./d11).^2)); df= d11.*d22; plot(q11p,df); xlabel('Receiver and Transmitter Coil Quality Factor') ylabel('Distance (cm)') end % DISTANCE CALCULATION FOR AIR CORE COIL ****************** elseif x==2 d1=10.^((mu0+mu0+TXp+RXQ1+TXQ1+TXeff1+RXeff1+30.*log10(RXr.*TXr)-RXp)./60).*1.5; d2=10.^(-0.5.*log10(1+(TXr./d1).^2)); distancea= d1.*d2; pText1=uicontrol(gcf,'Style','text','Position',[460 610 150 25],... 'String',distancea,'FontSize',12,'FontWeight','bold',... 'HorizontalAlignment','center','FontName','Arial','BackgroundColor',[1 1 .5]); % DISTANCE CALCULATION FOT FERRITE CORE COIL************** elseif x==3 d11=10.^((RXmu1+TXmu1+TXp+RXQ1+TXQ1+TXeff1+RXeff1+30.*log10(RXr.*TXr)-RXp)./60).*1.5; d22=10.^(-0.5.*log10(1+(TXr./d11).^2)); distancef= d11.*d22; pText2=uicontrol(gcf,'Style','text','Position',[460 290 150 25],... 'String',distancef,'FontSize',12,'FontWeight','bold',... 'HorizontalAlignment','center','FontName','Arial','BackgroundColor',[1 1 .5]); end % RESET BUTTON *********************************************************** hb = uicontrol('Style','pushbutton','position',[5 10 70 25], 'FontName','Arial',... 'FontSize',14,'FontWeight','normal','BackgroundColor',[.8 1 1],... 'String','Reset'); set(hb,'Callback','minoogui') %********************************************************************* %********************************************************************* % THE END %********************************************************************* %********************************************************************* %developed by: Mehrnoush Masihpour 23.12.2009 %file name: NFMIC.m if x==1 if Option==1 set (radiobutton1, 'Value',1); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); rr1=0.001:0.005:8; rxp=txp+qt+qr+teff+reff+tmu+rmu+10.*log10(9.85.*((tr.*rr1)./((d.^2)+(tr.^2))).^3); subplot('Position',[0.35 0.45 0.63 0.45]); plot(rr1,rxp) xlabel('receiver coil radius (cm)') ylabel('Power at the Receiver (dBm)') title('Power at the receiver vs receiver coil radius') elseif Option==2 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',1); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); tr1=0.001:0.005:8; rxp=txp+qt+qr+teff+reff+tmu+rmu+10.*log10(9.85.*((tr1.*rr)./((d.^2)+(tr1.^2))).^3); subplot('Position',[0.35 0.45 0.63 0.45]); plot(tr1,rxp) xlabel('transmitter coil radius (cm)') ylabel('Power at the Receiver (dBm)') title('Power at the receiver vs transmitter coil radius') elseif Option==3 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',1); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); txp1=0.001:0.005:25; rxp=txp1+qt+qr+teff+reff+tmu+rmu+10.*log10(9.85.*((tr.*rr)./((d.^2)+(tr.^2))).^3); subplot('Position',[0.35 0.45 0.63 0.45]); plot(txp1,rxp) xlabel('Transmission power (dBm)') ylabel('Power at the Receiver (dBm)') title('Power at the receiver vs transmission power') elseif Option==4 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',1); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); d1=0.0001:0.005:500; rxp=txp+qt+qr+teff+reff+tmu+rmu+10.*log10(9.85.*((tr.*rr)./((d1.^2)+(tr.^2))).^3); subplot('Position',[0.35 0.45 0.63 0.45]); plot(d1,rxp) xlabel('Communication Range (cm)') ylabel('Power at the Receiver (dBm)') title('Power at the receiver vs distance') elseif Option==5 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',1); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); qtt=0.1:0.005:1000; qt1=log10(qtt); rxp=txp+qt1+qr+teff+reff+tmu+rmu+10.*log10(9.85.*((tr.*rr)./((d.^2)+(tr.^2))).^3); subplot('Position',[0.35 0.45 0.63 0.45]); plot(qtt,rxp) xlabel('Quality Factor of the transmitter coil') ylabel('Power at the Receiver (dBm)') title('Power at the receiver vs Quality factor of the transmitter coil') elseif Option==6 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',1); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); qrr=0.1:0.005:1000; qr1=log10(qrr); rxp=txp+qt+qr1+teff+reff+tmu+rmu+10.*log10(9.85.*((tr.*rr)./((d.^2)+(tr.^2))).^3); subplot('Position',[0.35 0.45 0.63 0.45]); plot(qrr,rxp) xlabel('Quality Factor of the receiver coil') ylabel('Power at the Receiver (dBm)') title('Power at the receiver vs Quality factor of the receiver coil') elseif Option==7 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',1); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); tmuu=0.1:0.005:10000; tmu1=log10(tmuu); rxp=txp+qt+qr+teff+reff+tmu1+rmu+10.*log10(9.85.*((tr.*rr)./((d.^2)+(tr.^2))).^3); subplot('Position',[0.35 0.45 0.63 0.45]); plot(tmuu,rxp) xlabel('transmitter coil Relative permeability') ylabel('Power at the Receiver (dBm)') %legend('Power at the receiver vs transmitter coil permeability') title('Power at the receiver vs transmitter coil permeability') elseif Option==8 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',1); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); rmuu=0.1:0.005:10000; rmu1=log10(rmuu); rxp=txp+qt+qr+teff+reff+tmu+rmu1+10.*log10(9.85.*((tr.*rr)./((d.^2)+(tr.^2))).^3); subplot('Position',[0.35 0.45 0.63 0.45]); plot(rmuu,rxp) xlabel('receiver coil Relative permeability') ylabel('Power at the Receiver (dBm)') title('Power at the receiver vs receiver coil permeability') elseif Option==9 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',1); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); tefff=0.0:0.05:1; teff1=log10(tefff); rxp=txp+qt+qr+teff1+reff+tmu+rmu+10.*log10(9.85.*((tr.*rr)./((d.^2)+(tr.^2))).^3); subplot('Position',[0.35 0.45 0.63 0.45]); plot(tefff,rxp) xlabel('transmitter coil efficiency') ylabel('Power at the Receiver (dBm)') title('Power at the receiver vs transmitter coil efficiency') elseif Option==10 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',1); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); refff=0.1:0.05:1; reff1=log10(refff); rxp=txp+qt+qr+teff+reff1+tmu+rmu+10.*log10(9.85.*((tr.*rr)./((d.^2)+(tr.^2))).^3); subplot('Position',[0.35 0.45 0.63 0.45]); plot(refff,rxp) xlabel('receiver coil efficiency') ylabel('Power at the Receiver (dBm)') title('Power at the receiver vs receiver coil efficiency') elseif Option==11 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',1); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',0); refff=0.1:0.05:1; tefff=.1:0.05:1; reff1=log10(tefff); teff1=log10(tefff); rxp=txp+qt+qr+teff1+reff1+tmu+rmu+10.*log10(9.85.*((tr.*rr)./((d.^2)+(tr.^2))).^3); subplot('Position',[0.35 0.45 0.63 0.45]); plot(refff,rxp) xlabel('receiver and transmitter coil efficiency') ylabel('Power at the Receiver (dBm)') title('Power at the receiver vs receiver and transmitter coil efficiency') elseif Option==12 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',1); set (radiobutton13, 'Value',0); mu0=log10(4.*pi.* 10.^-7); rmuu=1:0.5:10000; tmuu=1:0.5:10000; rmu1=log10(rmuu)-mu0; tmu1=log10(tmuu)-mu0; rxp=txp+qt+qr+teff+reff+tmu1+rmu1+10.*log10(9.85.*((tr.*rr)./((d.^2)+(tr.^2))).^3); subplot('Position',[0.35 0.45 0.63 0.45]); plot(rmuu,rxp) xlabel('receiver and transmitter coil permeability') ylabel('Power at the Receiver (dBm)') title('Power at the receiver vs receiver and transmitter coil permeability') elseif Option==13 set (radiobutton1, 'Value',0); set (radiobutton2, 'Value',0); set (radiobutton3, 'Value',0); set (radiobutton4, 'Value',0); set (radiobutton5, 'Value',0); set (radiobutton6, 'Value',0); set (radiobutton7, 'Value',0); set (radiobutton8, 'Value',0); set (radiobutton9, 'Value',0); set (radiobutton10, 'Value',0); set (radiobutton11, 'Value',0); set (radiobutton12, 'Value',0); set (radiobutton13, 'Value',1); qrr=0.1:0.5:1000; qtt=0.1:0.5:1000; qr1=log10(qrr); qt1=log10(qtt); rxp=txp+qt1+qr1+teff+reff+tmu+rmu+10.*log10(9.85.*((tr.*rr)./((d.^2)+(tr.^2))).^3); subplot('Position',[0.35 0.45 0.63 0.45]); plot(qrr,rxp) xlabel('Quality Factor of the receiver and transmitter coil') ylabel('Power at the Receiver (dBm)') title('Power at the receiver vs Quality factor of the receiver and transmitter coil') end elseif x==2 rxp=txp+qt+qr+teff+reff+tmu+rmu+10.*log10(9.85.*((tr.*rr)./((d.^2)+(tr.^2))).^3); rxp_mW=10.^(rxp./100); pText2=uicontrol(gcf,'Style','text','Position',[280 100 500 60],... 'String','The power at the receiver is = (dBm)','FontSize',14,'FontWeight','bold',... 'HorizontalAlignment','center','FontName','Arial','BackgroundColor',[0.7 0.9 0.99]); pText212=uicontrol(gcf,'Style','text','Position',[780 100 100 60],... 'String',rxp,'FontSize',14,'FontWeight','bold',... 'HorizontalAlignment','left','FontName','Arial','BackgroundColor',[0.7 0.9 0.99]); pText33=uicontrol(gcf,'Style','text','Position',[280 40 500 60],... 'String','The power at the receiver is = (mW)','FontSize',14,'FontWeight','bold',... 'HorizontalAlignment','center','FontName','Arial','BackgroundColor',[0.7 0.9 0.99]); pText313=uicontrol(gcf,'Style','text','Position',[780 40 100 60],... 'String',rxp_mW,'FontSize',14,'FontWeight','bold',... 'HorizontalAlignment','left','FontName','Arial','BackgroundColor',[0.7 0.9 0.99]); end % RESET BUTTON *********************************************************** hb = uicontrol('Style','pushbutton','position',[5 10 70 25], 'FontName','Arial',... 'FontSize',14,'FontWeight','normal','BackgroundColor',[.8 .9 .5],... 'String','Reset'); set(hb,'Callback','NFMICgui') %********************************************************************* % THE END %*********************************************************************