Code covered by the BSD License  

Highlights from
Traveling Wave Antenna Design

image thumbnail

Traveling Wave Antenna Design

by

 

A simple tool to design Traveling Wave Slot Antennas (GUI)

GUI()
function GUI()
%screenSize=get(0,'ScreenSize');

fhGUI=figure('PaperUnits','centimeters',...
'Position',[320 223 841 399],...
'Visible','on',...
'MenuBar','none',...
'Color',[0.925 0.914 0.847]);

set(fhGUI,'Name','Traveling Wave Antenna Design',...
'NumberTitle','off',...
'Resize','off',...
'Toolbar','none');

hPanelParameters = uipanel('Parent',fhGUI,...
'Title','Parameter Selection',...
'FontSize',8.0,...
'Units','characters',...
'Position',[2.6 19.923 162.8 10],...
'BackgroundColor',[0.925 0.914 0.847]);

hLoadButton = uicontrol('Style','pushbutton',... % Button for updating selected plot
                   'Parent', hPanelParameters,...
                   'Units','characters',...
                   'HandleVisibility','callback', ...
                   'Position',[2.4 5.864 24.8 1.692],...
                   'BackgroundColor',[0.925 0.914 0.847],...
                   'String','Load Parameter File',...
                   'Callback', @hLoadButtonCallback);
               
handles.paramFile = 'input10Ghz.m';               
handles.hText1 =uicontrol('Parent',hPanelParameters,...
'Style','text',...
'String',handles.paramFile,...
'FontSize',10.0,...
'FontWeight','normal',...
'Tag', 'Menu_Datei',...
'Units','characters',...
'HorizontalAlignment','left',...
'Position',[30.8, 5.846, 90.4, 1.692]);


handles.hStartButton = uicontrol('Style','pushbutton',... 
                   'Parent', hPanelParameters,...
                   'Units','characters',...
                   'HandleVisibility','callback', ...
                   'Position',[123 2 16 6],...
                   'BackgroundColor',[0.925 0.914 0.847],...
                   'String','Start',...
                   'Callback', @hStartButtonCallback); 
               
                              
 handles.hOptButton= uicontrol('Style','pushbutton',... 
                   'Parent', hPanelParameters,...
                   'Units','characters',...
                   'HandleVisibility','callback', ...
                   'Position',[142 2 16 6],...
                   'BackgroundColor',[0.925 0.914 0.847],...
                   'ForegroundColor',[0.502 0.502 0.502],...
                   'String','Optimizing',...
                   'Enable','inactive',...
                   'Callback', @hOptButtonCallback);
               
hText2 =uicontrol('Parent',hPanelParameters,...
'Style','text',...
'String','N:',...
'FontSize',10.0,...
'FontWeight','normal',...
'Units','characters',...
'HorizontalAlignment','left',...
'Position',[2.6, 1.93, 2.6, 1.385],...
'BackgroundColor',[0.925 0.914 0.847]);

hText3 =uicontrol('Parent',hPanelParameters,...
'Style','text',...
'String','SSL:',...
'FontSize',10.0,...
'FontWeight','normal',...
'Units','characters',...
'HorizontalAlignment','left',...
'Position',[16, 1.93, 6, 1.385],...
'BackgroundColor',[0.925 0.914 0.847]);


hText4 =uicontrol('Parent',hPanelParameters,...
'Style','text',...
'String','Type:',...
'FontSize',10.0,...
'FontWeight','normal',...
'Units','characters',...
'HorizontalAlignment','left',...
'Position',[31, 1.93, 6, 1.385],...
'BackgroundColor',[0.925 0.914 0.847]);


hText5 =uicontrol('Parent',hPanelParameters,...
'Style','text',...
'String','Type:',...
'FontSize',10.0,...
'FontWeight','normal',...
'Units','characters',...
'HorizontalAlignment','left',...
'Position',[31, 1.93, 6, 1.385],...
'BackgroundColor',[0.925 0.914 0.847]);


hText6 =uicontrol('Parent',hPanelParameters,...
'Style','text',...
'String','rP:',...
'FontSize',10.0,...
'FontWeight','normal',...
'Units','characters',...
'HorizontalAlignment','left',...
'Position',[56.4, 1.93, 5, 1.385],...
'BackgroundColor',[0.925 0.914 0.847]);

hText7 =uicontrol('Parent',hPanelParameters,...
'Style','text',...
'String','MC+:',...
'FontSize',10.0,...
'FontWeight','normal',...
'Units','characters',...
'HorizontalAlignment','left',...
'Position',[69.2, 1.93, 8, 1.385],...
'BackgroundColor',[0.925 0.914 0.847]);

hText8 =uicontrol('Parent',hPanelParameters,...
'Style','text',...
'String','MC-:',...
'FontSize',10.0,...
'FontWeight','normal',...
'Units','characters',...
'HorizontalAlignment','left',...
'Position',[88.4, 1.93, 8, 1.385],...
'BackgroundColor',[0.925 0.914 0.847]);

hText9 =uicontrol('Parent',hPanelParameters,...
'Style','text',...
'FontSize',12.0,...
'FontName','Symbol','string','a:',...
'FontWeight','normal',...
'HorizontalAlignment','left',...
'Units','characters',...
'Position',[107.5, 2.18, 16, 1.385],...
'BackgroundColor',[0.925 0.914 0.847]);

handles.N=8;
handles.hN=uicontrol('Style','popupmenu',... 
                   'Parent', hPanelParameters,...
                   'Units','characters',...
                   'HandleVisibility','callback', ...
                   'Position',[7.4 1.923 6.6 1.615],...
                   'BackgroundColor',[1 1 1],...
                   'ForegroundColor',[0 0 0],...
                   'String',{'4','6','8'},...
                   'Value',3,...
                   'Callback', @hNCallback);
 handles.SSL=-30;              
 handles.hSSL=uicontrol('Style','edit',... 
                   'Parent', hPanelParameters,...
                   'Units','characters',...
                   'HandleVisibility','callback', ...
                   'Position',[23.2 1.923 5.6 1.615],...
                   'BackgroundColor',[1 1 1],...
                   'ForegroundColor',[0 0 0],...
                   'String','-30',...
                   'Callback', @hSSLCallback);
handles.Type='tay';               
handles.hType=uicontrol('Style','popupmenu',... 
                   'Parent', hPanelParameters,...
                   'Units','characters',...
                   'HandleVisibility','callback', ...
                   'Position',[38.2 1.923 16.2 1.615],...
                   'BackgroundColor',[1 1 1],...
                   'ForegroundColor',[0 0 0],...
                   'String',{'taylor','chebychef','uniform'},...
                   'Value',1,...
                   'Callback', @hTypeCallback);    
 
 handles.rP=0.25;              
 handles.hrP=uicontrol('Style','edit',... 
                   'Parent', hPanelParameters,...
                   'Units','characters',...
                   'HandleVisibility','callback', ...
                   'Position',[61 1.923 5.6 1.615],...
                   'BackgroundColor',[1 1 1],...
                   'ForegroundColor',[0 0 0],...
                   'String','0.25',...
                   'Callback', @hrPCallback);

handles.MCp='yes';               
handles.hMCp=uicontrol('Style','popupmenu',... 
   'Parent', hPanelParameters,...
   'Units','characters',...
   'HandleVisibility','callback', ...
   'Position',[76.2 1.923 10.2 1.615],...
   'BackgroundColor',[1 1 1],...
   'ForegroundColor',[0 0 0],...
   'String',{'yes','no'},...
   'Value',1,...
   'Callback', @hMCpCallback);  

handles.MCn='yes';    
handles.hMCn=uicontrol('Style','popupmenu',... 
   'Parent', hPanelParameters,...
   'Units','characters',...
   'HandleVisibility','callback', ...
   'Position',[94.8 1.923 10.2 1.615],...
   'BackgroundColor',[1 1 1],...
   'ForegroundColor',[0 0 0],...
   'String',{'yes','no'},...
   'Value',1,...
   'Callback', @hMCnCallback);  

handles.loss=0.0916;
handles.halpha=uicontrol('Style','edit',... 
                   'Parent', hPanelParameters,...
                   'Units','characters',...
                   'HandleVisibility','callback', ...
                   'Position',[110.8 1.923 9.2 1.615],...
                   'BackgroundColor',[1 1 1],...
                   'ForegroundColor',[0 0 0],...
                   'String',' 0.0916',...
                   'Callback', @halphaCallback);
               
hPanelResults = uipanel('Parent',fhGUI,...
'Title','Results',...
'FontSize',8.0,...
'Units','characters',...
'Position',[2.6 0.615 162.8 19.3],...
'BackgroundColor',[0.925 0.914 0.847]);
%'Position',[2.6 0.615 162.8 19.3],...
hText10 =uicontrol('Parent',hPanelResults,...
'Style','text',...
'String','Initial Guess',...
'FontSize',8.0,...
'FontWeight','normal',...
'Units','characters',...
'HorizontalAlignment','center',...
'Position',[6.8, 15.61, 36.4, 1.692],...
'BackgroundColor',[0.925 0.914 0.847]);
               
 hText11 =uicontrol('Parent',hPanelResults,...
'Style','text',...
'String','Estimation of Radiation Pattern',...
'FontSize',8.0,...
'FontWeight','normal',...
'Units','characters',...
'HorizontalAlignment','center',...
'Position',[62.8, 15.61, 36.4, 1.692],...
'BackgroundColor',[0.925 0.914 0.847]);

 hText12 =uicontrol('Parent',hPanelResults,...
'Style','text',...
'String','Optimized',...
'FontSize',8.0,...
'FontWeight','normal',...
'Units','characters',...
'HorizontalAlignment','center',...
'Position',[114.8, 15.61, 36.4, 1.692],...
'BackgroundColor',[0.925 0.914 0.847]);

handles.hAxesInitialGuess1=axes('Parent',hPanelResults,...
'Tag','AxesInitialGuess1',...
'Units','characters',...
'Position',[5 9.9 45 5.6],...
'Box','on',...
'XTick',[],...
'XTickLabel','',...
'YTick',[],...
'YTickLabel','');
handles.hAxesInitialGuess2=axes('Parent',hPanelResults,...
'Tag','AxesInitialGuess2',...
'Units','characters',...
'Position',[5 2.9 45 5.6],...
'Box','on',...
'XTick',[],...
'XTickLabel','',...
'YTick',[],...
'YTickLabel','');


handles.hAxesRadPat=axes('Parent',hPanelResults,...
'Tag','AxesRadPat',...
'Units','characters',...
'Position',[56.6 2.9 50 12.6],...
'Box','on',...
'XTick',[],...
'XTickLabel','',...
'YTick',[],...
'YTickLabel','');

handles.hAxesOpt1=axes('Parent',hPanelResults,...
'Tag','AxesOpt1',...
'Units','characters',...
'Position',[111.6 9.9 45 5.6],...
'Box','on',...
'XTick',[],...
'XTickLabel','',...
'YTick',[],...
'YTickLabel','');
handles.hAxesOpt2=axes('Parent',hPanelResults,...
'Tag','AxesOpt2',...
'Units','characters',...
'Position',[111.6 2.9 45 5.6],...
'Box','on',...
'XTick',[],...
'XTickLabel','',...
'YTick',[],...
'YTickLabel','');
guidata(fhGUI,handles)
    
initialisiere;

function hStartButtonCallback(source,event)
    initialisiere;
    handles=guidata(source);
    tmp=calc_TWA_interpol(handles.paramFile,handles.N,handles.SSL,...
        handles.rP,handles.Type,handles.MCp,handles.MCn,handles.loss);
    if isstruct(tmp)    
        handles.l_init=l_initial;
       handles.dphifix=DPhifix;
       axes(handles.hAxesInitialGuess1);
       bar(abs(tmp.rad_pow),'FaceColor',[84/212 141/212 212/212]); 
       set(handles.hAxesInitialGuess1,'XLim',[0 N+1],...
           'YLim',[0 round(100*max(tmp.rad_pow))/100+.05],...
           'FontSize',8.0);
       annotation('textbox', [.13 .43, .1, .1], 'String', 'rad. power',...
            'EdgeColor','none', 'FontSize', 8.0);
       hold on;
       plot(w,'sm','LineWidth',2,...
                    'MarkerEdgeColor',[1 1 1],...
                    'MarkerSize',5,...
                    'Marker','square',...
                    'LineWidth',1,...
                    'LineStyle','none',...
                    'MarkerFaceColor',[0 0 0],...
                    'Color',[1 0 1]);
        hold off;

        axes(handles.hAxesInitialGuess2);
        bar(tmp.rad_ang,'FaceColor',[84/212 141/212 212/212]); 
        set(handles.hAxesInitialGuess2,'xlim',[0 N+1],...
            'ylim',([min(tmp.rad_ang)-10 max(tmp.rad_ang)+10]),...
           'FontSize',8.0);
        hold on;
        plot(repet(N,mean(tmp.rad_ang)),'xm','LineWidth',2,...
                            'MarkerEdgeColor',[0 0 0],...
                            'MarkerSize',4,...
                            'Marker','square',...
                            'LineWidth',1,...
                            'LineStyle','none',...
                            'MarkerFaceColor',[0 0 0],...
                            'Color',[1 0 1]);
        annotation('textbox', [.13 .2, .1, .1], 'String', 'rad. phase',...
            'EdgeColor','none', 'FontSize', 8.0);          
        hold off;
        
        axes(handles.hAxesRadPat);
        hold on;
        plot(angD(1:(end-1)/2),a(1:end/2),'r');
        plot(angD(1:(end-1)/2),b(1:end/2),':r');
        set(handles.hAxesRadPat,'xlim',[0 90],...
            'ylim', [-50 0],'FontSize',8.0,...
            'YTick',-50:5:0,...
            'XTick',0:10:90,...
            'YTickLabel',num2str((-50:5:0)'),...
            'XTickLabel',num2str((0:10:90)'));
        legend(handles.hAxesRadPat,'fft(|P_n|) INITIAL','fft(|P_n|*exp(j*phi(P_n))) INITIAL');
        set(handles.hOptButton,...
               'Enable','on',...
               'ForegroundColor',[0 0 0]);
        guidata(source,handles)
    else
        %do nothing
    end
        
        
 function hOptButtonCallback(source,event)
     initialisiere;
     handles=guidata(source);
       tmp= optimize(handles.l_init,handles.dphifix);
        axes(handles.hAxesOpt1);
       %plot(handles.hAxesInitialGuess1);
       bar(abs(tmp.rad_pow),'FaceColor',[84/212 141/212 212/212]); 
       set(handles.hAxesOpt1,'XLim',[0 N+1],...
           'YLim',[0 round(100*max(tmp.rad_pow))/100+.05],...
           'FontSize',8.0);
       %title(handles.hAxesInitialGuess1,'rad. power')
        annotation('textbox', [.75 .43, .1, .1], 'String', 'rad. power',...
            'EdgeColor','none', 'FontSize', 8.0);
       hold on;
       plot(w,'sm','LineWidth',2,...
                    'MarkerEdgeColor',[1 1 1],...
                    'MarkerSize',5,...
                    'Marker','square',...
                    'LineWidth',1,...
                    'LineStyle','none',...
                    'MarkerFaceColor',[0 0 0],...
                    'Color',[1 0 1]);
        hold off;

        axes(handles.hAxesOpt2);
        bar(tmp.rad_ang,'FaceColor',[84/212 141/212 212/212]); 
        set(handles.hAxesOpt2,'xlim',[0 N+1],...
            'ylim',([min(tmp.rad_ang)-10 max(tmp.rad_ang)+10]),...
           'FontSize',8.0);
        hold on;
        plot(repet(N,mean(tmp.rad_ang)),'xm','LineWidth',2,...
                            'MarkerEdgeColor',[0 0 0],...
                            'MarkerSize',4,...
                            'Marker','square',...
                            'LineWidth',1,...
                            'LineStyle','none',...
                            'MarkerFaceColor',[0 0 0],...
                            'Color',[1 0 1]);
        annotation('textbox', [.75 .2, .1, .1], 'String', 'rad. phase',...
            'EdgeColor','none', 'FontSize', 8.0);          
        hold off;
        
        axes(handles.hAxesRadPat);
        hold on;
         plot(angD(1:(end-1)/2),a(1:end/2),'color',[84/212 141/212 212/212]);
       plot(angD(1:(end-1)/2),b(1:end/2),':','color',[84/212 141/212 212/212],'LineWidth',2); 
        set(handles.hAxesRadPat,'xlim',[0 90],...
            'ylim', [-50 0],'FontSize',8.0,...
            'YTick',-50:5:0,...
            'XTick',0:10:90,...
            'YTickLabel',num2str((-50:5:0)'),...
            'XTickLabel',num2str((0:10:90)'));
        legend('fft(|P_n|) INITIAL','fft(|P_n|*exp(j*phi(P_n))) INITIAL','fft(|P_n|) OPTIM','fft(|P_n|*exp(j*phi(P_n))) OPTIM');
        set(handles.hOptButton,...
               'Enable','on',...
               'ForegroundColor',[0 0 0]);
           
     function hLoadButtonCallback(source,event)
         handles=guidata(source);
         [FileName,PathName,FilterIndex]=uigetfile('*.m');
         if FileName~=0
             set(handles.hText1,'String',[PathName,FileName]);
         else
             %do nothing
         end
         handles.paramFile=[PathName,FileName];
         guidata(source,handles)
         
         
      function hNCallback(source,event)
          handles=guidata(source);
          str=get(handles.hN,'String');
          val=get(handles.hN,'Value');
          handles.N=str2double(str(val));
          guidata(source,handles)
          
          
      function hSSLCallback(source,event)
          handles=guidata(source);
          handles.SSL=str2double(get(handles.hSSL,'String'));
           guidata(source,handles);
           
      function hTypeCallback(source,event)   
         handles=guidata(source);
          switch get(handles.hType,'Value')
              case 1
                  handles.Type='tay';
              case 2
                  handles.Type='cheb';
              case 3
                  handles.Type='uni';
          end
          guidata(source,handles)
          
      function hrPCallback(source,event)   
          handles=guidata(source);
          handles.rP=str2double(get(handles.hrP,'String'));
          guidata(source,handles);
          
      function hMCpCallback(source,event)   
          handles=guidata(source);
          str=get(handles.hMCp,'String');
          val=get(handles.hMCp,'Value');
          handles.MCp=str(val);
          guidata(source,handles)
          
      function hMCnCallback(source,event)   
          handles=guidata(source);
          str=get(handles.hMCn,'String');
          val=get(handles.hMCn,'Value');
          handles.MCn=str(val);
          guidata(source,handles)
          
      function halphaCallback(source,event)   
          handles=guidata(source);
          handles.loss=str2double(get(handles.halpha,'String'));
          guidata(source,handles);

Contact us