I need to solve a differntial eqaition in my VerilogA marco-model
The eqaution I want to solve is:-
ddt(V(alpha)) = Vx * V(in)
V(in) is the input signal ( as a function of time 't') to the model.
Vx is read from a "table_model" at (t + V(alpha) i.e ( $(abstime) + V(alpha) )
To solve this I did as below:-
// define branches
branch (alpha) alpha1;
branch (alpha) alpha2;
I(alpha1) <+ -Vx * V(in);
I(alpha2) <+ ddt(V(alpha));
The KCL at alpha forces I(alpha1) + I(alpha2) = 0 and solve the differntial equation.
I went and checked the results.
At $abstime = t1
Vx * V(in)= x1
At $abstime = t2
Vx * V(in)= x2
I think y2 should be eqaul to
y2= [ x2 * (t2 - t1) ] + y1.
But SPECTRE is showing something different than "y2" .
Can anybody please tell where I am going wrong ?