we are trying to model a system, using Electrical Linear Network, implementing the following equation:
I(out1) = ddt(V(in1))
That is, we want that the current of the output is the derivative of the voltage of the input terminal.
to do this we declared:
- two terminals (in1 and out1),
- two VCCS (v1 and v2),
- a sca_node (n)
- an inductor (ind).
Here you can find the implementation code:
template_1::template_1( sc_core::sc_module_name name_ ) :
sc_core::sc_module( name_ ),
ind( "pattern_1", 1.0 , sca_util::SCA_UNDEFINED )
ind.p( n );
ind.n( scams_ground );
We were expecting that what is modeled here was a derivative. However, when executing and reading the current value on out1, we see unexpected behaviors. In particular, we are writing as input (in1) a double signal, using a sca_de_vsource that starts from 1.0 and every microsecond it is self-multiplied by 1.01. Thus, we were expecting 1.01 constant output. This does not happen and very strange values, ranging from 0 to -1.59561833143e+47 are traced as output (using a tabular file). To read the output value we are using a sca_de_isink.
We are probably forgetting or misinterpreting something. Does anyone have any idea?
Thank you very much,