C语言编程出现错误,'main' : not in formal parameter list
C语言编程出现错误,'main':notinformalparameterlist我是用C语言生成DLL,嵌入到PSIM里面完成的,不需要输出,谢谢各位了,回答的好的追加...
C语言编程出现错误,'main' : not in formal parameter list
我是用C语言生成DLL,嵌入到PSIM里面完成的,不需要输出,谢谢各位了,回答的好的追加得分
程序如下
#include<stdio.h>
#include<math.h>
__declspec(dllexport) void simuser (t, delt, in, out)
#define N 100
double *in, *out;
void main;
{
int i;
double ids[N+2],iqs[N+2],idm[N+2],iqm[N+2],dr[N+2],qr[N+2];
double Rs,Rr,Rfe,Ls,Lr,Los,Lor,Lm,We,Wr,Uds,Uqs,Te,P,J,Pn,Un,In,fn,o,Tn,nN,idr,iqr,f;
Pn=1100,Un=380,In=2.67,fn=50,Rs=5.27,Rr=5.07,Rfe=1370,Ls=0.479,Lm=0.421,o=0.125,Tn=7.45,J=0.05,P=2,nN=1410,Los=0.01,Lor=0.01,f=50,Lr=0.479;
for (i=0;i<=N;i++)
{Uds=in[0];
Uqs=in[1];
ids[i]=in[2];
iqs[i]=in[3];
idm[i]=in[4];
iqm[i]=in[5];
idr=in[6];
iqr=in[7];
dr[i]=Ls*ids[i]+Lm*idr;
qr[i]=Lm*iqs[i]+Lr*iqr;
Wr=nN;
We=(60*f)/P;
ids[i+2]=((-(Rs+Rfe)/Los)*ids[i+1]+We*iqs[i+1]+(Lr*Rfe)/(Los*Lor)*idm[i+1]-(Rfe/(Los*Lor))*dr[i+1])-((-(Rs+Rfe)/Los)*ids[i]+We*iqs[i]+(Lr*Rfe)/(Los*Lor)*idm[i]-(Rfe/(Los*Lor))*(int)dr[i])+Uds/Los;
iqs[i+2]=(-We*ids[i+1]-((Rs+Rfe)/Los)*iqs[i+1]+((Lr*Rfe)/(Los*Lor))*iqm[i+1]-(Rfe/(Los*Lor))*qr[i+1])-(-We*ids[i]-((Rs+Rfe)/Los)*iqs[i]+((Lr*Rfe)/(Los*Lor))*iqm[i]-(Rfe/(Los*Lor))*qr[i])+Uqs/Los;
idm[i+2]=((Rfe/Lm)*ids[i+1]-((Lr*Rfe)/(Lm*Lor))*idm[i+1]+We*iqm[i+1]+(Rfe/(Los*Lor))*dr[i+1])-((Rfe/Lm)*ids[i+1]-((Lr*Rfe)/(Lm*Lor))*idm[i]+We*iqm[i]+(Rfe/(Los*Lor))*dr[i]);
iqm[i+2]=((Rfe/Lm)*iqs[i+1]-We*idm[i+1]-((Lr*Rfe)/(Lm*Lor))*iqm[i+1]+(Rfe/(Lm*Lor))*qr[i+1])-((Rfe/Lm)*iqs[i]-We*idm[i]-((Lr*Rfe)/(Lm*Lor))*iqm[i]+(Rfe/(Lm*Lor))*qr[i]);
dr[i+2]=(((Lm*Rr)/Lor)*idm[i+1]-(((Lm*Rr)/(Lr*Lor))+Rr/Lr)*dr[i+1]+(We-Wr)*qr[i+1])-(((Lm*Rr)/Lor)*idm[i]-(((Lm*Rr)/(Lr*Lor))+Rr/Lr)*dr[i]+(We-Wr)*qr[i]);
qr[i+2]=(((Lm*Rr)/Los)*iqm[i+1]-(We-Wr)*dr[i+1]-(((Lm*Rr)/(Lr*Lor))+Rr/Lr)*qr[i+1])-(((Lm*Rr)/Los)*iqm[i]-(We-Wr)*dr[i]-(((Lm*Rr)/(Lr*Lor))+Rr/Lr)*qr[i]);
Te=((P*Lm)/Lor)*(iqm[i+1]*dr[i+1]-idm[i+1]*qr[i+1]);
}
out[0]=ids[i+2];
out[1]=iqs[i+2];
out[2]=idm[i+2];
out[3]=iqm[i+2];
out[4]=dr[i+2];
out[5]=qr[i+2];
out[6]=Te;
} 展开
我是用C语言生成DLL,嵌入到PSIM里面完成的,不需要输出,谢谢各位了,回答的好的追加得分
程序如下
#include<stdio.h>
#include<math.h>
__declspec(dllexport) void simuser (t, delt, in, out)
#define N 100
double *in, *out;
void main;
{
int i;
double ids[N+2],iqs[N+2],idm[N+2],iqm[N+2],dr[N+2],qr[N+2];
double Rs,Rr,Rfe,Ls,Lr,Los,Lor,Lm,We,Wr,Uds,U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*Lor))*qr[i]);
dr[i+2]=(((Lm*Rr)/Lor)*idm[i+1]-(((Lm*Rr)/(Lr*Lor))+Rr/Lr)*dr[i+1]+(We-Wr)*qr[i+1])-(((Lm*Rr)/Lor)*idm[i]-(((Lm*Rr)/(Lr*Lor))+Rr/Lr)*dr[i]+(We-Wr)*qr[i]);
qr[i+2]=(((Lm*Rr)/Los)*iqm[i+1]-(We-Wr)*dr[i+1]-(((Lm*Rr)/(Lr*Lor))+Rr/Lr)*qr[i+1])-(((Lm*Rr)/Los)*iqm[i]-(We-Wr)*dr[i]-(((Lm*Rr)/(Lr*Lor))+Rr/Lr)*qr[i]);
Te=((P*Lm)/Lor)*(iqm[i+1]*dr[i+1]-idm[i+1]*qr[i+1]);
}
out[0]=ids[i+2];
out[1]=iqs[i+2];
out[2]=idm[i+2];
out[3]=iqm[i+2];
out[4]=dr[i+2];
out[5]=qr[i+2];
out[6]=Te;
} 展开
4个回答
展开全部
好难阿,我是不C#的,可是还是个初不者。
我是觉得 void Main 他是一个方法。
方法后面都该以()为后缀吧。
我是觉得 void Main 他是一个方法。
方法后面都该以()为后缀吧。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你的那个 void main;
这个后面多了个分号
这个后面多了个分号
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2010-04-26
展开全部
void main()
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询