• 回复
  • 收藏
  • 点赞
  • 分享
  • 发新帖

求boost PFC的matlab仿真程序

求一个boost PFC的matlab仿真程序.

谢谢!

我的邮箱是bkq7758@sina.com
全部回复(11)
正序查看
倒序查看
bkq7758
LV.4
2
2009-05-08 16:21
没有人搞过???那有没有人有关于boost pfc的数学建模呢?
0
回复
剑心
LV.8
3
2009-05-08 17:00
@bkq7758
没有人搞过???那有没有人有关于boostpfc的数学建模呢?
有flyback的C仿真程序,要吗?
0
回复
gardenyu
LV.1
4
2009-05-12 06:46
@剑心
有flyback的C仿真程序,要吗?
您好,能不能给我一份你的C仿真程序?
0
回复
gardenyu
LV.1
5
2009-05-12 06:47
@gardenyu
您好,能不能给我一份你的C仿真程序?
gardenyu2004@hotmail.com
0
回复
2009-07-03 13:19
@gardenyu
gardenyu2004@hotmail.com
能否给我一份...谢谢啊...邮箱:hutianwww@163.com
0
回复
2009-07-03 13:20
你有没有了啊...可不可以给我发一份啊..谢谢.邮箱:hutianwww@163.com
0
回复
bkq7758
LV.4
8
2009-07-08 21:18
@youdeworld
你有没有了啊...可不可以给我发一份啊..谢谢.邮箱:hutianwww@163.com
有一个,我从别人的论文里面提出来的
0
回复
剑心
LV.8
9
2009-07-27 22:34
@youdeworld
能否给我一份...谢谢啊...邮箱:hutianwww@163.com
#include"stdio.h"
#include"conio.h"
#include"stdlib.h"
#include"math.h"

#define REAL double
#define ICBOOL char
#define ICREG  int

/*******************************data structure defination*************************************/
//simulator timing
struct simtime{
REAL dt;long int nstep;REAL tmax;long int nmax; //analog simulator time step
REAL clkdt;int nclkdt; //length of digital clock cycle
};

//analog components
struct analogparam{REAL transratio; REAL ll; REAL lm; REAL c1; REAL c2; REAL r1; REAL r2;};
struct analogstate{REAL ill;REAL ilm;REAL vc1;REAL vc2;REAL vs1;REAL vs2;REAL is1;REAL is2; REAL vi; REAL vo;};

//IC, pwm for test
struct iostate{ICBOOL mosdrv;};
struct pwmgen{REAL period;REAL pw;ICREG nperiod;ICREG npw;ICREG ncount;};


/*************************************time step advance****************************************/
void analogdt(struct simtime *stime,struct analogparam *aparam,struct analogstate *astate,struct iostate *ios)
{
REAL dt,transratio,ll,lm,c1,c2,r1,r2; //param
REAL ill,ilm,vc1,vc2,vs1,vs2,is1,is2,vi,vo; //state

//param
dt=stime->dt;
transratio=aparam->transratio;
ll=aparam->ll;
lm=aparam->lm;
c1=aparam->c1;
c2=aparam->c2;
r1=aparam->r1;
r2=aparam->r2;

//state
ill=astate->ill;
ilm=astate->ilm;
vc1=astate->vc1;
vc2=astate->vc2;
vs1=astate->vs1;
vs2=astate->vs2;
is1=astate->is1;
is2=astate->is2;
vi=astate->vi;
vo=astate->vo;

//switches DC operating point
if(ios->mosdrv)
{
astate->vs1=0.0;
astate->is1=ill+vc1/r1;
}
else
{
vs1=r1*ill+vc1;
vs1=0.5*(vs1+fabs(vs1)); //max(value,0), >=0, body diode on=0
astate->vs1=vs1;
is1=ill+vc1/r1;
is1=0.5*(is1-fabs(is1)); //min(value,0), <=0, body diode off=0
astate->is1=is1;
}
vs2=vc2+transratio*(ill-ilm)*r2;
vs2=0.5*(vs2+fabs(vs2)); //max(value,0), >=0, diode off=0
astate->vs2=vs2;
is2=-transratio*(ill-ilm)-vc2/r2;
is2=0.5*(is2+fabs(is2)); //max(value,0), >=0, diode on=0
astate->is2=is2;

//differential
astate->ill=ill+ dt*(vi-vs1+transratio*(vo-vs2))/ll;
astate->ilm=ilm+ dt*-1*transratio*(vo-vs2)/lm;
astate->vc1=vc1+ dt*(ill-is1)/c1;
astate->vc2=vc2+ dt*(is2+transratio*(ill-ilm))/c2;

//switches DC operating point
if(ios->mosdrv)
{
astate->vs1=0.0;
astate->is1=ill+vc1/r1;
}
else
{
vs1=r1*ill+vc1;
vs1=0.5*(vs1+fabs(vs1)); //max(value,0), >=0, body diode on=0
astate->vs1=vs1;
is1=ill+vc1/r1;
is1=0.5*(is1-fabs(is1)); //min(value,0), <=0, body diode off=0
astate->is1=is1;
}
vs2=vc2+transratio*(ill-ilm)*r2;
vs2=0.5*(vs2+fabs(vs2)); //max(value,0), >=0, diode off=0
astate->vs2=vs2;
is2=-transratio*(ill-ilm)-vc2/r2;
is2=0.5*(is2+fabs(is2)); //max(value,0), >=0, diode on=0
astate->is2=is2;
}


/*************************************pwm for test**********************************************/
void pwmtest(struct pwmgen *pwm,struct iostate *ios)
{
ios->mosdrv=0;
if(pwm->ncountnpw) ios->mosdrv=1;
pwm->ncount++;
if(pwm->ncount>=pwm->nperiod) pwm->ncount=0;
}

/******************************************init*************************************************/
void init(struct simtime *stime,struct analogparam *aparam,struct analogstate *astate,struct pwmgen *pwm)
{
stime->clkdt=1e-8;
stime->dt=1e-9;
stime->nclkdt=stime->clkdt/stime->dt;
stime->tmax=3e-5;
stime->nmax=stime->tmax/stime->dt;
stime->nstep=0;

aparam->transratio=10.0;
aparam->lm=200e-6;
aparam->ll=aparam->lm/100.0;
aparam->c1=1e-9;
aparam->c2=1e-9;
aparam->r1=100.0;
aparam->r2=10.0;

astate->vi=310;
astate->vo=12;
astate->vc1=astate->vi;
astate->vc2=astate->vo;
astate->vs1=astate->vi;
astate->vs2=astate->vo;
astate->ill=0;
astate->ilm=0;
astate->is1=0;
astate->is2=0;

pwm->period=1e-5;
pwm->pw=2e-6;
pwm->nperiod=pwm->period/stime->clkdt;
pwm->npw=pwm->pw/stime->clkdt;
pwm->ncount=0;
}

/*****************************************main**************************************************/
void main(void)
{
struct simtime stime;
struct analogparam aparam;
struct analogstate astate;
struct iostate ios;
struct pwmgen pwm;
FILE *fp;

if((fp=fopen("out.plt","w"))==NULL){printf("file open error");exit(0);}
fprintf(fp,"variables=time,ill,ilm,vc1,vc2,vs1,vs2,is1,is2\n");

init(&stime,&aparam,&astate,&pwm);
for(stime.nstep=1;stime.nstep<=stime.nmax;stime.nstep++)
{
if(stime.nstep%stime.nclkdt==0) pwmtest(&pwm,&ios);
analogdt(&stime,&aparam,&astate,&ios);
// printf("%d\n",nstep);
fprintf(fp,"%e %f %f %f %f %f %f %f %f\n",stime.dt*stime.nstep,astate.ill,astate.ilm,astate.vc1,astate.vc2,astate.vs1,astate.vs2,astate.is1,astate.is2);
}
fclose(fp);
}
0
回复
zzoo00
LV.3
10
2009-08-14 05:26
社区论坛 〉  电源技术综合区
0
回复
2014-03-30 22:30
@bkq7758
没有人搞过???那有没有人有关于boostpfc的数学建模呢?

求楼主及各位大神、前辈能否发给我一份呢,谢谢!

ambdrafam@163.com

0
回复
2014-03-30 22:31
@bkq7758
有一个,我从别人的论文里面提出来的

求楼主及各位大神、前辈能否发给我一份呢,谢谢!

ambdrafam@163.com

0
回复