public static double[] createConditions(double phi0, double theta0, double psi0){
        /*вычисляем начальные условия. на входе они в самолетных углах, а нужны в кватернионах*/
            double[] y0; // initial state
            double sPh0 = sin((phi0 * PI) / 2);
            double sPs0 = sin((psi0 * PI) / 2);
            double sTh0 = sin((theta0 * PI) / 2);
            double cPh0 = cos((phi0 * PI) / 2);
            double cPs0 = cos((psi0 * PI) / 2);
            double cTh0 = cos((theta0 * PI) / 2);

            double lambda0 = cPh0*cPs0*cTh0 + sPh0*sPs0*sTh0;
            double lambda1 = sPh0*cPs0*cTh0 - cPh0*sPs0*sTh0;
            double lambda2 = cPh0*cPs0*sTh0 + sPh0*sPs0*cTh0;
            double lambda3 = cPh0*sPs0*cTh0 - sPh0*cPs0*sTh0;
            y0 = new double[] { lambda0, lambda1, lambda2, lambda3, 0, 1, 0 };
            return y0;
        }