funmod=modul(Fbetatau);
fprintf(out,"Модуль Fbetatau: %lf\n",funmod);
funmod=modul(Wregtauos);
fprintf(out,"Модуль Wregtauos: %lf\n",funmod);
funmod=modul(Wftau);
fprintf(out,"Модуль Wftau: %lf\n",funmod);
funmod=modul(Wuostau);
fprintf(out,"Модуль Wuostau: %lf\n",funmod);
break;
case 4:
funper=Fbetac*Wregcos*Kduc*Wfc*Wuosc*Kyc1;
funmod=modul(funper);
uap=mlc*Rc2*Kyc1/(9.8*Kdmc);
bpc=2.06e5*uap/funmod;
fprintf(out,"Уровень сигнала betaп для центростремительного акселерометра: %lf дуг. сек.\n",bpc);
funmod=modul(Fbetac);
fprintf(out,"Модуль Fbetac: %lf\n",funmod);
funmod=modul(Wregcos);
fprintf(out,"Модуль Wregcos: %lf\n",funmod);
funmod=modul(Wfc);
fprintf(out,"Модуль Wfc: %lf\n",funmod);
funmod=modul(Wuosc);
fprintf(out,"Модуль Wuosc: %lf\n",funmod);
break;
default: exit(1);
}
break;
default: exit(1);
}
}
void fun0 (void) //{основная функция}
{
s=complex(0,nom);
fun1();
fun2();
fun3();
fun4();
fun5();
fun6();
fun7();
fun8();(sup)
{
case 1: switch (nom_fun)
{
case 1:c=Wrs1;break;
case 2:c=Wrs2;break;
case 3:c=Falfa;break;
case 4:c=Falfa_;break;
case 5:c=Fbeta1;break;
case 6:c=Fbeta2;break;
case 7:c=Fbetatau;break;
case 8:c=Fbetac;break;
case 9:c=Wreg1st;break;
case 10:c=Wregtaust;break;
case 11:c=Wregtaust_;break;
case 12:c=Wregcst;break;
case 13:c=Wk1;break;
case 14:c=Wktau;break;
case 15:c=Wktau1;break;
case 16:c=Wkc;break;
// case 17:c=Wregcst;break;
default: exit(1);
}
break;2: switch (nom_fun)
{
case 1:c=W11;break;
case 2:c=W12;break;
case 3:c=W13;break;
case 4:c=W14;break;
case 5:c=W21;break;
case 6:c=W22;break;
case 7:c=W23;break;
case 8:c=W24;break;
case 9:c=W31;break;
case 10:c=W32;break;
case 11:c=W33;break;
case 12:c=W34;break;
case 13:c=W41;break;
case 14:c=W42;break;
case 15:c=W43;break;
case 16:c=W44;break;
case 17:c=W51;break;
case 18:c=W52;break;
case 19:c=W53;break;
case 20:c=W54;break;
case 21:c=Fzs1;break;
default: exit(1);
}
break;3: switch (nom_fun)
{
case 1:c=W11_;break;
case 2:c=W12_;break;
case 3:c=W13_;break;
case 4:c=W14_;break;
case 5:c=W21_;break;
case 6:c=W22_;break;
case 7:c=W23_;break;
case 8:c=W24_;break;
case 9:c=W31_;break;
case 10:c=W32_;break;
case 11:c=W33_;break;
case 12:c=W34_;break;
case 13:c=W41_;break;
case 14:c=W42_;break;
case 15:c=W43_;break;
case 16:c=W44_;break;
case 17:c=W51_;break;
case 18:c=W52_;break;
case 19:c=W53_;break;
case 20:c=W54_;break;
case 21:c=Fzs2;break;
default: exit(1);
}
break;
default: exit(1);
}
}
complex popravka(complex wr,float dob)
{ complex k;
int i,j;
if (dob<0) j=-1;else j=1;
if (dob==0) j=0;
dob=abs(dob);
k=complex(0,nom);
for(i=2;i<=dob;i++)
{
k=k*k;
}
if (j>0) wr=wr*k;
else if (j<0) wr=wr/k;
return(wr);
}pechat(char *ss,complex wr,float dob)
{re,co,n1,F,F1,Am,Am20l;wr1;
wr1=wr;
wr=popravka(wr,dob);
re=real(wr); co=imag(wr);
Am=sqrt(re*re+co*co);
Am20l=20*log10(Am);
n1=nom/(2*pi);
fprintf(out,"%8.3f %8.3f %16.6f %12.6f ",nom,n1,Am,Am20l);
F=co/re;
F=atan(F);
F=F*57.3;
if (strstr(ss," ")!=NULL)
{ F1=imag(wr1)/real(wr1);
F1=atan(F1);
F1=(6.28*countround+3.14/2*(-2*(1-naprav)+(sector-fmod((double)sector,(double)2)))+F1)*57.3;
fprintf(out,"%16.6f %16.6f %16.6f %16.6f\n",F1+90*dob,re,co,F);}
else fprintf(out,"\n");
}modul(complex wr1)
{double re,co;
// complex wr1;
re=real(wr1); co=imag(wr1);
return(sqrt(re*re+co*co));
}main (void)
{*s1;
s1="stend.dat";//Исходные данные для режима 1
//s1="stenddva.dat";//Исходные данные для режима 2
if ((out = fopen("res.dat", "wt")) == NULL)
{
fprintf(stderr, "Не могу открыть файл.\n");
exit(1);
}
if ((in = fopen( s1, "rt")) == NULL)
{
fprintf(stderr, "Не могу открыть файл.\n");
exit(1);
}
printf("\n Расчет уровня betaп - 1 или АЧХ-любая другая цифра : ");
scanf("%i",&supp);
if(supp==1) goto l1;
printf("\nЗадайте начальную частоту в 1/сек (w) : ");
scanf("%lf",&wbeg);