Geoffrey_Coram
|
Re: How to implement ODEs using Verilog-A
Reply #1 - Jul 9th, 2004, 9:13am
Shu - The equations you wrote could be implemented by two coupled simple circuits, each consisting of a 1-Farad capacitor and a dependent current source. In Spectre, I don't believe you can have a dependent source with a division, so it will have to be Verilog-A.
---- ode.va ---- `include "disciplines.h" module ode(x,y); inout x,y; electrical x,y; analog begin I(x) <+ V(x)*V(y) - ddt(V(x)); I(y) <+ V(x)/V(y) - ddt(V(y)); end endmodule ---- ---- ode.netlist ---- * simulator lang=spectre ahdl_include "ode.va" X1 (x y) ode ic x=1 y=1 tran1 tran stop=1u skipdc=yes ----
As written, the only DC solutions of your equations are {x=0, y=anything but 0}, and when x=0, the transient analysis is boring.
To get something interesting, I have set "skipdc=yes" and provided initial conditions for both nodes.
-Geoffrey
|