The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Modeling >> Behavioral Models >> Spectre's svcvs error ?
https://designers-guide.org/forum/YaBB.pl?num=1058459035

Message started by gilbertsee on Jul 8th, 2003, 5:15pm

Title: Spectre's svcvs error ?
Post by gilbertsee on Jul 8th, 2003, 5:15pm

Hi Ken,
I was trying to translate a laplace transform of Voltage controlled voltage source of spice format to spectre's SVCVS. But the result of the conversion in spectre is not right. Below are the files that i used, the 1st is the circuit netlist and the later is model file.

The following is used to generate the S-parameter,S11 & S12. This is all right.
//
simulator lang=Spectre insensitive=yes
include "RESRF.txt"
vin ( 1 0 ) vsource mag=1  
r1 ( 1 2 ) resistor r=50
x1 ( 2 3 0 ) etn7
r2 ( 3 0 ) resistor r=50
e11 ( 5 0 2 0 ) vcvs gain=2
v11 ( 11 5 ) vsource mag=-1  
r11 ( 11 0 ) resistor r=1k
e21 ( 21 0 3 0 ) vcvs gain=2
r21 ( 21 0 ) resistor r=1k
analysisAC1 ac lin=101 start=0.05G stop=10.05G  

The following is the model for RESRF.txt:
subckt etn7 1 2 ref
//e11 (1 2 1 ref) svcvs numer=[1] denom=[1 3.18e-11]  
//e11 (1 2 1 ref) svcvs numer=[1e-2] denom=[1 3.18e-11]  
e11 (1 2 1 ref) svcvs numer=[1e2] denom=[1 3.18e-11]  
ends etn7

when i run the simulation in spectre, all above 3 cases give me the same results. What could possibility be wrong?

Thanks and best regards,
gilbert

Title: Re: Spectre's svcvs error ?
Post by Mighty Mouse on Jul 8th, 2003, 9:39pm

The parameter you are changing would only change the DC gain, but the DC gain is controlled by the gain parameter. Try instead changing gain.



- MM -

Title: Re: Spectre's svcvs error ?
Post by gilbertsee on Jul 8th, 2003, 10:43pm

Hi MM,
Thanks. That is the right thing to do if only i have only a single numerator. But, in reality, the vcvs that i wanted to translate to spectre is much more complicated.I have more than 1 numerator, it's a polinomial equations. I know in most spice engine, it actually just defined with the coeffecients and couple it with some exponential value. For example, i tried to change the following pspice's (laplace ) e-element to spectre, the spectre simulation came out differently...from the experiment that i do with the previous post's, it seems that spectre doesn't support the exponential component ??

.subckt etn7 1 2 ref
e11 1 2 LAPLACE {V(1) - V(ref)} = {(
+ (-2.6321324e-002) +
+ (-1.7806378e-011)*s^1 +
+ (-1.5212284e-021)*s^2 +
+ (-6.6557616e-032)*s^3 +
+ (-5.2229209e-043)*s^4) / (
+ (-0.55008283) +
+ (-6.8293927e-011)*s^1 +
+ (-4.0213578e-021)*s^2 +
+ (-9.6128474e-032)*s^3 +
+ (-7.1326114e-043)*s^4 +
+ (-1.390917e-054)*s^5)}
.ends etn7

my spectre translation:
subckt etn7 1 2 ref
e11 (1 2 1 ref) svcvs gain=1
+numer=[ (-2.6321324e-002)
+ (-1.7806378e-011)
+ (-1.5212284e-021)
+ (-6.6557616e-032)
+ (-5.2229209e-043)]
+denom=[ (-0.55008283)
+ (-6.8293927e-011)
+ (-4.0213578e-021)
+ (-9.6128474e-032)
+ (-7.1326114e-043)
+ (-1.390917e-054)]
ends etn7

So...what should i do? Please advice.

Title: Re: Spectre's svcvs error ?
Post by Mighty Mouse on Jul 15th, 2003, 9:03am

Spectre separates the specification of the frequency dependence from the specification of the dc gain. It does so by first normalizing the transfer function you give. So for example, if you specify a transfer function H(jw) using some combination of coefficients or critical frequencies, it implements a transfer function of gain*H(jw)/H(0). Thus, even in your compilcated case, if you simply specify the expected dc gain, you should get what you want.

- MM -

Title: Re: Spectre's svcvs error ?
Post by gilbertsee on Jul 15th, 2003, 5:22pm

HI MM,
I can see that spectre is doing it in the way you mentioned. I agreed that spectre can run it ok when we know the dc gain,provided that the tranfer function is only have 1 dc denominator.

    The problem that i discover now is not with the dc gain portion, but the frequency portion. The spectre has produced a different answer with Pspice equivalent circuit. I've try a few simulations, i suspect that the way spectre treat the transfer function has some bug for this element. For example, from the simplified example with only single dc denominator, it was suppose to work even if i defined gain and the transfer function as =1. After the multiplication with 1e-2 or 1e2 it should come out right! For example, the Hfinal(S)=Gain*H(S)/H(0)
=1*[1e-2/(1+3.82e-11S)]/1

but the result came out to be
Hfinal(S)=1/(1+3.82e-11S)

So, any idea?

Title: Re: Spectre's svcvs error ?
Post by Mighty Mouse on Jul 15th, 2003, 6:06pm

In your example, H(s) appears to be
H(s) = 1e-2/(1+3.82e-11s)
then H(0) = 1e-2, so if
Hfinal(s)=gain*H(s)/H(0)
and if gain=1, then
Hfinal(s)=1/(1+3.82e-11s),
which is what you reported that Spectre gave you (modulo what appears to be a typo). So it seems like Spectre is working as advertised.


- MM -

Title: Re: Spectre's svcvs error ?
Post by gilbertsee on Jul 15th, 2003, 9:59pm

I see your point there. But, in my opinion, in doing this, spectre is actually making it redundant and complex. I used your idea of H(0) and tried it on the more complex model (like the one in the 2nd post), by adding the complexity of the denominator. I tried to change the gain, now the answer remain the same no matter what value i declare in the dc gain,including 0, deleting some other denominators..etc. ?? I'm not sure what have cause this...the only conclusion is that this element some bug?? Or probably you can verify this..Thanks.

Title: Re: Spectre's svcvs error ?
Post by Mighty Mouse on Jul 16th, 2003, 2:06pm

I'd be willing to take a look at it if you were to put the exact text of the svcvs statement in a post along with a description of what you were expecting and why what you got seems wrong to you.
- MM -

Title: Re: Spectre's svcvs error ?
Post by gilbertsee on Jul 16th, 2003, 5:01pm

After this line is the spectre netlist and model:

simulator lang=spectre insensitive=yes
vin ( 1 0 ) vsource mag=1
r1 ( 1 2 ) resistor r=50
x1 ( 2 3 0 )  etn7
r2 ( 3 0 ) resistor r=50
e11 ( 5 0 2 0 ) vcvs gain=2
v11 ( 11 5 ) vsource mag=-1
r11 ( 11 0 ) resistor r=1k
e21 ( 21 0 3 0 ) vcvs gain=2
r21 ( 21 0 ) resistor r=1k
analysisAC1 ac lin=101 start=0.05G stop=10.05G
//save 21
// enk
subckt etn7 1 2 ref
e11 (1 2 1 ref) svcvs
+numer=[ (-2.6321324e-002)
+ (-1.7806378e-011)
+ (-1.5212284e-021)
+ (-6.6557616e-032)
+ (-5.2229209e-043)]
+denom=[ (-0.55008283)
+ (-6.8293927e-011)
+ (-4.0213578e-021)
+ (-9.6128474e-032)
+ (-7.1326114e-043)
+ (-1.390917e-054)]
ends etn7

After this line is the pspice equivalent netlist and model:
*S11 & S21
Vin 1 0 AC 1
R1 1 2 50
X1 2 3 0 etn7
R2 3 0 50
e11 5 0 (2,0) 2
v11 11 5 AC -1
R11 11 0 1k
e21 21 0 (3,0) 2
R21 21 0 1k
.AC LIN 101 0.05 10G
.probe
.subckt etn7 1 2 ref
e11 1 2 LAPLACE {V(1) - V(ref)} = {(
+ (-2.6321324e-002) +
+ (-1.7806378e-011)*s^1 +
+ (-1.5212284e-021)*s^2 +
+ (-6.6557616e-032)*s^3 +
+ (-5.2229209e-043)*s^4) / (
+ (-0.55008283) +
+ (-6.8293927e-011)*s^1 +
+ (-4.0213578e-021)*s^2 +
+ (-9.6128474e-032)*s^3 +
+ (-7.1326114e-043)*s^4 +
+ (-1.390917e-054)*s^5)}
.ends etn7
.end

The error are the trends of the spectre file:
It shows the S21 (voltage at node 21) has gain (which is impossible for this...it's a transfer function of a passive element!)  Thanks.

Title: Re: Spectre's svcvs error ?
Post by gilbertsee on Jul 16th, 2003, 11:08pm

It works now by changing the gain to (-2.6321324e-002)  /(-0.55008283) .
Thanks.

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