PSCAD 自定义没有报错 但是输出不正常
本帖最后由 vince9501 于 2011-12-11 17:45 编辑#include"math.h"
typedef double real;
void mp_ptd__(real* arg1,real* arg2,real* arg3,real* res)
{
real V0=(*arg3);
real c1=0.000003;
real c2=0.07872;
real Voc=21.1;
real Isc=3.864;
real DT=(*arg1)-25;
real DI=0.00065*((*arg2)/1000)*DT+((*arg2)/1000-1)*3.846;
real DV=-0.08*DT-(-3.4872)*DI;
real esp=0.001;
real V={0};
real cn=1;
int i=0;
while(fabs(cn)>esp*V)
{
i++;
V=V-(Isc*(1+c1-c1*exp((V-DV)/(c2*Voc))-c1*V*exp((V -DV)/(c2*Voc)/(c2*Voc))))/(-(2*c1*exp((V-DV)/(c2*Voc))/ (c2*Voc)+V*c1*exp((V-DV)/(c2*Voc))/((c2*Voc)*(c2*Voc))));
cn=V-V;
(*res)=V;
}
}
调试没有报错,但是得不到输出,请指教。 这是要做什么?保护的判据么? 回复 2# sunek
信号跟踪 cn和esp 作为精度。。。
页:
[1]