The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Modeling >> Behavioral Models >> Modeling Vout = Vin *{ 1-exp[-(t/alpha)^beta] }
https://designers-guide.org/forum/YaBB.pl?num=1468191755

Message started by jszair on Jul 10th, 2016, 4:02pm

Title: Modeling Vout = Vin *{ 1-exp[-(t/alpha)^beta] }
Post by jszair on Jul 10th, 2016, 4:02pm

Hello,

I want to model a block that produces the following behavior

Vout = Vin *{ 1-exp[-(t/alpha)^beta] }

Since it has exp[-(t/alpha)^beta], I can't simply use an RC like behavior model.

Modeling it with an varying RC as a function of Vin of previous timestep is also tricky, any error will be blown up because of its exponential behavior.

Any suggestions?

Title: Re: Modeling Vout = Vin *{ 1-exp[-(t/alpha)^beta] }
Post by Geoffrey_Coram on Jul 25th, 2016, 5:45am

You can write that equation exactly in Verilog-A, if your simulator supports it.  There are also some simulators that allow you to specify expressions for dependent sources, though I'm not sure if you can use time in those expressions.


Code:
`include "disciplines.vams"

module myfilter(in, out);
 inout in, out;
 electrical in, out;
 parameter real alpha = 1;
 parameter real beta = 1;

 analog begin
   V(out) <+ V(in) * (1 - exp(-pow($abstime/alpha, beta)))
 end
endmodule

Title: Re: Modeling Vout = Vin *{ 1-exp[-(t/alpha)^beta] }
Post by AMS_ei on Jul 30th, 2016, 5:28am

There will be a ";" at the end otherwise, it will shout with compilation error.

Here is the correct ones:

analog begin
   V(out) <+ V(in) * (1 - exp(-pow($abstime/alpha, beta)));
 end

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.