The GENERATE_MIMO( ) simulations are based on "Semi Analytical Recursive Convolution" ( SARC ) R , E , G , H , F component values can be modified at any time during simulation but also L and C since the implemented algorithm takes care of flux and/or charge conservation There are no accuracy parameters, no iteration limits, nor user selectable convergence strategies ( except for "Saturation Rendering" approximation (as for slewrate) ) STEP calculation only involves a short sequence of arithmetic operations performed on the circuit STATE SPACE matrices { A B C D } However, the user should take a look to the symbolic expressions of the various matrix coefficients to figure out if assigning later too small, or too big, values to some components can result to internal out of bounds numeric data leading to unstable or misleading simulations Therefore defining, for example, microscopic or gigantic resistors can be very prejudicial This recommendation is even more critical when the order of the system becomes large The SARC package uses 64 bits "double" float giving, at most, 16 digits precision ---------------------------------------------------------------------------------------------------- This signal can be used to generate the "impulse response" of a single input circuit ^ input(t) However, the true mathematical Laplace activation is expected to | be a simulated Dirac "centered" around the Y axis, but this would | imply a (not causal) simulator starting at t = - h/2 1/h +-+ |/| Therefore, with the "causal" Dirac approximation shown here, >|/|< single step != 0 the SARC output "response" plot should be shifted h/2 to the left |/| in order to match any calculated "theoretical" curve impulse response +-+------------> 0 h t In practice, the error is imperceptible ---------------------------------------------------------------------------------------------------- In all cases the input signals are assumed to be CAUSAL Simple Heaviside, as well as complex signals, are assuming a global Heaviside multiplicative factor ---------------------------------------------------------------------------------------------------- In NETLIST( ), Placing a minus sign "-" in front of an instance name will force a swap of its node connections This feature can be useful, for example, to overcome the conventional direction within current sources [ I , -I1 , n1 , n2 ] ==>> [ I , I1 , n2 , n1 ] For "controlled" sources, only the (left) source side is permuted [ F , -F1 , src1 , src2 , ctrl1 , ctrl2 ] ==>> [ F , F1 , src2 , src1 , ctrl1 , ctrl2 ] ---------------------------------------------------------------------------------------------------- INTERN( in2 , in3 ) INTERN allows to declare that 'in2' and 'in3' should be considered as INTERNAL constant sources ( V or I ) of the circuit For example, operational amplifier OFFSETs can be considered, at functional level, as internal components ( impacting the overall DC level of the outputs ) INTERN sources are REMOVED from the INPUTS list and ADDED to the "BOM" Therefore, this allows to set and change their values through a user parameter The " GENERATE_XFER( nointern ) " command can be used to display the PARTIAL transfer functions involving only the remaining INPUTS GENERATE_MIMO( ) will simulate INTERN as "controlled sources" driven by an hidden HEAVISIDE global common source ( named "bootstep" ) XWISH( L3 , C5 , C2 , L4 ) ; declared before GENERATE_MIMO( ), this might be an ordered ( but not necessarily entire ) list of L & C components "wished" to be retained by the SARC netlist analyser as "state" variables Choosing most relevant L/C may have a positive effect on simulation numeric "noise" ---------------------------------------------------------------------------------------------------- Netlists generated with the "SARC schematic editor" contains "BIND" directives and equivalences XNUM( expression ) can be used to replace symbolic variables by their BIND declared numeric values xnum( expression ) does the same but keeping %pi and %e as symbols schematic "GLOBALS" line syntax defining special BIND directives ================================================================ %rubmode = true default = false when true, calculate but do not plot t+ spikes ( i.e. rub L & C percussion spikes that may appear at t+ ) This prevents large "instantaneous" spikes to disrupt GNUPLOT scaling wihout compromising the overall simulation accuracy %printpoles = 4 default = 0 request to print, on "stdout", during SARC simulation, the only 4 first calculations of the circuit POLES due to the 4 first different content of the "BOM" occurring over time POLES will be printed as pairs [ real part , frequency (Hz) ] Except trivial cases, SYMBOLIC expression of the POLES can be theoretically expressed only for very small orders <= 4 ( due to the Abel-Ruffini theorem ) Under this condition, the Maxima function eigenvalues( A ) ; may be used, with "A" being the "state" circuit matrix calculated by GENERATE_MIMO( ) %srtol = 1E-3 default = 1E-4 set Saturation Rendering tolerance as 1E-3 tolerance = ( actual - expectedmax ) / expectedmax roughly, dividing %strol by 10 increases the number of iterations by +4 %srlim = 25 default = 50 set Saturation Rendering interation limit as 25 %phases = [ Phi1 , Phi2 ] mandatory PHASES declaration for GENERATE_Z( ) %zopen = Gds component Gds will be IGNORED by GENERATE_Z( ) %zopen = [ Gds1 , Gds2 ] %zshort = Rds component Rds will be SHORTED by GENERATE_Z( ) %zshort = [ Rds1 , Rds2 ] Adding hard coded "floating constant values" BINDs, for some components, will speed up both Maxima and SARC processing time The side effect being to also disable them definitively from possible runtime "percussions" ---------------------------------------------------------------------------------------------------- The function fdigits( n ) can be used to change the overall number of nonzero digits, before or after the decimal point, used to display floating points ( default 4 ) HOWEVER, Even if limiting the number of digits can be used to display more "readable" expressions, the user should be warned that the associated rounding truncation effect can hide very small scale differences ( that could have prevented, in the worse case, matrix determinant( A ) to become 0 ) For that reason, the ".h" generated for MIMO simulations always use the max precision regardless of fdigits ---------------------------------------------------------------------------------------------------- OUTPUTS syntax : Placing a minus sign "-" in front of an OUTPUT component name will invert its value, example V(-R2) INPUTS INPUTS interpolation interpolation | | ERROR | max ERROR | ---------------------+-----------+-------------+-------------+ | | | | node | V( n2 ) | eV( n2 ) | mV( n2 ) | | | | | U I R L C | V( R3 ) | eV( R3 ) | mV( R3 ) | U I R L C | I( R3 ) | eI( R3 ) | mI( R3 ) | and E G H F source | | | | | | | | E G control | cV( E1 ) | ecV( E1 ) | mcV( E1 ) | H F control | cI( H4 ) | ecI( H4 ) | mcI( H4 ) | | | | | | W( R3 ) | | | component WATTS | | | | | F( L2 ) | | | inductance FLUX = L I | Q( C4 ) | | | capacitance CHARGE = C V | | | | | J( L2 ) | | | inductance JOULES = 0.5 L I^2 | J( C4 ) | | | capacitance JOULES = 0.5 C V^2 | J( ) | | | overall JOULES stored in L & C | | | | | X( L2 ) | | | inductance STATES part of I( L2 ) | U( L2 ) | | | inductance inputs part of I( L2 ) | | | | | X( C4 ) | | | capacitance STATES part of V( C4 ) | U( C4 ) | | | capacitance inputs part of V( C4 ) | | | | ---------------------+-----------+-------------+-------------+ | | | | | srn( G1 ) | | | number of recalculation Saturation Rendering | sro( G1 ) | | | outraw ( out before relaxation ) E G H F | srg( G1 ) | | | hidden gain to sustain max | | | | ---------------------+-----------+-------------+-------------+ note: V( labelA:labelB ) or V( labelA:GND ) can be used for VOLTAGE DIFFERENCE between 2 LABELS STATE model dX/dt = A . X + B . U Y = C . X + D . U I(L2) = Y(L2) = X(L2) + U(L2) V(C4) = Y(C4) = X(C4) + U(C4) User OUTPUTS will be generated in following order : voltage & current errors watts [ F Q J X U ] ---------------------------------------------------------------------------------------------------- GENERATE_XFER( ) ================ All the transfer functions generated are stored in a global list named XFER Moreover, 4 functions are available : XFERS( V( C1 ) ) returns list of transfer functions associated with ALL inputs XFERS( V( C1 ) , IN3, IN4, ... ) returns transfer functions only for inputs IN3, IN4, ... LAPLACE( V( C1 ) ) returns overall transfer function SUM( XFER[ IN[k] ] * IN[k] ) LAPLACE( V( C1 ) , IN3, IN4, ... ) returns transfer function SUM involving only IN3, IN4 , ... An order |s|^7 denominator transfer function is theoretically equivalent with an order 7 matrix determinant thus, potentially, the summation of 7! = 5040 terms Fortunately a lot of them are discarded but, in practice, still many of them result in a final huge symbolic expression Therefore, 6 is likely to be an upper reasonable order limit for GENERATE_XFER( ) symbolic transfer function expression ---------------------------------------------------------------------------------------------------- GENERATE_Z( ) ============= BIND directive %phases = [ phi1 , phi2 ] must be defined to identify the processing phases GENERATE_Z( Z2(OUT) ) generates Z transform corresponding to OUT ( both separated phases ) GENERATE_Z( Z1(OUT) ) generates Z transform corresponding to OUT ( cycle mode ) ---------------------------------------------------------------------------------------------------- MIMO status variables ===================== NULL = DEGEN + AKIN ( degenerated states are toxic for circuit state matrix invertibility ) DEGEN "degenerated" states * when several C are forming a mesh one C voltage is therefore enslaved to the others ( KVL ) * when several L have their respective current converging to an ISOLATED node one L current is therefore enslaved to the others ( KCL ) In those configurations, it should be noted that a voltage source can also play the role of a C or a current source the role of a L AKIN simplest kind of "degenerated" states : parallel C or serial L same voltage for C ( ==>> redundant states ) or current for L ( ==>> redundant states ) COX collinear states resulting from ISOLATED serial C or parallel L same current for C ( I = C dV/dt = C dX/dt ==>> prorated states ) or voltage for L ( V = L dI/dt = L dX/dt ==>> prorated states ) thus they cannot be counted as "degenerated" BUT they must be also discarded for state matrix invertibility U2X boundless INPUT sources ( no R limiting maximum source throughput ) CS2X boundless controlled sources ( no R limiting maximum source throughput ) P2X PERCUSSION states reciprocal contribution SEAMLESS true only when NONE of the above ---------------------------------------------------------------------------------------------------- GENERATE_MIMO( ) "dubious states" WARNING explanation : =========================================================== A "PHYSICAL" source is composed of an "ideal" source ALWAYS associated with some kind of "intrinsic internal resistance" When a NETLIST does not include any resistor that, for a given source, could even play the role of an "internal resistance" that source may possibly supply "boundlessly" some part of the circuit For example, a voltage source, reduced to its "ideal" part, might be able to deliver, at initialisation, an UNLIMITED current to a directly connected empty capacitor However, even in the absence of a resistor, a serial inductor can also restrain the current of an ideal voltage source and a parallel capacitor the voltage of an ideal current source Among the various OUTPUTS requested by the user, some corresponding TRANSFER FUNCTIONS may be called "biproper" or "improper" because their numerator order equal their denominator order their numerator order are greater than their denominator order both kinds of numerator polynomials likely to be responsible of "boundless" source side effects For STATE representation, those transfer functions as well as others, like transfer functions having in their block diagram factorization "perfect" |s| differentiators ( ideal <=> not realizable ) "perfect" 1/|s| integrators ( ideal <=> not realizable ) or transfer functions resulting of internal cancellation of above |s| 1/|s| zeros/poles are all exhibiting a mathematical behavior that can only be fully detailed through the "Descriptor Systems" literature involving "Generalized States Space" modelised with the usual A B C D matrices + a "derivative" matrix called E GENERATE_MIMO( ) only implements the "state space" part ( also called "slow" sub-system ) of any full "Descriptor Systems" response Therefore, in case of singular behavior, a WARNING is issued for each OUTPUT requested by the user for which a full response would require a true "Descriptor Systems" modeling This is unavoidable since the missing modeling complexity would imply to take into account some source derivatives "past" and/or "future" that are incompatible with SARC prerequisite In conclusion, several idealization (not physical) of LTI models cannot be simulated accurately with SARC Any OUTPUT requested by the user for which no warning is issued remains fully CORRECT even in case of singular transfer functions elsewhere in the circuit ================================================= To stay away from this conceptual analysis, an "idiot proof advice" could be to insert a small resistor in series with all boundless sources "V" , "E" , "H" and a large resistor in parallel with all boundless sources "I" , "F" , "G" As a DRAWBACK, please note that each of those "corrective" resistors increment the ORDER and POLES of the circuit ( and therefore the size of the symbolic processing ) ---------------------------------------------------------------------------------------------------- MIMO2XFER( ) MIMO2XFER( nointern ) After the execution of GENERATE_MIMO( ) it is also possible to generate the transfer functions directly from the calculated A B C D matrices ( they can be retrieved from MIMO[ ] array ) The problem of symbolic factorial expansion, and thus the limitation order, is almost the same than GENERATE_XFER( ) Comparing the transfer functions obtained independently from XFER and MIMO is one of the method to prove the correctness of the associated algorithms However, this is likely to be only meaningful when the MIMO output occurs without Warnings ---------------------------------------------------------------------------------------------------- GENERATE_MIMO( ) default mode is to generate A B C D matrices However the identifier "C" may often conflict with a capacitor instance that a user has choosen to also name "C" Therefore, it is possible to declare " ABCDmode : false ; " in the user simulation environment to force the generation of %A %B %C %D matrices ---------------------------------------------------------------------------------------------------- GENERATE_MIMO( ) can approximate Saturation Rendering for the components E G H F Please look at the editor documentation ----------------------------------------------------------------------------------------------------