[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Coupling vs secondary voltage chart
- To: tesla@xxxxxxxxxx
- Subject: Re: Coupling vs secondary voltage chart
- From: "Tesla list" <tesla@xxxxxxxxxx>
- Date: Sat, 18 Jun 2005 10:12:44 -0600
- Delivered-to: testla@pupman.com
- Delivered-to: tesla@pupman.com
- Old-return-path: <teslalist@twfpowerelectronics.com>
- Resent-date: Sat, 18 Jun 2005 10:13:26 -0600 (MDT)
- Resent-from: tesla@xxxxxxxxxx
- Resent-message-id: <wuEaV.A.b5D.jgEtCB@poodle>
- Resent-sender: tesla-request@xxxxxxxxxx
Original poster: "Antonio Carlos M. de Queiroz" <acmdq@xxxxxxxxxx>
Tesla list wrote:
Original poster: Terry Fritz <teslalist@xxxxxxxxxxxxxxxxxxxxxxx>
Hi Steve,
I am using primary feedback.
==========
for (T1 = T1_start; T1 <= T1_stop; T1 = T1 + T1_inc)
{
if (X0[4] >= 0) Vin=Vrail; else Vin=-Vrail; //inputs Vin for DRSSTC case
if (T1 > DwellTime) Vin = 0.0;
.
.
.
==========
Looking at the code, I see a (small) problem:
/* X1=X0+(dt/2)*[A]*X0+(dt/2)*B*(vin(t0)+vin(t0+dt)) */
for (j=1; j<6; j++) {
X1[j]=X0[j];
for (k=1; k<6; k++) X1[j]+=(T1_inc/2)*(A[j][k]*X0[k]);
X1[j]+=(T1_inc/2)*B[j]*(Vin+Vin);
}
The "Vin+Vin" should be something as "LastVin + NewVin".
In this way there is an integration error added at each transition.
A better version could be something as:
LastVin=0;
...
Compute NewVin
In the j loop: ...LastVin+NewVin...
At the end of the time loop:
LastVin=NewVin;
The term T1_inc/2 could be precomputed. But probably code optimization
already does this.
Antonio Carlos M. de Queiroz