//---------------------------------------------------------------------------
//#pragma package(smart_init)
//---------------------------------------------------------------------------
#include <vcl.h>
#include <math.h>
#include <stdio.h>

#pragma hdrstop

//---------------------------------------------------------------------------

#include "Get_param_sect_gnu.h"
#include "StandartProfil.h"
#include "Data_Gen.h"
#include "ListConst.h"
#include "ProcExt.h"
#include "message.h"
//-----------------------------------------------------------
// Вычислить геометрические параметры тонкостенного сечения
void Get_param_sect_gnu(SECT_GNUTIC* section, GEOM_PARAM_SECT *param_sect, bool *flag_rad) {
   double tG, bG, hG, cG, rG, b2G;
   double jG, gG, eG, fG;
   double Jzz, Jyy, J1, J2, Jyz;
   double tan_2alfa, alfa;
   double ksi, e_, eta, eps;
   bool flag_ignore_rad;
   double delta;
   double X_[20], Y_[20];
   double thick[20];
   double tnom;
   int  n_seg;
   int i;
   double beta; // Угол между ребром жесткости и стенкой сигма-профиля
   double gr1, gr2; // углы полки и элемента жесткости стенки
   double bpe, bpj;

   param_sect->Iyz = 0.0;
   param_sect->Rad = 0;
   tG = section->tG;
   bG = section->bG;
   b2G = Round(section->b2G, 2);
   hG = section->hG;
   cG = section->cG;
   rG = section->rG;
   tnom = Round(section->tnom, 2);
   double rM = rG + tG/2;  // Радиус по срединной линии
   double gr = rM*0.2929;  // rM*(tan(45) - sin(45))
   // Размеры плоских участков
   double b_ph = hG - 2*gr;
   double b1_pb = bG - 2*gr;
   double b2_pb = b2G - 2*gr;
   double b_pc = MAX(cG - gr, 0.1);
   // Проверка возможности пренебрежения закругленности углов
   if (rG/tG < 5.0 && rG/b_ph <0.10 && rG/b1_pb < 0.1 &&  rG/b2_pb < 0.1  && rG/b_pc < 0.1)  {
     flag_ignore_rad = true;
     delta = 0;
   }
   else {
     flag_ignore_rad = false;
   }

   switch (section->type_profil) {
   case typeGNU_CH:  // швеллерного типа
   case typeGNU_C: // швеллер с отгибами
      //
      X_[0] = bG; Y_[0] = hG/2  - cG;
      X_[1] = bG; Y_[1] = hG/2;
      X_[2] = 0;  Y_[2] = hG/2;
      X_[3] = 0;  Y_[3] = -hG/2;
      X_[4] = b2G; Y_[4] = -hG/2;
      X_[5] = b2G; Y_[5] = -hG/2 + cG;
      n_seg = 5;
      for (i=1; i<=n_seg; i++)
        thick[i] = tG;
      //---------------------------------------------------------
      // Вычислить геометрические параметры сечения тонкостнного профиля по точкам
      Get_geom_param_XY(X_, Y_, thick, hG, n_seg, param_sect);
      //
      param_sect->index_orient = section->index_orient;
      param_sect->Hsect = hG;
      param_sect->Wsect = MAX(bG, b2G);

      param_sect->Hp = param_sect->Hsect;
      param_sect->Zp = param_sect->Zct;
      param_sect->ky = hG/(hG + bG + b2G);  // коэффициенты сдвиговой жесткости
      param_sect->kz = (bG + b2G)/(hG + bG + b2G);  // коэффициенты сдвиговой жесткости

      /*
      param_sect->Ar = (2*bG + hG)*tG + 2*cG*tG;
      param_sect->Zct = hG/2;
      param_sect->Yct = (bG*bG*tG + 2*tG*cG*bG)/param_sect->Ar;
      param_sect->Iyy = tG*hG*hG*hG/12 + tG*bG*hG*hG/2 + tG*cG*cG*cG/6 + tG*cG*(hG - cG)*(hG - cG)/2;
      param_sect->Izz = tG*bG*bG*bG/6 + 2*tG*bG*(bG/2 - param_sect->Yct)*(bG/2 - param_sect->Yct) +
                        tG*tG*tG*hG/12 + tG*hG*param_sect->Yct*param_sect->Yct +
                        tG*tG*tG*cG/6 + 2*cG*tG*(bG - param_sect->Yct)*(bG - param_sect->Yct);
      param_sect->Hp = param_sect->Hsect;
      param_sect->Zp = param_sect->Zct;
      param_sect->Itor = tG*tG*tG*(2*bG + hG + 2*cG)/3;
      param_sect->ky = hG/(hG + 2*bG);  // коэффициенты сдвиговой жесткости
      param_sect->kz = 2*bG/(hG + 2*bG);  // коэффициенты сдвиговой жесткости
      */
      param_sect->point_stress[0][1] = -hG/2;
      param_sect->point_stress[0][0] = b2G;
      param_sect->point_stress[1][1] = -hG/2;
      param_sect->point_stress[1][0] = 0;
      param_sect->point_stress[2][1] = hG/2;
      param_sect->point_stress[2][0] = 0;
      param_sect->point_stress[3][1] = hG/2;
      param_sect->point_stress[3][0] = bG;
      param_sect->Wx_f = tG*bG*param_sect->Zct + tG*b2G*(hG - param_sect->Zct);
      param_sect->Wx_pl = param_sect->Wx_f + hG*tG*hG/2 + tG*cG*(hG - cG);
      /*
      param_sect->I1 = param_sect->Iyy
      param_sect->I2 = param_sect->Izz;
      param_sect->alfa = 0;
      param_sect->Ze = hG/2;
      e_ = bG*(3*hG*hG*bG + 6*hG*hG*cG - 8*cG*cG*cG)/(hG*hG*hG + 6*hG*hG*bG + 6*hG*hG*cG + 8*cG*cG*cG - 12*hG*cG*cG);
      param_sect->Ye = e_;
      param_sect->Iw = tG*(0.5*hG*hG*bG*bG*(cG + bG/3 - e_ - 2*e_*cG/bG + 2*cG*cG/hG) +
               0.5*hG*hG*e_*e_*(bG + cG + hG/6 - 2*cG*cG/hG) + 2*cG*cG*cG*(bG + e_)*(bG + e_)/3);
      param_sect->Wx_f = tG*bG*hG;
      param_sect->Wx_pl = tG*bG*hG + hG*tG*hG/2 + tG*cG*(hG - cG);
      */

      if (!flag_ignore_rad) {
        delta = Round(0.43*4*rG/(b_ph + b1_pb + b2_pb + 2 * b_pc), 2);
        param_sect->Ar *= (1 - delta);
        param_sect->Iyy *= (1 - 2*delta);
        param_sect->Izz *= (1 - 2*delta);
        param_sect->Iw *= (1 - 4*delta);
      }
      if (section->index_paired==1) {
        param_sect->Ar *= 2;
        param_sect->Iyy *= 2;
        param_sect->Izz = 2*param_sect->Izz + param_sect->Ar*param_sect->Ye*param_sect->Ye;
        param_sect->Iw *= 2;
        param_sect->Wx_f *= 2;
        param_sect->Wx_pl *= 2;
        param_sect->Yct = 0;
      }
   break;
   case typeGNU_Z:  // зетик
   case typeGNU_ZC:  // зетик с отгибами
      X_[0] = bG; Y_[0] = hG/2 - cG;
      X_[1] = bG; Y_[1] = hG/2;
      X_[2] = 0; Y_[2] = hG/2;
      X_[3] = 0; Y_[3] = -hG/2;
      X_[4] = -b2G; Y_[4] = -hG/2;
      X_[5] = -b2G; Y_[5] = -hG/2 + cG;
      n_seg = 5;
      for (i=1; i<=n_seg; i++)
        thick[i] = tG;
      /*  Тест двутавр
      X_[0] = -25; Y_[0] = 39;
      X_[1] = 25; Y_[1] = 39;
      X_[2] = 0; Y_[2] = 39;
      X_[3] = 0; Y_[3] = -39;
      X_[4] = 25; Y_[4] = -39;
      X_[5] = -25; Y_[5] = -39;
      n_seg = 5;
      for (i=0; i<=n_seg; i++)
        thick[i] = 0;
      thick[1] = 2;
      thick[3] = 1.5;
      thick[5] = 2;
      */
      //---------------------------------------------------------
      // Вычислить геометрические параметры сечения тонкостнного профиля по точкам
      Get_geom_param_XY(X_, Y_, thick, hG, n_seg, param_sect);

      param_sect->index_orient = section->index_orient;
      param_sect->Hsect = hG;
      param_sect->Wsect = bG + b2G;

      param_sect->Hp = param_sect->Hsect;
      param_sect->Zp = param_sect->Zct;
      param_sect->ky = hG/(hG + bG + b2G);  // коэффициенты сдвиговой жесткости
      param_sect->kz = (bG + b2G)/(hG + bG + b2G);  // коэффициенты сдвиговой жесткости
      param_sect->point_stress[0][1] = -hG/2;
      param_sect->point_stress[0][0] = -b2G;
      param_sect->point_stress[1][1] = -hG/2;
      param_sect->point_stress[1][0] = 0;
      param_sect->point_stress[2][1] = hG/2;
      param_sect->point_stress[2][0] = 0;
      param_sect->point_stress[3][1] = hG/2;
      param_sect->point_stress[3][0] = bG;
      param_sect->Wx_f = tG*bG*param_sect->Zct + tG*b2G*(hG - param_sect->Zct);
      param_sect->Wx_pl = param_sect->Wx_f + hG*tG*hG/2 + tG*cG*(hG - cG);
      if (!flag_ignore_rad) {
        delta = Round(0.43*4*rG/(b_ph + b1_pb + b2_pb + 2 * b_pc), 2);
        param_sect->Ar *= (1 - delta);
        param_sect->Iyy *= (1 - 2*delta);
        param_sect->Izz *= (1 - 2*delta);
        param_sect->Iw *= (1 - 4*delta);
      }
   break;
   case typeGNU_SIGMA:  // Сигма-профиль
      fG = section->fG;
      jG = Round(section->jG, 2);
      gG = Round(section->gG, 2);
      eG = hG/2  - jG/2 - gG;

      X_[0] = bG;        Y_[0] = hG/2 - cG;
      X_[1] = bG;        Y_[1] = hG/2;
      X_[2] = 0;         Y_[2] = hG/2;
      X_[3] = 0;         Y_[3] = hG/2 - eG;
      X_[4] = fG;         Y_[4] = jG/2;
      X_[5] = fG;         Y_[5] = -jG/2;
      X_[6] = 0;         Y_[6] = -hG/2 + eG;
      X_[7] = 0;         Y_[7] = -hG/2;
      X_[8] = b2G;      Y_[8] = -hG/2;
      X_[9] = b2G;      Y_[9] = -hG/2 + cG;
      n_seg = 9;
      for (i=1; i<=n_seg; i++)
        thick[i] = tG;
      //---------------------------------------------------------
      // Вычислить геометрические параметры сечения тонкостнного профиля по точкам
      Get_geom_param_XY(X_, Y_, thick, hG, n_seg, param_sect);

      param_sect->index_orient = section->index_orient;
      param_sect->Hsect = hG;
      param_sect->Wsect = MAX(bG, b2G);

      param_sect->Hp = param_sect->Hsect;
      param_sect->Zp = param_sect->Zct;
      param_sect->ky = hG/(hG + bG + b2G);  // коэффициенты сдвиговой жесткости
      param_sect->kz = (bG + b2G)/(hG + bG + b2G);  // коэффициенты сдвиговой жесткости
      param_sect->point_stress[0][1] = -hG/2;
      param_sect->point_stress[0][0] = -b2G;
      param_sect->point_stress[1][1] = -hG/2;
      param_sect->point_stress[1][0] = 0;
      param_sect->point_stress[2][1] = hG/2;
      param_sect->point_stress[2][0] = 0;
      param_sect->point_stress[3][1] = hG/2;
      param_sect->point_stress[3][0] = bG;
      param_sect->Wx_f = tG*bG*param_sect->Zct + tG*b2G*(hG - param_sect->Zct);
      param_sect->Wx_pl = param_sect->Wx_f + hG*tG*hG/2 + tG*cG*(hG - cG);
      if (!flag_ignore_rad && gG!=0) {
        beta = atan(fG/gG);
        gr1 = rM*0.2929;  // rM*(tan(45) - sin(45))
        gr2 = rM*(tan(beta/2) - sin(beta/2));
        bpe = eG - gr1 - gr2;
        bpj = jG - 2*gr2;
        delta = Round(0.43*(4*rG + 4*rG*beta*57.3/90.0)/(b1_pb + b2_pb + 2*b_pc + 2*bpe + bpj), 2);
        param_sect->Ar *= (1 - delta);
        param_sect->Iyy *= (1 - 2*delta);
        param_sect->Izz *= (1 - 2*delta);
        param_sect->Iw *= (1 - 4*delta);
      }
      if (section->index_paired==1) {
        param_sect->Ar *= 2;
        param_sect->Iyy *= 2;
        param_sect->Izz = 2*param_sect->Izz + param_sect->Ar*param_sect->Ye*param_sect->Ye;
        param_sect->Iw *= 2;
        param_sect->Wx_f *= 2;
        param_sect->Wx_pl *= 2;
        param_sect->Yct = 0;
      }
   break;
   default:
      param_sect->Ar = 0;
      param_sect->Hsect = 0;
      param_sect->Zct = 0;
      param_sect->Iyy = 0;
      param_sect->Izz = 0;
      param_sect->Hp = param_sect->Hsect;
      param_sect->Zp = param_sect->Zct;
      param_sect->Itor = 0;
      param_sect->ky = param_sect->kz = 0;
      param_sect->point_stress[0][0] = 0;
      param_sect->point_stress[0][1] = 0;
      param_sect->point_stress[1][0] = 0;
      param_sect->point_stress[1][1] = 0;
      param_sect->point_stress[2][0] = 0;
      param_sect->point_stress[2][1] = 0;
      param_sect->point_stress[3][0] = 0;
      param_sect->point_stress[3][1] = 0;
      //ErrorMessage("Для сечения типа " +IntToStr(type)+" геометрические характеристики не вычисляются");
   }
   param_sect->Ar = Round(param_sect->Ar, 0);
   param_sect->Itor = Round(param_sect->Itor, -1);
   param_sect->Izz = Round(param_sect->Izz, -2);
   param_sect->Iyy = Round(param_sect->Iyy, -2);
   param_sect->Iw = Round(param_sect->Iw, -4);
   param_sect->I1 = Round(param_sect->I1, -2);
   param_sect->I2 = Round(param_sect->I2, -2);

   *flag_rad = flag_ignore_rad;

}
//-----------------------------------------------------------
// Геометрические характеричтики эффективного сечения при изгибе
void Get_param_eff_bend(double Ry, double E, SECT_GNUTIC* section, GEOM_PARAM_SECT_EFF *param_sect_eff) {
   double tG, bG, b2G, hG, cG, rG;
   double jG, fG, eG, gG;
   double Jzz, Jyy, J1, J2, Jyz;
   double tan_2alfa, alfa;
   double ksi, e_, eta, eps;
   bool flag_ignore_rad;
   double delta;
   GEOM_PARAM_SECT param_sect_e0;
   double X_[20];
   double Y_[20];
   int n_seg;
   double thick[20];
   int i;
   double beta, gr1, gr2, bpe, bpj;

   tG = section->tG;
   bG = section->bG;
   b2G = Round(section->b2G, 2);
   hG = section->hG;
   cG = section->cG;
   rG = section->rG;
   double rM = rG + tG/2;  // Радиус по срединной линии
   double gr = rM*0.2929;  // rM*(tan(45) - sin(45))
   // Размеры плоских участков
   double b_ph = hG - 2*gr;
   double b1_pb = bG - 2*gr;
   double b2_pb = bG - 2*gr;
   double b_pc = MAX (cG - gr, 0.1);
   // Проверка возможности пренебрежения закругленности углов
   if (rG/tG <= 5.0 && rG/b_ph <= 0.10 && rG/b1_pb <= 0.1 && rG/b2_pb <= 0.1 && rG/b_pc <= 0.1)  {
     flag_ignore_rad = true;
     delta = 0;
   }
   else {
     flag_ignore_rad = false;
   }
   //-------------------- Шаг 1 ============================
   // Эффективная ширина полки  1993-1-3 5.5.3.2  или ДСТУ-Б EN 10.2 (Украина)
   double psi = 1;
   double k_sigma = get_tabl_4_1(psi);
   eps = sqrt(235/Ry);
   double lambda_pb = (bG/tG)/(28.4*eps*sqrt(k_sigma));
   double ro;
   if (lambda_pb <=  0.673)
     ro = 1.0;
   else
     ro = MIN(1.0, (lambda_pb - 0.055*(3+psi))/(lambda_pb*lambda_pb));

   double b_eff = ro*bG;
   double be1 = b_eff/2;
   double be2 = b_eff/2;
   // Эффективная ширина отгиба
   double k_cb = cG/bG;
   if (k_cb <= 0.35)
     k_sigma = 0.5;
   else {    // Нет формулы для k_b > 0.6
     //if (k_cb <= 0.6)
       k_sigma = 0.5 + 0.83*pow((k_cb - 0.35)*(k_cb - 0.35), 0.3333);
     //else
       //k_sigma = 0.5 + 0.83*pow((k_cb - 0.35)*(k_cb - 0.35), 0.3333);
   }

   double lambda_pc = (cG/tG)/(28.4*eps*sqrt(k_sigma));
   if (lambda_pb <=  0.748)
     ro = 1.0;
   else
     ro = (lambda_pc - 0.188)/(lambda_pc*lambda_pc);
   ro = MIN(1, ro);

   double c_eff = ro*cG;
   // Эффективная жесткость краевого элемента
   double As = tG*(be2 + c_eff);
   //-------------------- Шаг 2 ============================
   // Критическое напряжение при потере устойчивости для краевого элемента жесткости
   double b1 = bG - (be2*tG*be2/2)/((be2 + c_eff)*tG);
   double K_ = (E*tG*tG*tG/(4*(1 - 0.3*0.3)))/(b1*b1*hG + b1*b1*b1);
   double Is = be2*tG*tG*tG/12 + c_eff*c_eff*c_eff*tG/12 +
               be2*tG*pow(c_eff*c_eff/(2*(be2 + c_eff)), 2.0) +
               c_eff*tG*pow(c_eff/2 - c_eff*c_eff/(2*(be2 + c_eff)), 2.0);
   double sigma_cr = 2*sqrt(K_*E*Is)/As;
   double lambda_d = sqrt(Ry/sigma_cr);
          //lambda_d = 1.215;
   double kappa_d;

   if (lambda_d <=0.65)
     kappa_d = 1.0;
   else {
     if (lambda_d <= 1.38)
       kappa_d = 1.47 - 0.723*lambda_d;
     else
       kappa_d = 0.66/lambda_d;
   }
   double t_red = kappa_d*tG;
   double k_sigma_j, k_sigma_e;
   double ro_j, ro_e;
   //-------------------------------------------------------------
   // Определение эффективного сечения стенки
   // Размер сжатой зоны h_c с учетом эффективного сечения полки
   double h_c, psi_j, psi_e;
   double lambda_ph, lambda_pj, lambda_pe;
   double h_eff, he1, he2, h1, h2;
   double A_eff, zc, zt, I_eff_y, W_eff_yc, W_eff_yt;
   double A_eff0, zc0, zt0, I_eff_y0;
   if (section->type_profil==typeGNU_SIGMA) {
      jG = section->jG;
      fG = Round(section->fG, 2);
      gG = Round(section->gG, 2);
      eG = hG/2  - jG/2 - gG;
      
      h_c = (cG*(hG-cG/2) + b2G*hG + eG*(hG - eG/2) + sqrt(fG*fG + gG*gG)*(hG - eG - gG/2) +
             jG*hG/2 + sqrt(fG*fG + gG*gG)*(eG + gG/2) + eG*eG/2 + c_eff*c_eff*kappa_d/2)/
                (cG + b2G + h2*eG + sqrt(fG*fG + gG*gG) + jG + be1 + (be2 + c_eff)*kappa_d);
      psi_j = (h_c - hG  +eG + gG)/(h_c - eG - gG);
      psi_e = (h_c - eG)/h_c;
      k_sigma_j = get_tabl_4_1(psi_j);
      k_sigma_e = get_tabl_4_1(psi_e);
      lambda_pj = (jG/tG)/(28.4*eps*sqrt(k_sigma_j));
      if (lambda_pj <=  0.673)
        ro_j = 1.0;
      else
        ro_j = (lambda_pj - 0.055*(3 + psi))/(lambda_pj*lambda_pj);
      lambda_pe = (eG/tG)/(28.4*eps*sqrt(k_sigma_e));
      if (lambda_pe <=  0.673)
        ro_e = 1.0;
      else
        ro_e = (lambda_pe - 0.055*(3 + psi))/(lambda_pe*lambda_pe);
   }
   else {
      h_c = (cG*(hG-cG/2) + b2G*hG + hG*hG/2 + c_eff*c_eff*kappa_d/2)/
                (cG + b2G + hG + be1 + (be2 + c_eff)*kappa_d);
      psi = MIN(3.0, (h_c - hG)/h_c);
      k_sigma = get_tabl_4_1(psi);
      lambda_ph = (hG/tG)/(28.4*eps*sqrt(k_sigma));
      if (lambda_ph <=  0.673)
        ro = 1.0;
      else
        ro = MIN(1.0, (lambda_ph - 0.055*(3 + psi))/(lambda_ph*lambda_ph));
      h_eff = ro*h_c;
      he1 = 0.4*h_eff;
      he2 = 0.6*h_eff;
      h1 = he1;
      h2 = hG - (h_c - he2);
   }

   switch (section->type_profil) {
   case typeGNU_CH:  // швеллерного типа
   case typeGNU_C: // швеллер с отгибами
   //
      X_[0] = bG;        Y_[0] = hG/2 - c_eff;
      X_[1] = bG;        Y_[1] = hG/2;
      X_[2] = bG - be1;  Y_[2] = hG/2;
      X_[3] = be2;       Y_[3] = hG/2;
      X_[4] = 0;         Y_[4] = hG/2;
      X_[5] = 0;         Y_[5] = hG/2 - h1;
      X_[6] = 0;         Y_[6] = h2 - hG/2;
      X_[7] = 0;         Y_[7] = -hG/2;
      X_[8] = b2G;      Y_[8] = -hG/2;
      X_[9] = b2G;      Y_[9] = -hG/2 + cG;
      n_seg = 9;
      for (i=1; i<=n_seg; i++)
        thick[i] = tG;
      thick[1] = thick[2] =  tG*kappa_d;
      thick[3] = thick[6] = 0;

      // Вычислить геометрические параметры сечения тонкостенного профиля по точкам
      Get_geom_param_XY(X_, Y_, thick, hG, n_seg, &param_sect_e0);

      A_eff = param_sect_e0.Ar;
      zc = param_sect_e0.Zct;
      zt = hG - param_sect_e0.Zct;
      I_eff_y = param_sect_e0.Iyy;
      /*
      A_eff = tG*(cG + b2G + h1 + h2 + be1 + (be2 + c_eff)*kappa_d);
   // Положение нейтральной оси относительно сжатой полки
      zc = tG*(cG*(hG - cG/2) + b2G*hG + h2*(hG - h2/2) + h1*h1/2 + c_eff*c_eff*kappa_d/2)/A_eff;
      zt = hG - zc;
      I_eff_y = h1*h1*h1*tG/12 + h2*h2*h2*tG/12 + b2G*tG*tG*tG/12 + cG*cG*cG*tG/12 + be1*tG*tG*tG/12 +
                    be2*pow(kappa_d*tG, 3.0)/12 + c_eff*c_eff*c_eff*kappa_d*tG/12 +
                    cG*tG*pow(zt - cG/2, 2.0) + b2G*tG*zt*zt + h2*tG*pow(zt - h2/2, 2.0) + h1*tG*pow(zc - h1/2, 2.0) +
                    be1*tG*zc*zc + be2*kappa_d*tG*zc*zc + c_eff*kappa_d*tG*pow(zc - c_eff/2, 2.0);
      */
   // эффективный момент сопротивления для сжатой полки
      W_eff_yc = I_eff_y/zc;
   // эффективный момент сопротивления для растянутой полки
      W_eff_yt = I_eff_y/zt;
      param_sect_eff->A_eff = A_eff;
      param_sect_eff->b_eff = b_eff;
      param_sect_eff->I_eff_y = I_eff_y;
      param_sect_eff->W_eff_yc = W_eff_yc;
      param_sect_eff->W_eff_yt = W_eff_yt;
      param_sect_eff->zc = zc;
      param_sect_eff->zt = zt;
      if (!flag_ignore_rad) {
        delta = Round(0.43*4*rG/(b_ph + b1_pb + b2_pb + 2 * b_pc), 2);
        param_sect_eff->A_eff *= (1 - delta);
        param_sect_eff->I_eff_y *= (1 - 2*delta);
        param_sect_eff->W_eff_yc = param_sect_eff->I_eff_y/param_sect_eff->zc;   // относительно внешней полки
        param_sect_eff->W_eff_yt = param_sect_eff->I_eff_y/param_sect_eff->zt;   // относительно внутренней полки
      }
   break;
   case typeGNU_Z:  // зетик
   case typeGNU_ZC:  // зетик с отгибами
      X_[0] = bG;        Y_[0] = hG/2 - c_eff;
      X_[1] = bG;        Y_[1] = hG/2;
      X_[2] = bG - be1;  Y_[2] = hG/2;
      X_[3] = be2;       Y_[3] = hG/2;
      X_[4] = 0;         Y_[4] = hG/2;
      X_[5] = 0;         Y_[5] = hG/2 - h1;
      X_[6] = 0;         Y_[6] = h2 - hG/2;
      X_[7] = 0;         Y_[7] = -hG/2;
      X_[8] = -b2G;      Y_[8] = -hG/2;
      X_[9] = -b2G;      Y_[9] = -hG/2 + cG;
      n_seg = 9;
      for (i=1; i<=n_seg; i++)
        thick[i] = tG;
      thick[1] = thick[2] =  tG*kappa_d;
      thick[3] = thick[6] = 0;
      // Вычислить геометрические параметры сечения тонкостенного профиля по точкам
      Get_geom_param_XY(X_, Y_, thick, hG, n_seg, &param_sect_e0);


      param_sect_eff->A_eff = param_sect_e0.Ar;
      param_sect_eff->b_eff = b_eff;
      param_sect_eff->I_eff_y = param_sect_e0.Iyy;
      param_sect_eff->zc = param_sect_e0.Zct;
      param_sect_eff->zt = hG - param_sect_e0.Zct;
      param_sect_eff->W_eff_yc = param_sect_e0.Iyy/param_sect_eff->zc;
      param_sect_eff->W_eff_yt = param_sect_e0.Iyy/param_sect_eff->zt;
      param_sect_eff->W_eff_Umax = param_sect_e0.Wu_max;
      param_sect_eff->W_eff_Umin = param_sect_e0.Wu_min;
      param_sect_eff->W_eff_Vmax = param_sect_e0.Wv_max;
      param_sect_eff->W_eff_Vmin = param_sect_e0.Wv_min;
      param_sect_eff->I_eff_u = param_sect_e0.I1;
      param_sect_eff->I_eff_v = param_sect_e0.I2;


      if (!flag_ignore_rad) {
        delta = Round(0.43*4*rG/(b_ph + b1_pb + b2_pb + 2 * b_pc), 2);
        param_sect_eff->A_eff *= (1 - delta);
        param_sect_eff->I_eff_y *= (1 - 2*delta);
        param_sect_eff->I_eff_u *= (1 - 2*delta);
        param_sect_eff->I_eff_v *= (1 - 2*delta);
        param_sect_eff->W_eff_yc = param_sect_eff->I_eff_y/param_sect_eff->zc;
        param_sect_eff->W_eff_yt = param_sect_eff->I_eff_y/param_sect_eff->zt;
        param_sect_eff->W_eff_Umax *= (1 - 2*delta);
        param_sect_eff->W_eff_Umin *= (1 - 2*delta);
        param_sect_eff->W_eff_Vmax *= (1 - 2*delta);
        param_sect_eff->W_eff_Vmin *= (1 - 2*delta);
      }
   break;
   case typeGNU_SIGMA:  //

      X_[0] = bG;        Y_[0] = hG/2 - c_eff;
      X_[1] = bG;        Y_[1] = hG/2;
      X_[2] = bG - be1;  Y_[2] = hG/2;
      X_[3] = be2;       Y_[3] = hG/2;
      X_[4] = 0;         Y_[4] = hG/2;
      X_[5] = 0;         Y_[5] = hG/2 - eG;
      X_[6] = fG;         Y_[6] = jG/2;
      X_[7] = fG;         Y_[7] = -jG/2;
      X_[8] = 0;         Y_[8] = -hG/2 + eG;
      X_[9] = 0;         Y_[9] = -hG/2;
      X_[10] = b2G;      Y_[10] = -hG/2;
      X_[11] = b2G;      Y_[11] = -hG/2 + cG;
      n_seg = 11;
      for (i=1; i<=n_seg; i++)
        thick[i] = tG;
      thick[1] = thick[2] =  tG*kappa_d;
      thick[3] = 0;
      // Вычислить геометрические параметры сечения тонкостенного профиля по точкам
      Get_geom_param_XY(X_, Y_, thick, hG, n_seg, &param_sect_e0);


      param_sect_eff->A_eff = param_sect_e0.Ar;
      param_sect_eff->b_eff = b_eff;
      param_sect_eff->I_eff_y = param_sect_e0.Iyy;
      param_sect_eff->I_eff_z = param_sect_e0.Izz;
      param_sect_eff->zc = param_sect_e0.Zct;
      param_sect_eff->zt = hG - param_sect_e0.Zct;
      param_sect_eff->W_eff_yc = param_sect_e0.Iyy/param_sect_e0.Zct;
      param_sect_eff->W_eff_yt = param_sect_e0.Iyy/(hG - param_sect_e0.Zct);
      param_sect_eff->W_eff_Umax = param_sect_e0.Wu_max;
      param_sect_eff->W_eff_Umin = param_sect_e0.Wu_min;
      param_sect_eff->W_eff_Vmax = param_sect_e0.Wu_max;
      param_sect_eff->W_eff_Vmin = param_sect_e0.Wu_min;
      param_sect_eff->I_eff_u = param_sect_e0.I1;
      param_sect_eff->I_eff_v = param_sect_e0.I2;

      if (!flag_ignore_rad) {
        beta = atan(fG/gG);
        gr1 = rM*0.2929;  // rM*(tan(45) - sin(45))
        gr2 = rM*(tan(beta/2) - sin(beta/2));
        bpe = eG - gr1 - gr2;
        bpj = jG - 2*gr2;
        delta = Round(0.43*(4*rG + 4*rG*beta*57.3/90.0)/(b1_pb + b2_pb + 2*b_pc + 2*bpe + bpj), 2);
        param_sect_eff->A_eff *= (1 - delta);
        param_sect_eff->I_eff_y *= (1 - 2*delta);
        param_sect_eff->I_eff_u *= (1 - 2*delta);
        param_sect_eff->I_eff_v *= (1 - 2*delta);
        param_sect_eff->W_eff_yc = param_sect_eff->I_eff_y/param_sect_eff->zc;
        param_sect_eff->W_eff_yt = param_sect_eff->I_eff_y/param_sect_eff->zt;
        param_sect_eff->W_eff_Umax *= (1 - 2*delta);
        param_sect_eff->W_eff_Umin *= (1 - 2*delta);
        param_sect_eff->W_eff_Vmax *= (1 - 2*delta);
        param_sect_eff->W_eff_Vmin *= (1 - 2*delta);
      }
   break;
   case 888:  // швеллерного типа

   break;
   case 999:  // зетик
   break;
   default:
      ;      //ErrorMessage("Для сечения типа " +IntToStr(type)+" геометрические характеристики не вычисляются");
   }
   param_sect_eff->A_eff = Round(param_sect_eff->A_eff, 0);
   param_sect_eff->b_eff = Round(param_sect_eff->b_eff, 1);
   param_sect_eff->I_eff_y = Round(param_sect_eff->I_eff_y, 0);
   param_sect_eff->W_eff_yc = Round(param_sect_eff->W_eff_yc, 0);
   param_sect_eff->W_eff_yt = Round(param_sect_eff->W_eff_yt, 0);
   param_sect_eff->zc = Round(param_sect_eff->zc, 1);
   param_sect_eff->zt = Round(param_sect_eff->zt, 1);

}
//---------------------------------------------------------
// Получить значение k_sigma по табл. 4.1 EN 1993-1-5 п.4.1
double get_tabl_4_1(double psi) {
  if (psi==1.0)
    return 4.0;
  if (psi <1 && psi>0)
    return 8.2/(1.05 + psi);
  if (psi == 0)
    return 7.81;
  if (psi < 0 && psi >-1.0)
    return 7.81 - 6.29*psi + 9.78*psi*psi;
  if (psi == -1)
    return 23.9;
  if (psi < -1 && psi > -3)
    return 5.98*(1 - psi)*(1- psi);
  return 1000.0;
}
