// wetdog4.cpp July 5, 2002 // wetdog3 July 4 - generalize to order n // wetdog2.cpp July 3, 2002 Find beta for wet dog mode exactly, // find finding zeroes in the strain matrix. #include #include #include #include #include double LegenP(int n,double x); double SphBess1j(int n,double x); double SeriesSphBess1j(int n,double x); double factorial(double arg); void EvalWetDog_u(double x1,double y1,double z1); double ang_delta,wdX,wdY,wdZ; double divm[3][3]; double emat[3][3]; int nn; int showpartialresults; double dtheta=0.001; double dx=0.0003; void main(void) { // main clrscr(); cout.precision(5); gotoxy(1,1);cout<<"wetdog4.cpp Find exact solutions for the wet dog mode..."; gotoxy(2,4);cout<<" (The order can be 1, 2, 3, 4 or 5) "; gotoxy(2,2);cout<<"What is the order n? ";cin>>nn; gotoxy(2,4);cout<<" "; if (nn<0) return; double X,y1,z1; ang_delta=3.1415926*(39.0/180.0); LB1: gotoxy(1,3);cout<<"X? (enter X=-1 to quit) "; gotoxy(1,4);cout<<" (Enter a (positive) guess for frequency beta of the mode.) "; gotoxy(1,3);cout<<"X? ";cin>>X; gotoxy(1,4);cout<<" "; gotoxy(1,3);cout<<"X = "<biggeststraincomp) biggeststraincomp=fabs(emat[i1][i2]); gotoxy(10+13*i1,19+i2);cout<14) {cout<<"x ="<0) theta2=atan(sqrt(x2*x2+y2*y2)/z2); if (z2<0) theta2=3.1415926-atan(sqrt(x2*x2+y2*y2)/fabs(z2)); } // phi2=0; if (x2!=0) { // if (x2>0) phi2=atan(y2/x2); if (x2<0) phi2=3.1415926+atan(y2/x2); } // else { // if (y2>0) phi2= 3.1415926*0.5; if (y2<0) phi2=-3.1415926*0.5; }// if (showpartialresults==1) { // . gotoxy(1,8);cout<<"Step 3: Convert to spherical coordinates "; gotoxy(1,9);cout<<"r="<