Académique Documents
Professionnel Documents
Culture Documents
Parallel RC
Circuit
C = 1F,Vc=2V
Snapshot of HSPICE
code
.option post
R = 1k
n1
Gnd
Snapshot of MAPP
Code
clear
ntlst;
ntlst.cktname = 'rc';
% parallal RC circuit
ntlst.nodenames = {'n1'}; % non-ground nodes
ntlst.groundnodename = 'gnd';
ntlst = add_element(ntlst, resModSpec(), 'r1', {'n1', 'gnd'},
...
{{'R', 1000}}, {});
ntlst = add_element(ntlst, capModSpec(), 'c1', {'n1',
'gnd'}, ...
1e-6, {});
DAE = MNA_EqnEngine(ntlst);
dcop = dot_op(DAE);
feval(dcop.print, dcop);
xinit = 2; %Initial capacitor voltage
tstart = 0; tstep = 0.5e-6; tstop = 5e-3; %transient
LMSobj = dot_transient(DAE, xinit, tstart, tstep, tstop);
feval(LMSobj.plot, LMSobj);
souts = StateOutputs(DAE);
souts = souts.DeleteAll(souts);
souts = souts.Add({'e_n1'}, souts);
feval(LMSobj.plot, LMSobj, souts);
r1 1 0 1000
c1 1 0 1u
.ic V(1)=2
.print tran v(1) i(c1) i(r1) i(v1)
.option delmax=1
.tran 1.5u .005 UIC
.end
Modular approach in
MAPP
With parallel RC circuit
C = 1F,Vc=2V
R = 1k
n1
Snapshot of MAPP
Code
clear
ntlst;
Gnd
ntlst.cktname = 'rc';
% parallal RC circuit
ntlst.nodenames = {'n1'}; % non-ground nodes
ntlst.groundnodename = 'gnd';
ntlst = add_element(ntlst, resModSpec(), 'r1', {'n1', 'gnd'},
...
{{'R', 1000}}, {});
ntlst = add_element(ntlst, capModSpec(), 'c1', {'n1',
'gnd'}, ... 1e-6, {});
DAE = MNA_EqnEngine(ntlst);
dcop = dot_op(DAE);
feval(dcop.print, dcop);
xinit = 2; %Initial capacitor voltage
tstart = 0; tstep = 0.5e-6; tstop = 5e-3; %transient
LMSobj = dot_transient(DAE, xinit, tstart, tstep, tstop);
feval(LMSobj.plot, LMSobj);
souts = StateOutputs(DAE);
souts = souts.DeleteAll(souts);
souts = souts.Add({'e_n1'}, souts);
feval(LMSobj.plot, LMSobj, souts);
MATLAB vs HSPICE
MATLAB
Advantage in Circuit
Simulation
1. Wide range of functional
features with multipurpose
usage.
2.Availability of vrious
toolbox that can be
incorporated
Disadvanatge
1.Difficulty in defining
circuits without available
analytical expression
2.Slow compared to SPICE
SPICE
Advantage in Circuit Simulation
1.Widely used in last 30 years with inbuilt
circuit functions
2.Highly popular in industry
3.Produce results fast
4.Syntax based approach. Easy to develop
large circuits with repetitive elements with
nodal features through modular approach
Disadvantage
1.Diffiiculty in converging with analytical
expression, the software being a black box
2.Lack of user-friendly GUI unlike MATLAB
3.Often requires client-server connections to
access from terminal PC
4.Dificulty in verifying or debugging
discrepancies for the lack of inbuilt sourcecode
5.Difficulty in adding new features in the circuit
parameters
MAPP
Advantage in Circuit Simulation
1.Use MATLAB's features and inbuilt
functions to provide wide-purpose
analytical formalism
2.Provides means to debug, verify
discrepancies to deal with convergence
issues
3.Use HSPICE's advantages such as
transient simulations with a modular
functional approach with MODSPEC and
DAE
4.Keeps the code transparent, unlike
HSPICE's blackbox features
5.Excellent GUI
Disadvanatge
1.Often requires longer code compared to
HSPICE
2.Application of modular approach
requires more attention beyond nodal
placements