howto use different phase and frequency in sources for transient analysis?

View: New views
5 Messages — Rating Filter:   Alert me  

howto use different phase and frequency in sources for transient analysis?

by Rubén Gómez Antolí :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello All:

I need to specify different phases in sources in this way:

I1 phase=-10 freq=60
I2 phase=150 freq=180
I3 phase=-56 freq=300

SIN sources not admit phase option. I try with generator function:

.gen ampl=10 phase=-10 freq=60
I1 n1 n2 generator(1)
.gen ampl=15 phase=150 freq=180
I1 n2 n3 generator(2)
etc.

but I see that generator don't work in this way.

I look for in the net without sucess. I see that in AC analysis is
possible, but I need to do in transient analysis.

There are anyway to do this?

Thanks so much in advance.

Salud y Revolución.

Lobo.
--
Libertad es poder elegir en cualquier momento. Ahora yo elijo GNU/Linux,
para no atar mis manos con las cadenas del soft propietario.
---------
Desde El Ejido, en Almería, usuario registrado Linux #294013
http://www.counter.li.org


_______________________________________________
Help-gnucap mailing list
Help-gnucap@...
http://lists.gnu.org/mailman/listinfo/help-gnucap

Re: howto use different phase and frequency in sources for transient analysis?

by al davis-13 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Saturday 17 October 2009, Rubén Gómez Antolí wrote:
> I need to specify different phases in sources in this way:
>
> I1 phase=-10 freq=60
> I2 phase=150 freq=180
> I3 phase=-56 freq=300
>
> SIN sources not admit phase option.

> I try with generator function:
> .gen ampl=10 phase=-10 freq=60
> I1 n1 n2 generator(1)
> .gen ampl=15 phase=150 freq=180
> I1 n2 n3 generator(2)
> etc.
>
> but I see that generator don't work in this way.

You are correct .. It don't work in this way.
 
> I look for in the net without sucess. I see that in AC
>  analysis is possible, but I need to do in transient
>  analysis.
>
> There are anyway to do this?

What is the meaning of phase in transient analysis, when you
have different frequencies?  The phase relationship between them
is always changing.  I suppose it could be the phase at time=0,
and translate to delay.

What you do have is "delay".  You can get what you want with SIN
source, specifying a delay in seconds.

try delay={(phase/360)/frequency}


_______________________________________________
Help-gnucap mailing list
Help-gnucap@...
http://lists.gnu.org/mailman/listinfo/help-gnucap

Re: howto use different phase and frequency in sources for transient analysis?

by Rubén Gómez Antolí :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello al:

al davis escribió:

> On Saturday 17 October 2009, Rubén Gómez Antolí wrote:
>> I need to specify different phases in sources in this way:
>>
>> I1 phase=-10 freq=60
>> I2 phase=150 freq=180
>> I3 phase=-56 freq=300
>>
>> SIN sources not admit phase option.
>
>> I try with generator function:
>> .gen ampl=10 phase=-10 freq=60
>> I1 n1 n2 generator(1)
>> .gen ampl=15 phase=150 freq=180
>> I1 n2 n3 generator(2)
>> etc.
>>
>> but I see that generator don't work in this way.
>
> You are correct .. It don't work in this way.
>  
>> I look for in the net without sucess. I see that in AC
>>  analysis is possible, but I need to do in transient
>>  analysis.
>>
>> There are anyway to do this?
>
> What is the meaning of phase in transient analysis, when you
> have different frequencies?  The phase relationship between them
> is always changing.  I suppose it could be the phase at time=0,
> and translate to delay.

It's an class exercise based on a example from Power Electronics's Mohan
book.

I'm checking the harmonic current influence in circuit.

In a previous Fourier analisys I get phase and frequency of currents for
1, 3 and 5 harmonic:

# i(LS)     --------- actual ---------  -------- relative --------
#freq       value        dB      phase  value        dB      phase
  0.         0.0063273  -43.98   90.000  405.58E-6  -67.84  100.271
  60.        15.601      23.86  -10.271  1.           0.00   -0.000
  120.       0.011073   -39.11  -92.415  709.79E-6  -62.98  -82.144
  180.       11.821      21.45  148.226  0.75772     -2.41  158.497
  240.       0.0071613  -42.90   85.933  459.04E-6  -66.76   96.205
  300.       6.3621      16.07  -57.484  0.40781     -7.79  -47.213

Then, I put three current sources in the original circuit, which was
thought to be used in Pspice format, for this reason this phase value. :^(

> What you do have is "delay".  You can get what you want with SIN
> source, specifying a delay in seconds.
>
> try delay={(phase/360)/frequency}

I try with it:

1· I obtained the "correct" waves for I1, I3 and I5.

2· I can't obtain the "correct" wave for I(LS).

I think there is something wrong in circuit, but I'm not sure. Here are
the circuit:


DBRECT1A.CIR
* Single-Phase, Diode-Bridge Rectifier
* Fourier components of i(LS) are included as I1, I2 and I3.
* Power Electronics: Simulation, Analysis & Education.....by N. Mohan.
.SUBCKT DIODE_WITH_SNUB 101 103

DX      101 102   POWER_DIODE
RSNUB   102 103   1000.0
CSNUB   103 101   0.01uF
.MODEL  POWER_DIODE  D( RS=0.01, CJO=100pF )

.ENDS DIODE_WITH_SNUB

.PARAM  FASE1 = -10.04
.PARAM  FASE2 =  148.9
.PARAM  FASE3 = -56.39
.PARAM   FREQ0 =  60.0Hz
.PARAM   FREQ1 =  60.0Hz
.PARAM   FREQ2 = 180.0Hz
.PARAM   FREQ3 = 300.0Hz
.PARAM  RETRASO1={(FASE1/360)/FREQ1}
.PARAM  RETRASO2={(FASE2/360)/FREQ2}
.PARAM  RETRASO3={(FASE3/360)/FREQ3}

LS       1  2  1mH
RS       2  3  1m

LD       4  5  1uH
RLOAD    5  6  20.0
CD       5  6  1000uF IC=160V

XD1      3  4  DIODE_WITH_SNUB
XD3      0  4  DIODE_WITH_SNUB
XD2      6  0  DIODE_WITH_SNUB
XD4      6  3  DIODE_WITH_SNUB

VS       1  0  SIN(0 170V {FREQ0} 0 0)

I1       7  0  SIN(0 15.35A {FREQ1}  {RETRASO1} 0)
I3       8  0  SIN(0 11.74A {FREQ2}  {RETRASO2} 0)
I5       9  0  SIN(0 6.482A {FREQ3}  {RETRASO3} 0)

R1       7  0  1.0
R3       8  0  1.0
R5       9  0  1.0

.END

What do you think about this?

Regards.

Salud y Revolución.

Lobo.

--
Libertad es poder elegir en cualquier momento. Ahora yo elijo GNU/Linux,
para no atar mis manos con las cadenas del soft propietario.
---------
Desde El Ejido, en Almería, usuario registrado Linux #294013
http://www.counter.li.org


_______________________________________________
Help-gnucap mailing list
Help-gnucap@...
http://lists.gnu.org/mailman/listinfo/help-gnucap

Re: howto use different phase and frequency in sources for transient analysis?

by al davis-13 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Quick answer ..   I will get back with more details in a few
days.

What is the Pspice syntax for specifying phase on a "sin"
source?  It's not in Berkeley spice.

It would be just another way to specify the delay ... the phase
at time = 0.

I just did find a bug in the way the Fourier command computes
relative phase.


Notation:
"ap[2]" is the absolute phase of harmonic#2
"rp[2]" is the relative phase
hn is harmonic number

The way it is:
for (hn=0; hn<=stop; ++hn) {
    rp[hn] = ap[hn] - ap[1];
}
   
The way it should be:
for (hn=0; hn<=stop; ++hn) {
    rp[hn] = ap[hn] - (hn *ap[1]);
}
   
But that is not the problem you saw.

The absolute phase you see in a Fourier analysis is referenced
to the start of the interval, so it will be different on
different runs depending on the starting time.  It does appear
to be correct, from that perspective.

That really doesn't matter.  It is just a time shift.

I think the reason your waveform built from the sum of sources
doesn't match the signal you took the Fourier transform of  is
that you are only using up to the fifth harmonic, so there is a
lot missing.

Also, the circuit doesn't look correct, but that could be due to
partial cut and paste errors.


_______________________________________________
Help-gnucap mailing list
Help-gnucap@...
http://lists.gnu.org/mailman/listinfo/help-gnucap

Re: howto use different phase and frequency in sources for transient analysis?

by Rubén Gómez Antolí :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello al:

al davis escribió:
> Quick answer ..   I will get back with more details in a few
> days.

Ok, We wait for these details.

> What is the Pspice syntax for specifying phase on a "sin"
> source?  It's not in Berkeley spice.

There is the usual custom for propietary apps: deform the standard to
complicate the competence (like HTML's IE tags, for example):

http://www.uta.edu/ee/hw/pspice/pspice08.htm

Here are the 90% of my problems: exercises thought for Pspice with
incompatible syntax for free engines like Gnucap or Ngspice; or model,
macromodel for Pspice (like thyristor, UJT...) with a difficult -or
imposible for a newbie, like me- way to translate to Berkeley spice.

> It would be just another way to specify the delay ... the phase
> at time = 0.
>
> I just did find a bug in the way the Fourier command computes
> relative phase.
>
> (...)
>    
> But that is not the problem you saw.
>

Ok.

> The absolute phase you see in a Fourier analysis is referenced
> to the start of the interval, so it will be different on
> different runs depending on the starting time.  It does appear
> to be correct, from that perspective.
>
> That really doesn't matter.  It is just a time shift.
>
> I think the reason your waveform built from the sum of sources
> doesn't match the signal you took the Fourier transform of  is
> that you are only using up to the fifth harmonic, so there is a
> lot missing.

Perhaps I should explain a bit more:

Start with a Diode brigde rectifier and do a Fourier analysis:

# i(LS)     --------- actual ---------  -------- relative --------
#freq       value        dB      phase  value        dB      phase
  0.         0.0063273  -43.98   90.000  405.58E-6  -67.84  100.271
  60.        15.601      23.86  -10.271  1.           0.00   -0.000
  120.       0.011073   -39.11  -92.415  709.79E-6  -62.98  -82.144
  180.       11.821      21.45  148.226  0.75772     -2.41  158.497
  240.       0.0071613  -42.90   85.933  459.04E-6  -66.76   96.205
  300.       6.3621      16.07  -57.484  0.40781     -7.79  -47.213
  360.       0.0028582  -50.88  -93.075  183.21E-6  -74.74  -82.804
  420.       2.009        6.06   77.596  0.12877    -17.80   87.867
  480.       189.74E-6  -74.44 -162.004  12.162E-6  -98.30 -151.732
  540.       0.94716     -0.47  143.495  0.060713   -24.33  153.766

and transient analysis for view i(VS).

Next exercise: check grafically source current i(VS) how sum of
fundamental and two first harmonics (3 and 5).

I obtain the three currents well, something "displaced" compare with
Pspice output.

But i(VS) is not the wave expected.

> Also, the circuit doesn't look correct, but that could be due to
> partial cut and paste errors.

There are no errors in paste circuit, I'm sure now that circuit is not
correct; this is my fault: I should work on it a bit more.

Thanks so much for your fast answer.

Regards.

Salud y Revolución.

Lobo.
--
Libertad es poder elegir en cualquier momento. Ahora yo elijo GNU/Linux,
para no atar mis manos con las cadenas del soft propietario.
---------
Desde El Ejido, en Almería, usuario registrado Linux #294013
http://www.counter.li.org


_______________________________________________
Help-gnucap mailing list
Help-gnucap@...
http://lists.gnu.org/mailman/listinfo/help-gnucap