23.01.2015 Views

Download - Wolfram Research

Download - Wolfram Research

Download - Wolfram Research

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3.2 Subcircuit and Device Model Definition 211<br />

Plot the diode voltage. In[17]:= TransientPlot[diodedc, V$2[Vin], {Vin, −1., 5.}]<br />

1.5<br />

1<br />

0.5<br />

-1 1 2 3 4 5 Vin<br />

-0.5<br />

V$2[Vin]<br />

-1<br />

Out[17]= Graphics <br />

This example demonstrates how to specify initial conditions. The netlist describes an RLC series<br />

resonator. The behavior of the LC subcircuit is modeled by a system of differential equations.<br />

An RLC circuit with a<br />

behavioral description for<br />

the LC resonator.<br />

Set up time-domain circuit<br />

equations.<br />

Display the circuit<br />

equations.<br />

In[18]:= rlcfilter = Circuit[<br />

Netlist[<br />

{R, {1, 0}, 100.},<br />

{LC, {1 −> "P", 0 −> "N"},<br />

Model −> "LCSeriesResonator",<br />

Selector −> "Behavioral", L −> 0.02, C −> 5.*^−7}<br />

],<br />

Model[<br />

Name −> "LCSeriesResonator",<br />

Selector −> "Behavioral",<br />

Ports −> {"P", "N"}, Parameters −> {L, C},<br />

Variables −> {Current["P", "N"], Voltage["P", "N"],<br />

vind, vcap},<br />

Definition −> Equations[<br />

vind == L*Current["P", "N"]’,<br />

Voltage["P", "N"] − vcap − vind == 0,<br />

Current["P", "N"] == C*vcap’<br />

],<br />

InitialConditions −> {vcap −> 5.,<br />

Current["P", "N"] −> −0.02}<br />

]<br />

]<br />

Out[18]= Circuit <br />

In[19]:= rlcfeqs = CircuitEquations[rlcfilter,<br />

AnalysisMode −> Transient,<br />

InitialConditions −> Automatic]<br />

Out[19]= DAETransient, 6 4 <br />

In[20]:= rlcfeqs // DisplayForm<br />

Out[20]//DisplayForm=<br />

I$PN$LCt 0.01 V$1t ⩵⩵ 0, vind$LCt ⩵⩵ 0.02 I$PN$LC ′ t,<br />

vcap$LCt vind$LCt V$1t ⩵⩵ 0, I$PN$LCt ⩵⩵<br />

5. 10 7 vcap$LC ′ t, vcap$LC0 ⩵⩵ 5., I$PN$LC0 ⩵⩵ 0.02,<br />

V$1t, I$PN$LCt, vind$LCt, vcap$LCt, DesignPoint

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!