607 #ifdef DEBUG_JACOBIAN_UNSTEADY
610 #endif // DEBUG_JACOBIAN_UNSTEADY
614 #ifdef DEBUG_JACOBIAN_UNSTEADY
616 #endif // DEBUG_JACOBIAN_UNSTEADY
622 #ifdef DEBUG_JACOBIAN_UNSTEADY
624 #endif // DEBUG_JACOBIAN_UNSTEADY
631 WorkMat.
IncCoef(iFirstSubIndex + 1, iFirstSubIndex + 1, 1.);
632 WorkMat.
IncCoef(iFirstSubIndex + 2, iFirstSubIndex + 2, 1.);
634 WorkMat.
IncCoef(iFirstSubIndex + 1, iFirstSubIndex + 2, -dCoef);
635 WorkMat.
IncCoef(iFirstSubIndex + 2, iFirstSubIndex + 1, dCoef*
b1*b2*d*d);
636 WorkMat.
IncCoef(iFirstSubIndex + 2, iFirstSubIndex + 2, dCoef*(
b1 + b2)*d);
646 dU_V_11 = (W[
VY] + W[
WZ]*
d34)/dDen34;
647 dU_V_12 = -W[
VX]/dDen34;
658 dU_W_13 = - W[
VX]*d34/dDen34;
668 for (iIndexColumn = 1; iIndexColumn <= vx.
iGetNumCols(); iIndexColumn++){
669 WorkMat.
IncCoef(iFirstSubIndex+2, iIndexColumn, dG_V_21*vx(1,iIndexColumn) + dG_V_22*vx(2,iIndexColumn));
670 WorkMat.
IncCoef(iFirstSubIndex+2, iIndexColumn, dG_W_23*wx(3,iIndexColumn));
685 WW[
VY] = -W[
VX]*tan_y1 - d34*W[
WZ];
693 if (qD > std::numeric_limits<doublereal>::epsilon()) {
725 fq.
Put(1, 1, (-L_q1*sin_alpha -D_q1*cos_alpha));
726 fq.
Put(1, 2, (-L_q2*sin_alpha -D_q2*cos_alpha));
727 fq.
Put(2, 1, (L_q1*cos_alpha -D_q1*sin_alpha));
728 fq.
Put(2, 2, (L_q2*cos_alpha -D_q2*sin_alpha));
730 cq.
Put(3, 1, (M_q1 +
d14*fq(2,1)));
731 cq.
Put(3, 2, (M_q2 +
d14*fq(2,2)));
738 dY_V_11 = (((
A1+
A2)*
b1*b2*d*(4./chord)*q1 + (
A1*
b1+
A2*
b2)*(2./chord)*q2)*W[
VX]/Uinf) + ((1-
A1-
A2)*dU_V_11);
739 dY_V_12 = (((
A1+
A2)*
b1*b2*d*(4./chord)*q1 + (
A1*
b1+
A2*
b2)*(2./chord)*q2)*W[VY]/Uinf) + ((1-
A1-
A2)*dU_V_12);
747 Jaero(1,1) = rho*chord*
cfx_0[i]*W[
VX] + qDc*( dCd_alpha*dY_V_11);
748 Jaero(1,2) = rho*chord*
cfx_0[i]*W[
VY] + qDc*( dCd_alpha*dY_V_12);
749 Jaero(1,3) = rho*chord*
cfx_0[i]*W[
VZ];
750 Jaero(2,1) = rho*chord*cy*W[
VX] + qDc*( dCl_alpha*dY_V_11 + dCfy_Uinf*W[
VX]/Uinf);
751 Jaero(2,2) = rho*chord*cy*W[
VY] + qDc*( dCl_alpha*dY_V_12 + dCfy_Uinf*W[
VY]/Uinf );
752 Jaero(2,3) = rho*chord*cy*W[
VZ];
753 Jaero(3,1) = rho*chord*cfz_0*W[
VX];
754 Jaero(3,1) = rho*chord*cfz_0*W[
VY];
755 Jaero(3,3) = rho*chord*cfz_0*W[
VZ];
758 Jaero(1,6) = qDc*dCd_alpha*(1.-
A1-
A2)*dU_W_13;
759 Jaero(2,6) = qDc*dCl_alpha*(1.-
A1-
A2)*dU_W_13;
766 Jaero(4,1) = rho*chord*chord*cmx_0*W[
VX];
767 Jaero(4,2) = rho*chord*chord*cmx_0*W[
VY];
768 Jaero(4,3) = rho*chord*chord*cmx_0*W[
VZ];
769 Jaero(5,1) = rho*chord*chord*cmy_0*W[
VX];
770 Jaero(5,2) = rho*chord*chord*cmy_0*W[
VY];
771 Jaero(5,3) = rho*chord*chord*cmy_0*W[
VZ];
772 Jaero(6,1) = rho*chord*chord*cmz*W[
VX] +qDc*chord*( dCm_alpha*dY_V_11 + dCmz_Uinf*W[
VX]/Uinf );
773 Jaero(6,2) = rho*chord*chord*cmz*W[
VY] +qDc*chord*( dCm_alpha*dY_V_12 + dCmz_Uinf*W[
VY]/Uinf );
774 Jaero(6,3) = rho*chord*chord*cmz*W[
VZ];
777 Jaero(6,6) = qDc*chord*dCm_alpha*(1.-
A1-
A2)*dU_W_13;
794 J(1,1) = -Jaero(2,1)*sin_alpha -Jaero(1,1)*cos_alpha - Lift*sin_alpha_vx - Drag*cos_alpha_vx;
795 J(1,2) = -Jaero(2,2)*sin_alpha -Jaero(1,2)*cos_alpha - Lift*sin_alpha_vy - Drag*cos_alpha_vy;
796 J(1,3) = -Jaero(2,3)*sin_alpha -Jaero(1,3)*cos_alpha;
797 J(1,6) = -Jaero(2,6)*sin_alpha -Jaero(1,6)*cos_alpha - Lift*sin_alpha_wz;
799 J(2,1) = Jaero(2,1)*cos_alpha -Jaero(1,1)*sin_alpha + Lift*cos_alpha_vx - Drag*sin_alpha_vx;
800 J(2,2) = Jaero(2,2)*cos_alpha -Jaero(1,2)*sin_alpha + Lift*cos_alpha_vy - Drag*sin_alpha_vy;
801 J(2,3) = Jaero(2,3)*cos_alpha -Jaero(1,3)*sin_alpha;
802 J(2,6) = Jaero(2,6)*cos_alpha -Jaero(1,6)*sin_alpha - Drag*sin_alpha_wz;
804 J(6,1) = Jaero(6,1) +
d14*J(2,1);
805 J(6,2) = Jaero(6,2) +
d14*J(2,2);
806 J(6,3) = Jaero(6,3) +
d14*J(2,3);
809 J(6,6) = Jaero(6,6) +
d14*J(2,6);
813 #ifdef DEBUG_JACOBIAN_UNSTEADY
814 printf(
"G/v matrix\n");
815 printf(
"%lf %lf %lf\n", 0., 0., 0.);
816 printf(
"%lf %lf %lf\n", dG_V_21, dG_V_22, 0.);
818 printf(
"G/w matrix\n");
819 printf(
"%lf %lf %lf\n", 0., 0., 0.);
820 printf(
"%lf %lf %lf\n", 0., 0., dG_W_23);
822 printf(
"f/q matrix\n");
823 printf(
"%lf %lf \n", fq(1,1), fq(1,2));
824 printf(
"%lf %lf \n", fq(2,1), fq(2,2));
825 printf(
"%lf %lf \n", 0., 0.);
827 printf(
"c/q matrix\n");
828 printf(
"%lf %lf\n", 0., 0.);
829 printf(
"%lf %lf\n", 0., 0.);
830 printf(
"%lf %lf\n", cq(3,1), cq(3,2));
832 printf(
"J matrix\n");
833 for(
int iii=1; iii<=6; iii++){
834 for(
int jjj=1; jjj<=6; jjj++){
835 printf(
"%lf ", J(iii,jjj));
841 fd = fopen(
"X.mat",
"w");
843 for(
int iii=1; iii<=2; iii++){
844 printf(
"%lf ", XCurr(iFirstIndex+iii));
845 fprintf(fd,
"%15.7e ", XCurr(iFirstIndex+iii));
848 fd = fopen(
"XP.mat",
"w");
851 for(
int iii=1; iii<=2; iii++){
852 printf(
"%lf ", XPrimeCurr(iFirstIndex+iii));
853 fprintf(fd,
"%15.7e ", XPrimeCurr(iFirstIndex+iii));
857 fd = fopen(
"W.mat",
"w");
859 printf(
"%lf %lf %lf %lf %lf %lf", W[
VX], W[VY], W[
VZ], W[
WX], W[
WY], W[
WZ]);
860 fprintf(fd,
"%15.7e %15.7e %15.7e %15.7e %15.7e %15.7e", W[
VX], W[VY], W[
VZ], W[
WX], W[
WY], W[
WZ]);
863 printf(
"PARAMETRI \n");
864 printf(
"d14 %lf ",
d14);
865 printf(
"\nd34 %lf ", d34);
866 printf(
"\nA1 %lf ",
A1);
867 printf(
"\nA2 %lf ",
A2);
868 printf(
"\nb1 %lf ",
b1);
869 printf(
"\nb2 %lf ", b2);
870 printf(
"\nchord %lf ", chord);
871 printf(
"\na %lf ",
a);
872 printf(
"\nrho %lf ", rho);
873 printf(
"\ncfx_0 %lf ", cfx_0[i]);
874 fd = fopen(
"cfx_0.mat",
"w");
875 fprintf(fd,
"%15.7e", cfx_0[i]);
877 printf(
"\ncfy_0 %lf ",
cfy_0[i]);
878 fd = fopen(
"cfy_0.mat",
"w");
879 fprintf(fd,
"%15.7e ",
cfy_0[i]);
881 printf(
"\ncmz_0 %lf ",
cmz_0[i]);
882 printf(
"\ndCl_alpha %lf ", dCl_alpha);
883 fd = fopen(
"dCl_alpha.mat",
"w");
884 fprintf(fd,
"%15.7e", dCl_alpha);
886 printf(
"\ndCd_alpha %lf", dCd_alpha);
887 fd = fopen(
"dCd_alpha.mat",
"w");
888 fprintf(fd,
"%15.7e", dCd_alpha);
890 printf(
"\ndCm_alpha %lf", dCm_alpha);
891 printf(
"\nclalpha %lf ",
clalpha[i]);
892 printf(
"\n q1 q2 i %lf %lf %d", q1, q2, i);
893 fd = fopen(
"ddot_alpha.mat",
"w");
897 fd = fopen(
"dot_alpha.mat",
"w");
901 fd = fopen(
"dot_alpha_pivot.mat",
"w");
GradientExpression< BinaryExpr< FuncPow, LhsExpr, RhsExpr > > pow(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
virtual int GetForcesJac(int i, const doublereal *W, doublereal *TNG, Mat6x6 &J, outa_t &OUTA)
void Put(int i, integer j, const doublereal &d)
int c81_aerod2_u(doublereal *W, const vam_t *VAM, doublereal *TNG, outa_t *OUTA, c81_data *data, long unsteadyflag)
void IncCoef(integer iRow, integer iCol, const doublereal &dCoef)
doublereal * dot_alpha_pivot
doublereal copysign(doublereal x, doublereal y)
UnsteadyModel unsteadyflag
integer iGetNumCols(void) const
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
GradientExpression< BinaryExpr< FuncAtan2, LhsExpr, RhsExpr > > atan2(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
GradientExpression< UnaryExpr< FuncTan, Expr > > tan(const GradientExpression< Expr > &u)