# Knowledge Base

 sourcepower

Returns the power injected into the simulation by the source.

Dipole sources

The sourcepower script function returns the power the dipole source would radiate in a homogeneous medium. This quantity can be calculated analytically (see Dipoles - Radiated Power). The actual radiated power is not given by the sourcepower function. The actual radiated power is highly dependant on the surrounding materials, since the reflections from the structures will interfere with the fields from the dipole, changing the actual radiated power. To get the actual radiated power, see the dipolepower script function.

Other sources (Gaussian, plane wave, mode, etc)

The sourcepower is determined from the equation below. Note that is the Poynting vector determined from the E, H fields injected by the source. The integral is evaluated over the injection plane of the source.

As stated above, sourcepower gives the amount of power injected into the simulation. The only exception is if the simulation is setup such that there is radiation which travels through the injection plane of the source in the source injection direction (pink arrow). In such cases, the actual amount of power injected by the source will not be given by sourcepower. In this situation, the incident radiation interferes with the source, changing the amount of injected power (similar to what happens for the dipole source). In most cases, this means your simulation is not setup properly.

In the case of multiple sources, the sourcepower(f) command will return the sum of all sourcepowers from all sources.

In 3D simulations, the units will be in Watts if CW norm is used, and Watts/Hertz2 if no norm is used.

 Supported Product: FDTD, MODE

 Syntax Description out = sourcepower(f); Returns the source power used to normalize transmission calculations at the vector of frequency points f. (f is the frequency in Hz) out = sourcepower(f, option); The additional argument, option, can have a value of 1 or 2. If it is 2, the data is unfolded where possible according to the symmetry or anti-symmetric boundaries if it comes from a monitor that intersect such a boundary at x min, y min or z min. The default value of option is 2. out = sourcepower(f, option, name); This option allows you to obtain the spectrum of one source, rather than the sum of all sources. This option is only needed for simulations with multiple sources.

Examples

This example shows how to calculate the power injected by a source as a function of frequency.

f=linspace(200e12,300e12,100);

sp=sourcepower(f); # power in Watts, assuming CW norm is on.

This example shows how to use the transmission and sourcepower functions to calculate the power injected by a plane wave source.

newproject;

save("test");

# simulation region

set("x span",1e-6); set("y span",1e-6); set("z span",1e-6);

set("x min bc","periodic"); set("y min bc","periodic");

# plane wave source

set("z",-0.3e-6);

set("x span",2e-6); set("y span",2e-6);

set("center wavelength",500e-9);

set("wavelength span",0);

# power monitor

set("z",0.3e-6);

set("x span",2e-6); set("y span",2e-6);

# run simulation

run;

# get results

m="monitor";

f=getdata(m,"f");     # get frequency vector

T=transmission(m);     # get power transmission (fraction of source power)

sp=sourcepower(f);     # get power injected by source (Watts)

# output results

?"Transmitted power (fraction of source power): " +num2str(T);

?"Transmitted power (Watts): " +num2str(T*sp);

?"Source power (Watts): "+num2str(sp);

> Transmitted power (fraction of source power): 0.999986

> Transmitted power (Watts): 1.26203e-015

> Source power (Watts): 1.26204e-015