Define system simulation settings
RF Blockset / Circuit Envelope / Utilities
Use the Configuration block to set the model conditions for a circuit envelope simulation. The block parameters define a set of simulation frequencies, solver attributes, and thermal noise.
Connect one Configuration block to each topologically distinct RF Blockset™ subsystem.
Each Configuration block defines the parameters of
the connected RF Blockset subsystem. To see an example of the
Configuration block in a model, enter
a MATLAB Command Window.
For an introduction to RF simulation, see Simulate High Frequency Components.
Sample time in RF Blockset is
Automatically select fundamental tones and harmonic order— Automatically select fundamental tones and harmonic order
Select this parameter to choose Fundamental tones and Harmonic order parameters automatically when you update the model. Automatic selection does not always return the smallest possible set of simulation frequencies.
To set the Fundamental tones and Harmonic order, clear this parameter. A smaller set of simulation frequencies decreases simulation time and decreases memory requirements. However, a decrease in simulation frequencies can reduce accuracy.
Fundamental tones— Fundamental tones of set of simulation frequency
Fundamental tones of a set of simulation frequencies, specified as a vector of positive integers in Hz.
To enable this parameter, clear Automatically select fundamental tones and harmonic order.
Harmonic order— Harmonic order for each fundamental tone
Harmonic order for each fundamental tone, specified as a vector of positive integer. You can also specify a scalar and this value is applied to each Fundamental tones.
To enable this parameter, clear Automatically select fundamental tones and harmonic order.
Total simulation frequencies: Computed at simulation time— Displays number for simulation frequencies for linear model
Click View to open dialog box containing
additional information about the simulation frequencies in your system.
Configuration block displays the number of
simulation frequencies for a nonlinear model. For linear models, the
actual number of frequencies are automatically optimized during simulation.
Because the solver computes a solution to the network at each simulation
frequency, computation time scales according to the size of this value.
By clicking a listed simulation frequency, you can see which linear or multiple combinations of fundamental tones represent that frequency. From the dialog box, you can also plot the simulation frequencies on a number line.
The block parameters define a set of simulation frequencies as combinations of fundamental tones: [m*f1 + n*f2 + …]. In this case, represented as [f1,f2,…], and the integers m and n are bounded by the corresponding Harmonic order, |m| ≦ h1, |n| ≦ h2, etc. Only positive frequencies are considered.
For example, suppose that you have a single fundamental tone f1 = 2 GHz and corresponding harmonic order h1 = 3. The set of simulation frequencies [0, f1, 2f1, 3f1] = [0GHz, 2 GHz, 4 GHz, 6GHz].
As a second example, suppose you have a circuit with two fundamental tones [f1 = 2 GHz, f2 = 50 MHz] and corresponding harmonic orders h1 = h2 = 1. This setup results in five simulation frequencies with values [0, f2, f1-f2, f1, f1+f2].
The set of simulation frequencies must include all carrier frequencies specified in the RF Blockset subsystem such as the carrier frequencies inside Inport, Outport, and source blocks.
To enable this parameter, select Automatically select fundamental tones and harmonic order. If you clear Automatically select fundamental tones and harmonic order, the option becomes, Total simulation frequencies: N/A: Fundamental tones undefined.
Step size— Time step for fixed step solver configuration
1e-6(default) | vector of integers in seconds
Time step for fixed step solver configuration, specified as a vector of integers in seconds. The default is sufficient for modeling envelope signals with bandwidths of up to 1/h, or 1 MHz. But simulation accuracy is reduced when simulating close to the maximum bandwidth. Reduce the step size to model signals with a larger bandwidth, or improve accuracy.
When the noise is simulated, the noise bandwidth for each simulation frequency is equal to 1/h.
Envelope bandwidth— Maximum simulated envelope bandwidth
1 MHz(default) | scalar in Hz
Maximum simulated envelope bandwidth, returned as a scalar in Hz. Configuration block automatically calculates this value using the Step size parameter. The formula used is: .
Simulate noise— Globally enable or disable noise modeling
Select this parameter to globally enable noise modeling in RF Blockset circuits. When this check box is selected:
Resistor blocks model thermal noise using the Temperature parameters.
Noise blocks model a specified noise power as a voltage or current source.
To disable noise modeling globally, clear this parameter.
Use default ramdom number generator— Default pseudorandom noise stream for RF Blockset sources
Select this parameter to retain the default pseudorandom noise stream for RF Blockset sources. Clear this option to specify an independent pseudorandom number stream for the RF Blockset topological subsystem and determine the seed of the noise stream.
To expose this parameter, select Simulate noise.
Noise seed— Seed of the independent pseudorandom number stream
0(default) | scalar positive integer
Seed of the independent pseudorandom number stream, specified as a scalar positive integer.
To expose this parameter, clear Use default random number generator.
Temperature— Global noise temperature
K| scalar integer in kelvin
Global noise temperature, specified as a scalar integer in kelvin.
Normalize Carrier Power— Normalize power of carrier signal
Select this option to normalize the carrier power such that the average power of the signal is:
In this case, the equation gives the corresponding passband signal at ω:
I(t) am the in-phase part of the carrier signal.
Q(t) is the quadrature part of the carrier signal.
fk are the carrier frequencies.
Clear this option so the average power of the carrier signal is:
In this case, the corresponding passband signal at ω represented by the equation
0 carrier frequency is a special case. Its passband representation is always I and average power I2
Transient analysis— Fixed-step solver of RF Blockset environment
Fixed-step solver of RF Blockset environment, specified as one of the following:
Auto: Set this parameter
Auto, when you are not sure which solver
NDF2: Set this parameter
NDF2 to balance narrowband and wideband
accuracy. This solver is suitable for situations where the frequency
content of the signals in the system is unknown relative to the Nyquist
Trapezoidal Rule: Set this
Trapezoidal Rule for narrowband
simulations. Frequency warping and the lack of damping effects make
this method inappropriate for most wideband simulations.
Backward Euler: Set this
Backward Euler to simulate
the largest class of systems and signals. Damping effects make this
solver suitable for wideband simulation, but overall accuracy is low.
The RF Blockset solver is an extension of the Simscape™ local solver. For more information on the Simscape local solver, see the Solver Configuration block reference page.
Relative tolerance— Relative newton tolerance for system variables
1e-3(default) | real positive finite scalar
Relative newton tolerance for system variables, specified as a real positive finite scalar.
Absolute tolerance— Absolute newton tolerance for system variables
1e-6(default) | real positive finite scalar
Absolute newton tolerance for system variables, specified as a real positive finite scalar.
Maximum iterations— Number iterations required for convergence
10(default) | real positive integer scalar
Number iterations required for convergence, specified as a real positive integer scalar.
Error estimation— Check for error of convergence in system variables
2-norm over all variables(default) |
Each variable separately
Check for error of convergence in system variables, specified as:
2-norm over all variables: Use
this option to calculate the 2-norm of all the state variables and
then check the error in convergence of state variables.
Each variable separately: Use this
option to check the error in convergence of each variable separately.
Restore Default Settings— Restore newton solver to default values
Restore newton solver to default values, specified as a button.
Circuit envelope solver in the RF Blockset is a solving a set of non linear equations from a set of system variables. These system variables are derived from the circuit topology and simulation frequencies. Relative tolerance and absolute tolerance are used to keep the error in convergence of the system variables to minimum. The number of iterations used at each time step dramatically affects the speed of the solutions and the trade-off between accuracy and speed. The trade-off is governed by the stopping criterion for the iterations. This stopping criterion is based on 3 sub criterion:
Variable error convergence:
X- System variables
t- maximum iterations.
Residue error convergence:
Fn(X)- represents a part of F(X) coming from the nth branch.
Maximum number of iterations.
Stop the calculations if the first two sub-criterion are filled or the last sub-criterion is filled. If only one of the sub-criterion is filled, error out that the ' non-linear solver failed'.
Sample rate calculation formula:
Sample time calculation formula:
where, BW is the simulated bandwidth.