The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl Design Languages >> Verilog-AMS >> How to implement ODEs using Verilog-A https://designers-guide.org/forum/YaBB.pl?num=1084839499 Message started by shu on May 17th, 2004, 5:18pm |
Title: How to implement ODEs using Verilog-A Post by shu on May 17th, 2004, 5:18pm I am wondering whether I can implement coupled odinary differential equations using Verilog-A and simulated by Spectre? The equations look like dx/dt=x*y dy/dt=x/y Thanks a lot. |
Title: Re: How to implement ODEs using Verilog-A Post by Geoffrey_Coram on 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 |
The Designer's Guide Community Forum » Powered by YaBB 2.2.2! YaBB © 2000-2008. All Rights Reserved. |