The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 4:37am
Pages: 1
Send Topic Print
to solve differential equations in verilog-a? (Read 3466 times)
msdryxon
New Member
*
Offline



Posts: 5

to solve differential equations in verilog-a?
Jul 26th, 2008, 12:25am
 
Hi,
  Now I'm using verilog-a to do some research on modeling kinematic structures. We all know that ddt or idt is accepted in verilog-a, such like the following sentences:
  Pos(v)<+ddt(x);

 But if Fdrv is from a source outside my module and i want to output the x in the following differential equation, how can i?

 a*x''+b*x'+cx=Fdrv

  i've written these codes,
  .......(includings)
  module test(Fdrv,x);
      inout Fdrv,x;
      kinematic Fdrv,x;
      kinematic v; //temp. var. to hold ddt(x)
      parameter real a=xxx, b=xxx, c=xxx; // assume a,b,c are properly defined      
              analog begin
                   Pos(v)<+ddt(x);
                   F(Fdrv)<+a*ddt(Pos(v))
                                 +b*Pos(v)
                                 +c*Pos(x);
               end
  endmodule


   if i input x to module test, i will get proper output of Fdrv, but if i want to input Fdrv and get the
proper value of x, which means i want to solve this differential equation, it never works.
   How can i solve this problem? thank you very very much....
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: to solve differential equations in verilog-a?
Reply #1 - Jul 26th, 2008, 10:10am
 
You can use indirect branch assignment. Looks something like this ...

kinematic drv, x;
kinematic_v v;
analog begin
   Vel(v) <+ ddt(Pos(x));
   Pos(x) : a*ddt(Vel(v) + b*Vel(v) + c*Pos(x) == F(drv);
end

The indirect branch assignment can be read: "Find Pos(x) such that ...".

Here I am assuming that I separate discipline dedicated to velocity. Otherwise the tolerances get out of whack.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.