# numSummationTerms

Change number of summation terms for calculating periodic Green's function

## Syntax

``numSummationTerms(array,num)``

## Description

example

````numSummationTerms(array,num)` changes the number of summation terms used to calculate periodic Green's function of the infinite array. This method calculates $2*num+1$ of the periodic Green's function. The summation is carried out from –`num` to +`num`. A higher number of terms results in better accuracy but increases the overall computation time.```

## Input Arguments

expand all

Infinite array, specified as a scalar handle.

Number to calculate summation terms, specified as a scalar. The summation is carried out from –`num` to +`num`.

Example: `50`

## Examples

expand all

Create an infinite array with the scan elevation at 45 degrees. Calculate the scan impedance. By default, the number of summation terms used is 21.

```h = infiniteArray('ScanElevation',45); s = impedance(h,1e9)```
```s = 84.7561 + 70.6470i ```

Change the number of summation terms to 51. Calculate the scan impedance again.

```numSummationTerms(h,25) s = impedance(h,1e9)```
```s = 84.9012 + 70.6791i ```

Change the number of terms to 101. Increasing the number of summation terms results in a more accurate scan impedance. However, the time required to calculate the scan impedance increases.

```numSummationTerms(h,50) s = impedance(h,1e9)```
```s = 84.9451 + 70.6839i ```