# current

Calculate and plot current distribution

Since R2021b

## Syntax

``current(rfpcbobject,frequency)``
``i = current(rfpcbobject,frequency)``
``[i,p] = current(rfpcbobject,frequency)``
``current(rfpcbobject,frequency,'dielectric')``
``i = current(rfpcbobject,frequency,'dielectric')``
``i = current(___,Name=Value)``

## Description

example

````current(rfpcbobject,frequency)` calculates and plots the absolute value of the current on the metal surface of a PCB component at the specified frequency.```
````i = current(rfpcbobject,frequency)` calculates the x, y, z components of the current on the surface of a PCB component at a specified frequencies.```

example

````[i,p] = current(rfpcbobject,frequency)` returns the current distribution and the points at which the current calculation was performed.```
````current(rfpcbobject,frequency,'dielectric')` calculates and plots the absolute value of the current at the specified frequency on the dielectric surface of the PCB component.```
````i = current(rfpcbobject,frequency,'dielectric')` calculates the x, y, z components of the current on the dielectric surface of a PCB component at the specified frequency.```
````i = current(___,Name=Value)` calculates the current on the surface of a PCB component using additional name-value arguments.```

## Examples

collapse all

Create a rat-race coupler with default properties.

`coupler = couplerRatrace;`

Set the excitation voltage and the phase angle at the ports of the coupler.

`v = voltagePort(4)`
```v = voltagePort with properties: NumPorts: 4 FeedVoltage: [1 0 0 0] FeedPhase: [0 0 0 0] PortImpedance: 50 ```
`v.FeedVoltage = [1 0 1 0]`
```v = voltagePort with properties: NumPorts: 4 FeedVoltage: [1 0 1 0] FeedPhase: [0 0 0 0] PortImpedance: 50 ```
`v.FeedPhase = [90 0 270 0]`
```v = voltagePort with properties: NumPorts: 4 FeedVoltage: [1 0 1 0] FeedPhase: [90 0 270 0] PortImpedance: 50 ```

Calculate and plot the current on the coupler at 3 GHz.

```figure current(coupler,3e9,Excitation=v,Type='real',Direction='on')```

Create a default spiral inductor.

```inductor = spiralInductor; show(inductor)```

Calculate the current distribution on the inductor at 600 MHz.

`[i,p] = current(inductor,600e6)`
```i = 3×242 complex -1.6263 + 2.5091i -1.2454 + 1.9557i -0.8511 + 1.2104i -0.0006 + 0.0042i 0.0003 - 0.0037i -1.4821 + 2.2635i 1.5863 - 2.2708i 0.0906 - 0.6362i 2.1560 - 3.1484i 0.1597 - 0.2321i 11.2801 -15.9325i -0.0009 + 0.0044i -0.2839 + 0.5619i 2.3424 - 3.6559i 0.8473 - 1.3361i 2.3399 - 3.6420i 0.3583 - 0.6863i 1.5552 - 2.4196i 2.8592 - 4.2518i 0.0031 - 0.0164i 1.2924 - 2.1667i 1.2975 - 2.2022i 2.6333 - 4.1070i 1.1172 - 1.6814i 0.1394 - 0.3047i 4.4008 - 7.4972i 3.3476 - 5.6252i 1.1478 - 1.8377i 0.8470 - 1.3331i 0.0340 - 0.1494i 0.0900 - 0.2389i -1.4640 + 2.1282i 1.5884 - 2.1096i 2.1040 - 3.3379i 1.0675 - 1.6709i 3.2504 - 5.5415i 2.6217 - 4.3544i 1.4400 - 2.3070i 1.0575 - 1.6683i 0.1212 - 0.2779i 0.0737 - 0.2005i -1.7437 + 2.8541i 0.2355 - 0.3606i -1.0731 + 1.5705i 0.2425 - 0.1428i -2.0320 + 3.2525i 2.0999 - 3.3386i 0.3799 - 0.6772i 1.4762 - 2.3271i 2.0056 - 3.2258i -0.0002 + 0.0029i 0.0452 - 0.0582i 0.2505 - 0.4382i 0.8328 - 1.2515i -1.0591 + 1.6970i 0.4252 - 0.5933i -1.6843 + 2.5227i 0.3353 - 0.4223i 0.9815 - 1.2139i -0.2648 + 0.5920i 0.3349 - 0.4196i 1.4791 - 2.3617i 0.8626 - 1.1649i -0.8674 + 1.3159i -0.2839 + 0.4722i -0.2866 + 0.4876i 0.4941 - 0.7138i 0.4952 - 0.7188i 0.0008 - 0.0037i -0.5581 + 0.8178i -0.5573 + 0.8128i 0.4591 - 0.6918i 0.4596 - 0.6952i 0.2075 - 0.2963i 2.9555 - 4.5110i 1.9902 - 3.1514i 3.0447 - 5.0178i 3.0462 - 5.0089i 1.5421 - 2.4691i 1.9876 - 3.1653i 1.5954 - 2.5598i 1.5385 - 1.9809i -1.5138 + 2.2535i 0.2663 - 0.3813i -0.7706 + 1.2683i 1.9594 - 3.1238i 2.5896 - 4.3083i 2.5920 - 4.3038i 1.4460 - 2.3758i 1.7155 - 2.7549i 1.9565 - 3.1306i 0.0747 - 0.0745i -2.3952 + 3.8383i 0.2182 - 0.0322i -1.0975 + 1.6764i 0.0381 - 0.0261i 0.2798 - 0.4145i -1.4438 + 2.2383i 1.0929 - 1.8222i 1.7924 - 3.1298i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i ```
```p = 3×242 -0.0006 0.0009 0.0022 0.0025 -0.0025 -0.0023 -0.0022 -0.0016 -0.0023 -0.0023 -0.0019 0.0025 0.0023 0.0023 0.0018 0.0019 0.0016 0.0012 0 -0.0019 -0.0009 0.0006 0.0011 -0.0002 0.0016 0.0017 0.0016 0.0016 0.0017 0.0016 0.0017 -0.0016 -0.0015 -0.0007 -0.0016 0.0012 0.0011 0.0011 0.0012 0.0012 0.0011 0.0004 -0.0012 -0.0011 -0.0010 -0.0003 -0.0005 -0.0011 0.0007 0.0006 0.0026 0.0024 0.0024 0.0017 0.0009 0.0024 0.0024 -0.0019 -0.0017 -0.0005 -0.0021 -0.0017 -0.0008 -0.0024 -0.0014 -0.0021 -0.0024 -0.0022 -0.0026 -0.0024 -0.0022 -0.0021 -0.0019 -0.0018 -0.0018 -0.0001 -0.0002 -0.0007 -0.0012 0.0006 0.0012 0.0018 0.0018 -0.0014 -0.0012 -0.0001 -0.0002 -0.0005 -0.0009 0.0009 0.0004 0.0013 0.0005 0.0012 0.0013 0.0014 -0.0009 -0.0008 -0.0007 -0.0003 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ```

Plot the current distribution.

`current(inductor,600e6)`

## Input Arguments

collapse all

PCB component object, specified as an RF PCB object. For a complete list of the PCB components, microstrip bends, and traces, see PCB Components Catalog and Custom Geometry and PCB Fabrication.

Frequency to calculate the current distribution, specified as a scalar in Hz.

Example: 70e6

Data Types: `double`

### Name-Value Arguments

Specify optional pairs of arguments as `Name1=Value1,...,NameN=ValueN`, where `Name` is the argument name and `Value` is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: `scale=log10`

Scale to visualize the current distribution on the surface of the PCB component, specified as a string or a character vector. The string values are either `'linear'`, `'log'`, or `'log10'` or as a function. You can specify any mathematical function such as `log`, `log10`, `cos`, or `sin`.

Data Types: `char` | `function_handle`

Slicer to slice the current plot and focus on the desired portion, specified as `'on'` or `'off'`. Choosing `'on'` adds the slicer panel to the current plot and choosing `'off'` does not change the current plot.

Data Types: `logical`

Excitation using as voltage source, specified function handle from the `voltagePort` function.

Data Types: `char` | `function_handle`

Choose the component to display of the metal current, specified as.`absolute`, `real`, or `imaginary`.

Data Types: `char` | `function_handle`

Visualize the direction of the vector when plotting metal current, specified as `off` or `on`.

Data Types: `logical`

## Output Arguments

collapse all

x, y, z components of the current distribution, returned as a 3-by-n complex matrix in A/m. The value of the current is calculated on every triangle mesh on the surface of the PCB component.

Cartesian coordinates representing the center of each triangle in the mesh, returned as a 3-by-n real matrix.

## Version History

Introduced in R2021b