error C2296: '^' : illegal, left operand has type‘double’ 帮我看看怎么回事啊,很急。。。。
voidU3F(doubleU[3],doublef1[3],doublef2[3]){doublea,p,u;u=U[1]/U[0];p=(GAMA-1)*(U[2]-...
void U3F(double U[3],double f1[3],double f2[3])
{
double a,p,u;
u=U[1]/U[0];
p=(GAMA-1)*(U[2]-0.5*U[1]*U[1]/U[0]);
a=GAMA*p/U[0];
if (fabs(u)<a)
{
f1[0]=U[0]/2/GAMA*((2*GAMA-1)*u+a);
f1[1]=U[0]/2/GAMA*(2*(GAMA-1)*u*u+a);
f1[2]=(U[0]/2/GAMA*((GAMA-1))*(u^3)+0.5*((u+a)^3)+(3-GAMA)*(u+a)*a*a/2/(GAMA-1));
f2[0]=U[0]/2/GAMA*(u-a);
f2[1]=U[0]/2/GAMA*(u-a)^2;
f2[2]=U[0]/2/GAMA*(0.5*(u-a)^3+(3-GAMA)*(u-a)*a*a/2/(GAMA-1));
}
else
{
U2E(U,f1);
f2[0]=1e-100;f2[1]=1e-100;f2[2]=1e-100;
}
}
error C2296: '^' : illegal, left operand has type‘double’ 展开
{
double a,p,u;
u=U[1]/U[0];
p=(GAMA-1)*(U[2]-0.5*U[1]*U[1]/U[0]);
a=GAMA*p/U[0];
if (fabs(u)<a)
{
f1[0]=U[0]/2/GAMA*((2*GAMA-1)*u+a);
f1[1]=U[0]/2/GAMA*(2*(GAMA-1)*u*u+a);
f1[2]=(U[0]/2/GAMA*((GAMA-1))*(u^3)+0.5*((u+a)^3)+(3-GAMA)*(u+a)*a*a/2/(GAMA-1));
f2[0]=U[0]/2/GAMA*(u-a);
f2[1]=U[0]/2/GAMA*(u-a)^2;
f2[2]=U[0]/2/GAMA*(0.5*(u-a)^3+(3-GAMA)*(u-a)*a*a/2/(GAMA-1));
}
else
{
U2E(U,f1);
f2[0]=1e-100;f2[1]=1e-100;f2[2]=1e-100;
}
}
error C2296: '^' : illegal, left operand has type‘double’ 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询