A toolbox allowing rapid definition and evaluation of 2D and 3D phased array antennas.
This is the abstract from my paper, included as documentation, in the zip file.
Paper Titled : Phased Array Design Toolbox for MATLAB Theory of Operation
ABSTRACT
In recent years the advances in computer technology has led to increasing use of numerical techniques in the design and development of antennas and related technology. Of particular prevalence are full wave microwave solvers, used to obtain the current densities on and thereby radiated fields for arbitrary structures. However, despite the increases in computer power, array antennas can be electrically very large and therefore still represent a significant analysis problem. As the number of elements in the antenna array increases, its radiated characteristics tend to be dominated by the geometric layout and excitation of the component elements, rather than the elements themselves.
Using simple mathematical models for the element radiation patterns, combined geometrically in the far field, the performance of large arrays can be calculated with reasonable accuracy for significantly less computational effort. A Matlab toolbox has been developed to enable rapid definition and analysis of 2D and 3D antenna arrays, comprising array elements such as dipole, microstrip patch, helix or any user defined element pattern function. This paper documents the theory used in the toolbox.
2.5  References to 'bessel' functions in the taywin_array and related functions changed to besselj. Older versions of Matlab assume bessel is 1st order by default, so didn't flag an error. 

2.5  References to 'bessel' functions in the taywin_array and related functions changed to besselj. Older versions of Matlab assume bessel is 1st order by default, so didn't flag an error. 

1.24  Correction to the exspinlin2.m example and the cpol_array.m help info. The cpol_array parameters for generating RHCP/LCHP changed when the phase lead/lag definition was changed for v2.5. The code itself hasn't altered. 

1.23  Had a few connection problems today, uploaded again to be sure. 

1.22  A few minor typo's corrected, mainly in the help text of the examples, no changes to the code itself. 

1.21  Uploaded without toolbox option checked, hopefully to remove the 'required products' that appeared in the previous upload. 

1.20  Just noticed there were lots of extra required products listed, I didn't add them, still just Matlab itself. 

1.19  In this update, nearfield analysis and calculation of absolute values for gain and radiated field quantities have been added. See the : ‘Change Log’, ‘FAQ’ and ‘What’s new in ArrayCalc v2.5’ in the documentation folder for details. 

1.18  I found a problem with statistical variation functions plot_theta_statvar and plot_phi_statvar. The random errors were not being applied to all array elements. Apologies for any confusion / inconvenience caused. 

1.15  All filenames have been changed to lower case, hopefully improving compatibility with later versions of Matlab. There is also additional information on phased array and phase shifter design, as I get many questions on this. 

1.12  A couple of minor changes to the interp_geom.m file. Some subarray and reflector modelling examples added 

1.11  Some new functions added to combine 3D array geometry and 3D patterns on the same plot.


1.10  Couple of typo's in help files corrected. 

1.9  Comments and help added to and tidied up.


1.8  Help and comments added to and minor corrections made.


1.7  Very minor, place_element.m was reporting angle rather than position in the text commentary to screen (Placing element number... etc). No effect on calculations. 

1.6  3D Pattern routines rewritten, functionally the same but hopefully easier to follow and a bit more robust.see changelog.txt for details. More examples added illustrating different applications and limits of operation. 

1.5  General tidying and corrections of help files and comments, rather a lot actually, so apologies for that. Element excitation error analysis added, see changelog.txt 

1.2  Circular Polarization analysis added.
Version1.1 is still available at activefrance.com 

1.1  Some minor corrections, mainly typos in comment/help files. 
Syed Akbar (view profile)
@Otis
Thank you very much for your suggestion. It worked.
Pawel (view profile)
Fantastic. Thank you.
Otis (view profile)
@Syed Akbar
"Error using str2num (line 32)
Requires string or character array input."
Change str2num(h) to str2double(h) to fix it.
applies to Matlab R2014 and later
Will Zhu (view profile)
Sricharan Chadram (view profile)
Hi!
This is Sricharan. I have designed a phased array antenna using Matlab's Phased array tool box and I have few doubts regarding the same.
1) While simulating an 8X8 array with uniform distrubition, the values obtained for SLL and Power were matching to that of theoritical calculations (say 13dB SLL etc.,).
But, when i make the array larger (say roughly 5000+ elements), my SLL is going down to '18dB' with the same uniform excitation. Is it a limitation of Toolbox (or) that is the closest value to practical observation? Please explain.
2) I have tried applying Taylor tapering(windowing) to my larger array discussed in the previous problem. Here, I couldn't notice any difference in the max power obtained at the boresight with changing order(nbar) of the taylor window. But, there should be a slight variation as per the theory. Could someone please explain?
Ahad Sheikh (view profile)
Berker (view profile)
Awesome!!!!
Syed Akbar (view profile)
Hi, I am running MATLAB R2015b on Windows 10. I am getting the following error when I run of of the examples:
Error using str2num (line 32)
Requires string or character array input.
Error in plot_geopat3d (line 284)
set(colorbar,'yticklabel',str2num(h)dBrange_config);
Error in Lband2x2round (line 41)
plot_geopat3d(2,5,'tot','yes','surf',1.8); % Plot a 3D directivity pattern using 5/10 deg theta/phi
steps
It appears there is an issue with the set command set(colorbar,'yticklabel',str2num(h)dBrange_config) however, i can't seem to find a solution. Please help.
Syed Akbar
GUENAD (view profile)
Neill Tucker (view profile)
Hi there,
Thank you to everyone who has downloaded the toolbox and for the kind words I have received in private emails. It seems my little sabbatical in France has come to an end for the moment.
I am happy to continue answering questions regarding the toolbox but now need to also find some paid employment in the field, so any help/contacts in that department would be greatly appreciated.
Kind regards,
Neill
email : neilltucker@hotmail.com
Other addresses will still find me for the moment. I will update the documentation when I get a chance.
thuan (view profile)
Neill Tucker (view profile)
Hello everyone,
I hope you are enjoying ArrayCalc v2.5. I also hope, no news is good news and there aren't too many problems. If you do have problems or find mistakes, typo's etc, do drop me an email at activefrance@orange.fr
Kind regards,
Neill
Neill Tucker (view profile)
Dear Philip,
ArrayCalc as it stands isn't really organised to use multiple interpolated element patterns (as in different patterns for each element). However, I might be able to modify the code to do what you need.
If you are able to send me the data that you are wanting to array and your required array configuration, I'll see what I can sort out.
Kind regards,
Neill.
active.france@wanadoo.fr
Philip (view profile)
Dear Neill,
I wish to import a custom pattern data from a phased array antenna. I have three separate pattern data from three measured ports. Was hoping to find some help on how to mathematically combine the patterns as though it were a 3x1 element design. I've tried to ex3c but not getting the results I require.
Thank you
Neill Tucker (view profile)
Required products issue corrected. However, please look at the readme.txt file in the ArrayCalc root directory.
Kind regards,
Neill
Neill Tucker (view profile)
!!! REQUIRED PRODUCTS !!!
Just MATLAB as before, I didn't add them to the list, I can't seem to delete them.
Kind regards,
Neill
Gary (view profile)
I'm having casesensitivity issues too:
Cannot find an exact (casesensitive) match for 'plot_geom3D'
The closest match is: plot_geom3d in C:\MATLAB\ArrayCalc\Plotting_visualisation\plot_geom3d.m
Error in ex1 (line 25)
plot_geom3D(1,0); % Plot 3D geometry with axis
Jenny (view profile)
Neill Tucker (view profile)
Dear Ramesh,
Hopefully you got my email reply and everything is working now.
For general information, the most likely cause of this error is that not all the ArrayCalc sub directories have been added to the Matlab search path.
I hope this helps,
Neill
Ramesh Patel (view profile)
Dear Neill
when i run any example like Ex1 im getting the following error
??? Undefined function or method 'design_patchr' for input arguments of type 'double'.
Error in ==> Ex1 at 21
patchr_config=design_patchr(3.43,1.6e3,freq_config);
in every example and for validation it gives the same error unidentified function or method of input arguments... though i m trying my level best but can't solve thing problem
regards
reza (view profile)
what install toolbox
Neill Tucker (view profile)
I found a problem with statistical variation functions plot_theta_statvar and plot_phi_statvar. The random errors were not being applied to all array elements; note these functions do not affect other calculations. I think a line of code got moved during testing and I forgot to put it back. Apologies for any confusion / inconvenience caused.
The corrections are included in an update v2.4.2, however this is pending approval by an administrator.
If you are wanting to use the statistical variation functions you can download v2.4.2 here :
http://www.activefrance.com/Antennas/page22.html
Neill Tucker (view profile)
Dear David,
Thank you for your comments.
Regarding the case sensitivity, I have submitted V2.4.1 with all filenames in lower case but so far it has not appeared on the exchange site. I will have another go today since it does seem to be causing problems on later versions of Matlab.
Regarding the pattern1.mat data, this should be generated from the raw NEC2 data by the previous function :
loadnecpat1('dipole'); on line 20
It could be that Matlab is not able to find the raw data or the format of the .mat files has changed. I've sent you an email with the file attached anyway.
I only have Matlab V6 so it is very hard to track down errors on later versions.
However, do let me know if you have any other problems.
Kind regards,
Neill
David (view profile)
I did see that program loadnecpat can be used to generate the named file pattern1.mat externally from execution of example program Ex3a. If this is operator error on my part  sorry to have added a comment with out fully investigating the issue.
Dave
David (view profile)
September 06, 2013. I downloaded this package today and began experimentation . The issues of function name case sensitivity have already been reported and these should not be a major issue for anyone to correct.
When attempting to execute example progrm Ex3A I obtain an error atthe load statement (line23). The program is looking for file pattern1.mat which does not appear in the download file package. Can this file be provided ?
Jake (view profile)
Hey Neill,
I'm not sure why but after I downloaded and moved the files to my MATLAB directory, many of the function names are capitalized such as "INIT.M", so when trying to run the toolbox MatLab cannot find the files. Also when I run functions such as place_element, there are errors (in this case it appears line 119).
Excited to use it though!
Jake
Pourya Alinezhad (view profile)
Neill Tucker (view profile)
Hi Changshun,
The change in coordinate system for the rectangular patch is only a transposition of axes : x>Z, y>X and z>Y where x,y,z are the original model and X,Y,Z are those used by ArrayCalc. This means that the same formulas can be used as long as the axes are transposed before the formulas are applied. (Ref patchr.m lines 3238 in the element models directory).
The reason for the transposition is to ensure the Patch's Efield is aligned with ArrayCalc's Xaxis. (See section 4.2 the Theory of operation for why this convention is used).
I hope this helps,
Neill
Changshun Deng (view profile)
Hi,Neill,
I find your coordinate system definition of the rectangular patch antenna is different from the Balanis's Antenna Theory(Page 743, Figure 14.15), but the formulas are the same(Page 745, formula 1445/1446). Can you give some help about this? Thank you.
Neill Tucker (view profile)
Hi Paul,
Sorry I haven't got back to you sooner, I've emailed you directly to clarify exactly what type of acoustic array. Drop me an email if you are still needing the information, I do have some acoustic array examples.
Kind regards,
Neill
Paul (view profile)
Hello,
Although I have been using arrays for a long time, I have not had to design one until now. However, I want to design an acoustic array, not one for radio, and I need to look at the receiver pattern, not the transmission pattern. What do I need to change in order to do this?
Thanks!
Changshun Deng (view profile)
A nice array design tool, but it is a little hard to use.
Chandrakumar (view profile)
Chandrakumar (view profile)
thank you very much neil, i shall be emailing you if am stuck. thanks again
best regards,
chandra
Neill Tucker (view profile)
Dear Chandra,
I'll email you directly as the answer might be a little long for this forum.
Kind regards,
Neill
Chandrakumar (view profile)
dear neil, am a student from the university of mauritius am am doing a project on EMF safety . my project consist of simulatinf a base station putting all the building around the base station and applying ray tracing method to calculate where the field could be higher than the level allowed by standard..i dont know how to start,can you please help me about how to proceed to input the environment, the antenna characteristic and how to apply ray tracing method in matlab..
i shall be highly obliged to you if you can help me.. thank you
Neill Tucker (view profile)
For anyone interested in comparisons with practical measurements, this page maybe of interest.
http://www.activefrance.com/Antennas/page27.html
Neill
Neill Tucker (view profile)
Dear Sam,
It looks like you might have run the rect_array.m file without running init.m first. Rect_array.m fills the array_config matrix and this is initialised in init.m. Check out the example ex2a for a typical application.
Hope this helps,
Neill
Sam Hamie (view profile)
hello
I'm trying to run the rectarray file and I'm unable to! I set the path of the folder and I'm getting the following error :
"Error in ==> rect_array at 67 if array_config(1,1,1)==1 % If there are no existing elements"
I'm not sure how to solve this problem! I tried to run this and I got another problem!
Please advice,
Thanks
Sam
Neill Tucker (view profile)
Ooops, interp1.m is already used in Matlab's polyfun mfiles. For interp1.m read interpL.m in the last comment.
Neill
Neill Tucker (view profile)
Thank you Binkai and Farah for your kind comments.
After some nonforum correspondence it looks like the problem maybe due to a duplication of the interp.m function.
The interp.m function exists in the Mathworks Signal Processing Toolbox, included as standard on later versions of Matlab.
This problem should be corrected by renaming ArrayCalc's interp.m function as interp1.m (element_models directory). Also by changing the reference to interp in SUMCODE.m LINE 33 to interp1 (element_indexing directory).
If this proves to be the solution I will upload the modifications.
Neill
Farah (view profile)
Hi,
Thank you for this great toolbox Neill.
I am trying to model the phased array using some of sub arrays. I tried to us the Ex3b file as an example and i also face the same problem as the user above (Binkai). Could you help explain what should be done in order to rectify the situation above?
Best,
Farah
Neill Tucker (view profile)
Hello Binkai,
I just found your question.
Is the problem with the original Ex3b file or is it modified in any way?
Is it possible to email me the file that you are trying to run and i will have a look on my machine?
Kind regards,
Neill
active.france@wanadoo.fr
Binkai (view profile)
Hi all,
I am a starter for Phased array calculation, having this toolbox is much convenient and useful for my study.
Recently, I want to import a NEC output pattern for the calculation and I tried the example named 'Ex3b.m' in the 'Examples' folder. And I found it will raise a error while executing the statements as:
place_element(1,0,0,0,0,0,0,'interp',0,0); yrot_array(35,1,1); calc_directivity(10,10);
Then error message from Matlab commander as follows:
Calculating Directivity : d(Th)=10.00 d(Phi)=10.00
 
...??? Error using ==> interp at 37
Input parameters are out of range.
Error in ==> SUMCODE at 33
case 11,[EleAmp,CPflag]=interp(thloc,philoc);
Error in ==> fieldsum at 100
[EleAmp,CPflag]=sumcode(eltype,thloc,philoc); % Sumcode calls the relevant
element model 'eltype'
Error in ==> calc_directivity at 67
Emultiple=fieldsum(range_config,theta,phi); % E(theta,phi)
Error in ==> Test_Ex3b at 1339
calc_directivity(10,10); % Calc directivity using 10deg
theta and phi steps

If I changed 'interp' to 'user1' or 'patchr' something in function 'place element', the program running successfully without errors.
Therefore, I doubted that there are some mistakes using "interp" function when calculating the directivity. My matlab version is Matlab r2009a (V7.8). Could you comment it and give me some advices about how to solve the problem?
Thank you so much for your kindest attention and help.
Regards,
Binkai
Neill Tucker (view profile)
I found a typo in the plot_geopat3D1 function.
Line 229 is :
set(14,'name',chartname)
Should be : set(fignum,'name',chartname)
Sorry about that,
Neill
Neill Tucker (view profile)
Hi there,
All good questions and some have already crossed my mind.
1. Mutual coupling could be added in a very simplified form by suitably modifying the element excitations. Basically take the 'desired excitation' for each element then add vectorially, an attenuated and phase delayed copy of the excitation to each of its surrounding neighbours. The coupling factor between local elements could be obtained from, a full wave solver, measured, or from empirical data.
I may try to implement some sort of coupling calculation as a specific example but probably not as universal functionality. For some geometrys there may be some benefit, for others it could be rather misleading.
2. The only way I can think of is to use additional low power array elements located at the ground plane edge to represent the diffracted radiation. Deciding exactly what amplitude and phase they should be is a bit more difficult. Have a look at the 'Introduction to Phased Array Design' section on my website, there is a 4NEC2 model of a 6x1 element array on a finite groundplane. Running the 'Array 6ele a.nec' in the Intro Files download you can see edge currents on the groundplane (phase and amplitude).
3. It would certainly be nice to be able to generate script files for HFSS and the like. Unfortunately, fullwave solvers like HFSS need a fair bit more information than is inherent in the ArrayCalc array description. I think there is certainly scope for an automated script generator for fullwave solvers, and ArrayCalc could be a 'start'. My feeling is that it would be better to develop a separate toolbox dedicated to the task. The various arrayconfiguration variables could easily be shared since they are already defined as global.
Overall I feel that ArrayCalc does what it does quite well. The risk of trying to extend it into fullwave solver territory is that you end up caught somewhere between the two, adding lots of complexity for possibly limited benefit.
That said, there is definitely a gap to be filled, you may just have found yourself a project :)
Neill
hai (view profile)
This looks a good start.
1. Any plan to add the calculation of the mutual coupling within the array? Even a simplified calculation can help
2. Is there a way to calculate the dipole array on a finite reflector instead of the infinite ground?
3. Possibility to output the array model to any fullwave analysis software, like HFSS, CST MWStudio?
Neill Tucker (view profile)
Hi all,
Anyone using the ModTaylor.m function.
The function is returning dB volts not dB power as advertised, the last line of the function should read : dB_POWER=20.*log10(Lin_Volts) not dB_POWER=10.*log10(Lin_Volts);
The dB returned value is only for information (ref exdist.m) and doesn't affect the pattern calculations. It will be corrected in the next update. Thanks to Piro for spotting this typo error.
Also, if you are running later versions of Matlab and are getting lots of warnings, try the 'warning off' command to reduce screen clutter.
Neill
Neill Tucker (view profile)
Hi there,
Just a quick note for anyone planning to build a Phase Array, but on a tight budget. I have put a design for a "Very Low Cost Electromechanical Phase Shifter" on the activefrance.com website. It has been tested up to 3Ghz and uses an R/C servo driven directly from a PC's parallel port. The full report and PC software is available for download. Happy constructing.
Neill
Neill Tucker (view profile)
Dear Spandana,
If the toolbox has installed successfully you should be able to run the examples (type 'exlist' to list them all). The example ex1 is for a single rectangular microstrip patch. The example produces a nominal patch design for a given frequency and substrate definition and then calculates/plots directivity and patterns. A complete description of the mathematical model used can be found in the ArrayCalc10d.pdf document under 'Element Mathematical Models'. I hope this helps, but if not, do drop me an email and I'll do my best to get you up and running.
Kind Regards,
Neill
spandana spandana (view profile)
Dear Neill,
I am not able to understand as to how to go with the Matlab toolbox.I need to design the radiation pattern and other characteristics of microstrip rectangular patch antenna using matlab coding. please help me out in this regard.
regards
Spandana
spandana spandana (view profile)
Can you please help me with the design of phased array antenna characteristics?
Sanjay (view profile)
Does this toolbox work with matlab version 7
Bill (view profile)
Outstanding resource! Very simple to use if documentation is read completely beforehand.
Neill Tucker (view profile)
Dear Dan,
Sorry to hear that you have had problems installing the toolbox. The problem as an author is that the exact method of adding paths does appear to vary between Matlab versions.
Thank you for the explanation on the method for 2007b, on my 5.2 version it is necessary to add each folder individually.
Kind Regards,
Neill
Dan Kong (view profile)
I spent three days setting up this toolbox. You should really specify how to install it for the people who do not know how to use matlab.
Brief explanation for antenna experts without practice of matlab: After setting a path (File>Set Path), click on Add with Subfolders (not just 'Add Folder'!!!) and then you can play with all examples
Dan Kong (view profile)
Hi everybody! Does anybody know why I can't add this Toolbox to the Toolboxes in my Matlab? I'm using 2007b version and I'm not sure if i'm doing it properly.
Shoaib Amin (view profile)
Dear Neill
thank for ur help , i think i haven;t set all the path to the directory n thank for the help if i faced a problem i'll contact u again
Regards
Shoaib
Neill Tucker (view profile)
Dear Shoaib,
My first question would be to other users : Has anyone else found this problem and the solution to it?
I'm assuming it is not a common problem or the comments list would probably be longer. The only things I can think of are :
Are the MATLAB paths set to all the relevant ArrayCalc subdirectories? Listed in readme.txt in the download.
If you type "help design_patchr" for example does the relevant help file come up? i.e. can MATLAB find the functions.
If these are OK, what version of MATLAB are you running and on what platform?
Sorry not to be of more help at the moment.
Kind Regards,
Neill
Shoaib Amin (view profile)
Dear Neill
when i run any example like Ex1 im getting the following error
??? Undefined function or method 'design_patchr' for input arguments of type 'double'.
Error in ==> Ex1 at 21
patchr_config=design_patchr(3.43,1.6e3,freq_config);
in every example and for validation it gives the same error unidentified function or method of input arguments... though i m trying my level best but can't solve thing problem
regards
shoaib
Neill Tucker (view profile)
Dear Shoaib,
No problem, could you be a bit more specific as to the problem?
If it requires a lot of explaining it might be easier via email
Kind regards,
Neill
Shoaib Amin (view profile)
Dear Neill
I am not able to work with the tool box kindly help me out
Regards
Shoaib
Mike (view profile)
Seems pretty cool. Cool website too.
Rebecca Asher (view profile)
Neill Tucker (view profile)
Dear Tomas,
What is it you are you are trying to do with the Toolbox?
I may be able to help.
Kind Regards,
Neill
P.S. I have put a document 'Introduction to Phased Array Design'
on my website, this may be of interest see link below
http://www.activefrance.com/Antennas/page23.html
Tomas (view profile)
HELP, I really dont know, how to start?
Diego Barragán (view profile)