1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009 |
- //
- // Created by lloyd on 2020/12/2.
- //
- #include <iostream>
- #include <cmath>
- #include <cstring>
- #include <iomanip>
- #include <list>
- #include "gtaoidcore.h"
- #include "gtrunconf.h"
- void gtaoidcore::gtrevision::sgt_encode(dgns_gtbaseparam *_dgns_gtbaseparam) {
- result = "功图错误或仪器故障";
- if (_dgns_gtbaseparam == nullptr) {
- return;
- }
- pointNum = _dgns_gtbaseparam->sgtpointnum;
- if (pointNum % 2 != 0) pointNum--;
- if (pointNum <= 0 || _dgns_gtbaseparam->sgt.empty()) {
- return;
- }
- minLoad = _dgns_gtbaseparam->l_min;
- maxLoad = _dgns_gtbaseparam->l_max;
- minShiftPoint = _dgns_gtbaseparam->s_min_point_location;
- minShift = _dgns_gtbaseparam->s_min;
- minShiftLoad = _dgns_gtbaseparam->sgt[_dgns_gtbaseparam->s_min_point_location][1];
- maxShift = _dgns_gtbaseparam->s_max;
- maxShiftPoint = _dgns_gtbaseparam->s_max_point_location;
- maxShiftLoad = _dgns_gtbaseparam->sgt[_dgns_gtbaseparam->s_max_point_location][1];
- cha = _dgns_gtbaseparam->s;
- cc1 = _dgns_gtbaseparam->n;
- card = new double *[2];
- card[0] = new double[pointNum];
- card[1] = new double[pointNum];
- for (int i = 0; i < pointNum; ++i) {
- card[0][i] = _dgns_gtbaseparam->sgt[i][0];
- card[1][i] = _dgns_gtbaseparam->sgt[i][1];
- }
- cardArray = new double *[2];
- cardArray[0] = new double[pointNum];
- cardArray[1] = new double[pointNum];
- for (int j = 0; j < pointNum; j++) {
- if (minShiftPoint + j < pointNum) {
- cardArray[0][j] = card[0][minShiftPoint + j];
- cardArray[1][j] = card[1][minShiftPoint + j];
- } else {
- cardArray[0][j] = card[0][minShiftPoint + j - pointNum];
- cardArray[1][j] = card[1][minShiftPoint + j - pointNum];
- }
- }
- //功图界值的判断,可以考虑不要,前面已经判断了功图合法性
- /*if (maxLoad == minLoad || minLoad > 150 || maxLoad > 150 || minLoad < 0 || maxLoad < 0 || pointNum < 60 ||
- pointNum % 2 != 0 || cha < -8)*/
- if (_dgns_gtbaseparam->islegal != 1)
- result = "功图错误或仪器故障";
- else result = "";
- }
- void gtaoidcore::calbgt::cal_bgt(const gtaoidcore::gtrevision &_gtrevision, const std::string &zdjg) {
- double tmpDownLevel = 0.001;
- double tmpUpLevel = 0, downLoadingLevel = 0, upLoadingLevel = 0;
- int tmpANNNum = 0;
- if (!_gtrevision.result.empty()) return;
- while (tmpANNNum == 0) {
- for (int i = 0; i < _gtrevision.pointNum / 2; i++) {
- if (_gtrevision.cardArray[0][i] <= _gtrevision.cha * tmpDownLevel) {
- tmpANNNum++;
- downLoadingLevel += _gtrevision.cardArray[1][i];
- }
- }
- tmpDownLevel += 0.001;
- }
- downLoadingLevel = downLoadingLevel / tmpANNNum;
- tmpANNNum = 0;
- tmpUpLevel = 0.98;
- while (tmpANNNum == 0) {
- for (int i = 0; i < _gtrevision.pointNum; i++) {
- if (_gtrevision.cardArray[0][i] >= _gtrevision.cha * tmpUpLevel) {
- tmpANNNum++;
- upLoadingLevel = upLoadingLevel + _gtrevision.cardArray[1][i];
- }
- }
- tmpUpLevel = tmpUpLevel - 0.001;
- }
- upLoadingLevel /= tmpANNNum;
- double tmpdDMWY[_gtrevision.pointNum];
- double tmpdDMYeZH[_gtrevision.pointNum];
- // double DBU[2][_gtrevision.pointNum];
- std::vector<std::vector<double>> DBU;//[2][_gtrevision.pointNum];
- double equivalRodDiameter;
- for (int i = 0; i < _gtrevision.pointNum; i++) {
- tmpdDMWY[i] = _gtrevision.cardArray[0][i];
- tmpdDMYeZH[i] = _gtrevision.cardArray[1][i];
- tmpdDMYeZH[i] = tmpdDMYeZH[i] * 1000 - downLoadingLevel * 1000;
- }
- double pumpdepth;
- equivalRodDiameter = 0.035;//等效杆直径
- pumpdepth = (downLoadingLevel / 9.8 * 4 / MATH_PI / 7.85) / (equivalRodDiameter * equivalRodDiameter);
- pumpdepth = 50;//???
- auto p_pc = std::strcmp(zdjg.c_str(), "喷抽") >= 0;
- //Dbu[1][0] Dbu[0][TotalPoint + 2] Dbu[0][TotalPoint + 1] Dbu[1][TotalPoint + 1] Dbu[0][0]
- double dzxwyzh = 0, dzxwy = 0, dbmaxload = 0, dbminload = 0, ddZNXShC = 0;
- do {
- do {
- equivalRodDiameter = std::sqrt(downLoadingLevel / 9.8 * 4 / MATH_PI / 7.85 / pumpdepth);
- pumpdepth = pumpdepth + 20;
- } while (equivalRodDiameter >= 0.055);
- //pumpdepth = pumpdepth - 20;
- calnumb++;
- DBU = subGeJiGanGT(-pumpdepth, equivalRodDiameter, 7850, 210000000000l, tmpdDMWY, tmpdDMYeZH,
- _gtrevision.cc1, _gtrevision.pointNum, _gtrevision.pointNum / 2, 10, 0.022,
- 0.062, dzxwyzh, dzxwy, dbmaxload, dbminload, ddZNXShC);
- double upload = 0;
- double download = 0;
- for (int i = 0; i < _gtrevision.pointNum / 2; i++) {
- upload = DBU[1][i] + upload;
- download = DBU[1][_gtrevision.pointNum / 2 + i] + download;
- }
- if (upload < download) {//功图反转校验
- for (int i = 0; i < _gtrevision.pointNum / 2; i++) {
- auto downloadindex = _gtrevision.pointNum - i - 1;
- double tempstroke = DBU[0][i];
- double tempload = DBU[1][i];
- DBU[0][i] = DBU[0][downloadindex];
- DBU[1][i] = DBU[1][downloadindex];
- DBU[0][downloadindex] = tempstroke;
- DBU[1][downloadindex] = tempload;
- }
- }
- if (p_pc) { break; }
- if (pumpdepth < 1800) {
- pumpdepth += 20;
- } else break;
- } while (dzxwyzh < (dbmaxload + dbminload) * 3.5 / 8);
- {
- card = new double *[2];
- card[0] = new double[_gtrevision.pointNum];
- card[1] = new double[_gtrevision.pointNum];
- }
- bgt.clear();
- for (int i = 0; i < _gtrevision.pointNum; i++) {
- card[0][i] = DBU[0][i];
- card[1][i] = DBU[1][i] / 1000;
- if (DBU[1][i] / 1000 > maxLoad)
- maxLoad = DBU[1][i] / 1000;
- if (DBU[1][i] / 1000 < minLoad)
- minLoad = DBU[1][i] / 1000;
- if (DBU[0][i] > maxShift)
- maxShift = DBU[0][i];
- if (DBU[0][i] < minShift)
- minShift = DBU[0][i];
- //std::string weiyi = "", ZaiHe = "";
- std::stringstream weiyi, ZaiHe;
- weiyi << std::setw(3) << std::setfill('0') << std::to_string(DBU[0][i] * 100).substr(0, 3);
- ZaiHe << std::setw(5) << std::setfill('0') << std::to_string(DBU[1][i] / 10).substr(0, 5);
- bgtstr = bgtstr + weiyi.str() + ZaiHe.str();
- std::vector<double> p;
- p.push_back(DBU[0][i]);
- p.push_back(DBU[1][i] / 1000);//kN
- bgt.push_back(p);
- }
- _maxShift = std::to_string(maxShift);
- _minShift = std::to_string(minShift);
- _maxLoad = std::to_string(maxShift);
- _minLoad = std::to_string(minLoad);
- _maxShift = _maxShift.substr(0, 2) + "." + _maxShift.substr(2, 2);
- _minShift = _minShift.substr(0, 2) + "." + _minShift.substr(2, 2);
- _maxLoad = _maxLoad.substr(0, 3) + "." + _maxLoad.substr(3, 2);
- _maxLoad = _minLoad.substr(0, 3) + "." + _minShift.substr(3, 2);
- cha = std::to_string(maxShift - minShift);
- cha = cha.substr(0, 3) + "." + cha.substr(3, 2);
- }
- std::vector<std::vector<double>>
- gtaoidcore::calbgt::subGeJiGanGT(double dNowGanSh, double dGanJing, double GanMidu, double DXML_E, double *DdiMianWY,
- double *dYeZhong, double chongci, int TotalPoint, int UpPoint, int iNN1,
- double Viscosity, double Tubingsize, double &dzxwyzh, double &dzxwy, double &dbmaxload,
- double &dbminload, double &ddZNXShC) {
- int iNN = iNN1;
- auto dXShXiGeMa = new double[iNN]{0};
- auto dXShTao = new double[iNN]{0};
- auto dXShMiu = new double[iNN]{0};
- auto dXShDeErTa = new double[iNN]{0};
- auto dXSha = new double[iNN]{0};
- auto dXShB = new double[iNN]{0};
- auto dXShK = new double[iNN]{0};
- auto dXSHU = new double[iNN]{0};
- std::vector<std::vector<double>> Dbu;
- /*double **Dbu = new double *[2];
- Dbu[0] = new double[TotalPoint + 3];
- Dbu[1] = new double[TotalPoint + 3];*/
- auto dbengu = new double[TotalPoint]{0};
- double bmaxload = 0;
- double bminload = 0;
- auto dbengf = new double[TotalPoint]{0};
- auto dZhJZhO = new double[iNN]{0};
- auto dZhJZhP = new double[iNN]{0};
- auto dZhJZhPianO = new double[iNN]{0};
- auto dZhJZhPianP = new double[iNN]{0};
- double dZNXShC;
- double tmpdZuNiCup;
- double tmpdZuNiCdown;
- double MinshiftPoint = 1000;
- for (int i = 0; i < iNN; i++) {
- dXShXiGeMa[i] = dFunXShXiGeMa_n(chongci / 60 * 2 * MATH_PI, 60 / chongci / TotalPoint, i, dYeZhong,
- TotalPoint);
- dXShMiu[i] = dFunXShMiu_n(chongci / 60 * 2 * MATH_PI, 60 / chongci / TotalPoint, i, DdiMianWY, TotalPoint);
- dXShTao[i] = dFunXShTao_n(chongci / 60 * 2 * MATH_PI, 60 / chongci / TotalPoint, i, dYeZhong,
- TotalPoint);
- dXShDeErTa[i] = dFunXShDeErTa_n(chongci / 60 * 2 * MATH_PI, 60 / chongci / TotalPoint, i, DdiMianWY,
- TotalPoint);
- }
- dZNXShC = dFunZLXShC(chongci / 60 * 2 * MATH_PI, 4968, Viscosity, GanMidu, dGanJing * dGanJing * 0.25 * MATH_PI,
- Tubingsize,
- dGanJing, dNowGanSh);
- tmpdZuNiCup = dZNXShC;
- for (int i = 0; i < iNN; i++) {
- dXSha[i] = dFunXSha_n(chongci / 60 * 2 * MATH_PI, i, tmpdZuNiCup, 4968);
- //std::cout << "dXSha[i]:" << dXSha[i] << std::endl;
- dXShB[i] = dFunXShB_n(chongci / 60 * 2 * MATH_PI, i, tmpdZuNiCup, 4968);
- //std::cout << "dXShB[i]:" << dXShB[i] << std::endl;
- dXShK[i] = dFunXShK_n(dXSha[i], dXShB[i], dXShXiGeMa[i], dXShTao[i], DXML_E,
- dGanJing * dGanJing * 0.25 * MATH_PI);
- //std::cout << "dXShK[i]:" << dXShK[i] << std::endl;
- dXSHU[i] = dFunXShU_n(dXSha[i], dXShB[i], dXShXiGeMa[i], dXShTao[i], DXML_E,
- dGanJing * dGanJing * 0.25 * MATH_PI);
- //std::cout << "dXSHU[i]:" << dXSHU[i] << std::endl;
- }
- for (int i = 0; i < iNN; i++) {
- dZhJZhO[i] = dFunO_n(dNowGanSh, dXShK[i], dXShB[i], dXShDeErTa[i], dXSha[i], dXSHU[i], dXShMiu[i]);
- dZhJZhP[i] = dFunP_n(dNowGanSh, dXShK[i], dXShB[i], dXShDeErTa[i], dXSha[i], dXSHU[i], dXShMiu[i]);
- dZhJZhPianO[i] = dFunPianO_n(dNowGanSh, dXShK[i], dXShB[i], dXShDeErTa[i], dXSha[i], dXSHU[i], dXShMiu[i],
- dXShTao[i], dXShXiGeMa[i], DXML_E, dGanJing * dGanJing * 0.25 * MATH_PI);
- dZhJZhPianP[i] = dFunPianP_n(dNowGanSh, dXShK[i], dXShB[i], dXShDeErTa[i], dXSha[i], dXSHU[i], dXShMiu[i],
- dXShTao[i], dXShXiGeMa[i], DXML_E, dGanJing * dGanJing * 0.25 * MATH_PI);
- }
- std::vector<double> Dbu_1;
- std::vector<double> Dbu_2;
- Dbu.push_back(Dbu_1);
- Dbu.push_back(Dbu_2);
- for (int i = 0; i < UpPoint; i++) {
- dbengu[i] = dFunUxt(dNowGanSh, chongci / 60 * 2 * MATH_PI, dXShXiGeMa[0], dXShMiu[0], DXML_E,
- dGanJing * dGanJing * 0.25 * MATH_PI, iNN, dZhJZhO, dZhJZhP,
- 60 / chongci / TotalPoint * i);
- dbengf[i] = dFunFxt(chongci / 60 * 2 * MATH_PI, dXShXiGeMa[0], DXML_E, dGanJing * dGanJing * 0.25 * MATH_PI,
- iNN,
- dZhJZhPianO, dZhJZhPianP, 60 / chongci / TotalPoint * i);
- auto dbu0i = dFunUxt(dNowGanSh, chongci / 60 * 2 * MATH_PI, dXShXiGeMa[0], dXShMiu[0], DXML_E,
- dGanJing * dGanJing * 0.25 * MATH_PI, iNN, dZhJZhO, dZhJZhP,
- 60 / chongci / TotalPoint * i);
- Dbu[0].push_back(dbu0i);
- auto dbu1i = dFunFxt(chongci / 60 * 2 * MATH_PI, dXShXiGeMa[0], DXML_E, dGanJing * dGanJing * 0.25 * MATH_PI,
- iNN,
- dZhJZhPianO, dZhJZhPianP, 60 / chongci / TotalPoint * i);
- Dbu[1].push_back(dbu1i);
- if (Dbu[0][i] < MinshiftPoint) {
- MinshiftPoint = Dbu[0][i];
- dzxwyzh = Dbu[1][i] / 1000;
- dzxwy = MinshiftPoint;
- }
- if (Dbu[1][i] > bmaxload) {
- bmaxload = Dbu[1][i];
- dbmaxload = Dbu[1][i] / 1000;
- }
- if (Dbu[1][i] < bminload) {
- bminload = Dbu[1][i];
- dbminload = Dbu[1][i] / 1000;
- }
- }
- tmpdZuNiCdown = 1.2 * dZNXShC;
- for (int i = 0; i < iNN; i++) {
- dXSha[i] = dFunXSha_n(chongci / 60 * 2 * MATH_PI, i, tmpdZuNiCdown, 4968);
- dXShB[i] = dFunXShB_n(chongci / 60 * 2 * MATH_PI, i, tmpdZuNiCdown, 4968);
- dXShK[i] = dFunXShK_n(dXSha[i], dXShB[i], dXShXiGeMa[i], dXShTao[i], DXML_E,
- dGanJing * dGanJing * 0.25 * MATH_PI);
- dXSHU[i] = dFunXShU_n(dXSha[i], dXShB[i], dXShXiGeMa[i], dXShTao[i], DXML_E,
- dGanJing * dGanJing * 0.25 * MATH_PI);
- }
- for (int i = 0; i < iNN; i++) {
- dZhJZhO[i] = dFunO_n(dNowGanSh, dXShK[i], dXShB[i], dXShDeErTa[i], dXSha[i], dXSHU[i], dXShMiu[i]);
- dZhJZhP[i] = dFunP_n(dNowGanSh, dXShK[i], dXShB[i], dXShDeErTa[i], dXSha[i], dXSHU[i], dXShMiu[i]);
- dZhJZhPianO[i] = dFunPianO_n(dNowGanSh, dXShK[i], dXShB[i], dXShDeErTa[i], dXSha[i], dXSHU[i], dXShMiu[i],
- dXShTao[i], dXShXiGeMa[i], DXML_E, dGanJing * dGanJing * 0.25 * MATH_PI);
- dZhJZhPianP[i] = dFunPianP_n(dNowGanSh, dXShK[i], dXShB[i], dXShDeErTa[i], dXSha[i], dXSHU[i], dXShMiu[i],
- dXShTao[i], dXShXiGeMa[i], DXML_E, dGanJing * dGanJing * 0.25 * MATH_PI);
- }
- for (int i = UpPoint; i < TotalPoint; i++) {
- dbengu[i] = dFunUxt(dNowGanSh, chongci / 60 * 2 * MATH_PI, dXShXiGeMa[0], dXShMiu[0], DXML_E,
- dGanJing * dGanJing * 0.25 * MATH_PI, iNN, dZhJZhO, dZhJZhP,
- 60 / chongci / TotalPoint * (i - 1));
- dbengf[i] = dFunFxt(chongci / 60 * 2 * MATH_PI, dXShXiGeMa[0], DXML_E, dGanJing * dGanJing * 0.25 * MATH_PI,
- iNN,
- dZhJZhPianO, dZhJZhPianP, 60 / chongci / TotalPoint * (i - 1));
- auto Dbu0i = dFunUxt(dNowGanSh, chongci / 60 * 2 * MATH_PI, dXShXiGeMa[0], dXShMiu[0], DXML_E,
- dGanJing * dGanJing * 0.25 * MATH_PI, iNN, dZhJZhO, dZhJZhP,
- 60 / chongci / TotalPoint * (i - 1));
- Dbu[0].push_back(Dbu0i);
- auto Dbu1i = dFunFxt(chongci / 60 * 2 * MATH_PI, dXShXiGeMa[0], DXML_E, dGanJing * dGanJing * 0.25 * MATH_PI,
- iNN,
- dZhJZhPianO, dZhJZhPianP, 60 / chongci / TotalPoint * (i - 1));
- Dbu[1].push_back(Dbu1i);
- if (Dbu[0][i] < MinshiftPoint) {
- MinshiftPoint = Dbu[0][i];
- dzxwyzh = Dbu[1][i] / 1000;
- dzxwy = MinshiftPoint;
- }
- if (Dbu[1][i] > bmaxload) {
- bmaxload = Dbu[1][i];
- dbmaxload = Dbu[1][i] / 1000;
- }
- if (Dbu[1][i] < bminload) {
- bminload = Dbu[1][i];
- dbminload = Dbu[1][i] / 1000;
- }
- }
- ddZNXShC = dZNXShC;
- return Dbu;
- }
- double gtaoidcore::calbgt::dFunXShXiGeMa_n(double dWuMiGa, double DT, int iCShn, double *dZaiHe, int iDianShu) {
- double dFunXShXiGeMa = 0;
- for (int i = 0; i < iDianShu; i++) {
- dFunXShXiGeMa = dFunXShXiGeMa + dZaiHe[i] * std::cos(iCShn * dWuMiGa * i * DT) * DT;
- }
- return dFunXShXiGeMa * dWuMiGa / MATH_PI;
- }
- double gtaoidcore::calbgt::dFunXShTao_n(double dWuMiGa, double DT, int iCShn, double *dZaiHe, int iDianShu) {
- double dFunXShTao = 0;
- for (int i = 0; i < iDianShu; i++) {
- dFunXShTao = dFunXShTao + dZaiHe[i] * std::sin(iCShn * dWuMiGa * i * DT) * DT;
- }
- return dFunXShTao * dWuMiGa / MATH_PI;
- }
- double gtaoidcore::calbgt::dFunXShMiu_n(double dWuMiGa, double DT, int iCShn, double *dWeiYi, int iDianShu) {
- double dFunXShMiu_n = 0;
- for (int i = 0; i < iDianShu; i++) {
- dFunXShMiu_n = dFunXShMiu_n + dWeiYi[i] * std::cos(iCShn * dWuMiGa * i * DT) * DT;
- }
- //double temp = dFunXShMiu_n;
- return dFunXShMiu_n * dWuMiGa / MATH_PI;
- }
- double gtaoidcore::calbgt::dFunXShDeErTa_n(double dWuMiGa, double DT, int iCShn, double *dWeiYi, int iDianShu) {
- double dFunXShDeErTa_n = 0;
- for (int i = 0; i < iDianShu; i++) {
- dFunXShDeErTa_n = dFunXShDeErTa_n + dWeiYi[i] * std::sin(iCShn * dWuMiGa * i * DT) * DT;
- }
- return dFunXShDeErTa_n * dWuMiGa / MATH_PI;
- }
- double gtaoidcore::calbgt::dFunFLYZaiHe(double dWuMiGa, int iCShn, double *dXiGeMa, double *dTao, double dShiJian_t) {
- double dFunFLYZaiHe = dXiGeMa[0] / 2;
- for (int i = 1; i < iCShn; i++) {
- dFunFLYZaiHe = dFunFLYZaiHe + dXiGeMa[i] * std::cos(i * dWuMiGa * dShiJian_t) +
- dTao[i] * std::sin(i * dWuMiGa * dShiJian_t);
- }
- return dFunFLYZaiHe;
- }
- double gtaoidcore::calbgt::dFunYWeiYi(double dWuMiGa, int iCShn, double *dMiu, double *dDeErTa, double dShiJian_t) {
- double dFunFLYWeiYi = dMiu[0] / 2;
- for (int i = 1; i < iCShn; i++) {
- dFunFLYWeiYi = dFunFLYWeiYi + dMiu[i] * std::cos(i * dWuMiGa * dShiJian_t) +
- dDeErTa[i] * std::sin(i * dWuMiGa * dShiJian_t);
- }
- return dFunFLYWeiYi;
- }
- double gtaoidcore::calbgt::dFunSH(double dz) {
- return (std::exp(dz) - std::exp(-dz)) * 0.5;
- }
- double dFunCH(double dz) {
- return (std::exp(dz) + std::exp(-dz)) * 0.5;
- }
- double gtaoidcore::calbgt::dFunXSha_n(double dWuMiGa, int iCShn, double dCShC, double dCSHa) {
- iCShn++;
- double te =
- iCShn * dWuMiGa / dCSHa / std::sqrt(2) * std::sqrt(1 + std::sqrt(1 + std::pow(dCShC / iCShn / dWuMiGa, 2)));
- return te;
- }
- double gtaoidcore::calbgt::dFunXShB_n(double dWuMiGa, int iCShn, double dCShC, double dCSHa) {
- iCShn++;
- return iCShn * dWuMiGa / dCSHa / std::sqrt(2) * std::sqrt(-1 + std::sqrt(1 + std::pow(dCShC / iCShn / dWuMiGa, 2)));
- }
- double gtaoidcore::calbgt::dFunXShK_n(double dan, double dBn, double DXiGeMa, double dTaon, double dE, double dAr) {
- return (DXiGeMa * dan + DXiGeMa * dBn) / (dE * dAr * (std::pow(dan, 2) + std::pow(dBn, 2)));
- }
- double gtaoidcore::calbgt::dFunXShU_n(double dan, double dBn, double DXiGeMan, double dTaon, double dE, double dAr) {
- return (DXiGeMan * dBn - dTaon * dan) / (dE * dAr * (std::pow(dan, 2) + std::pow(dBn, 2)));
- }
- double gtaoidcore::calbgt::dFunZLXShC(double dWuMiGa, double dCSHa, double dCSh_u, double dRor, double dAr, double dDt,
- double dDr, double dL) {
- double tmpm, tmpQXSh, tmpFM;
- double tmpB1, tmpB2;
- tmpm = dDt / dDr;
- tmpFM = dWuMiGa * dL / (dCSHa * std::sin(dWuMiGa * dL / dCSHa)) + std::cos(dWuMiGa * dL / dCSHa);
- tmpFM = 2 / tmpFM;
- tmpB1 = (tmpm * tmpm - 1) / (2 * std::log(tmpm)) - 1;
- tmpB2 = std::pow(tmpm, 4) - 1 - std::pow((tmpm * tmpm - 1), 2) / std::log(tmpm);
- tmpQXSh = 2 * MATH_PI * dCSh_u / dRor / dAr;
- //double t = std::log(tmpm);
- double temp = tmpQXSh * (1 / std::log(tmpm) + 4 * (tmpB1 + 1) / tmpB2 * (tmpB1 + tmpFM));
- return temp;
- }
- double
- gtaoidcore::calbgt::dFunO_n(double dx, double dKn, double dBn, double dDeErTan, double dan, double dUn, double dMiun) {
- double t = (dKn * dFunCH(dBn * dx) + dDeErTan * dFunSH(dBn * dx)) * std::sin(dan * dx) +
- (dUn * dFunSH(dBn * dx) + dMiun * dFunCH(dBn * dx)) * std::cos(dan * dx);
- return t;
- }
- double
- gtaoidcore::calbgt::dFunP_n(double dx, double dKn, double dBn, double dDeErTan, double dan, double dUn, double dMiun) {
- double t = (dKn * dFunSH(dBn * dx) + dDeErTan * dFunCH(dBn * dx)) * std::cos(dan * dx) -
- (dUn * dFunCH(dBn * dx) + dMiun * dFunSH(dBn * dx)) * std::sin(dan * dx);
- return t;
- }
- double gtaoidcore::calbgt::dFunPianO_n(double dx, double dKn, double dBn, double dDeErTan, double dan, double dUn,
- double dMiun, double dTaon, double DXiGeMan, double dE, double dAr) {
- double t = (dTaon / (dE * dAr) * dFunSH(dBn * dx) + (dDeErTan * dBn - dan * dMiun) * dFunCH(dBn * dx)) *
- std::sin(dan * dx) +
- (DXiGeMan / (dE * dAr) * dFunCH(dBn * dx) + (dDeErTan * dan + dBn * dMiun) * dFunSH(dBn * dx)) *
- std::cos(dan * dx);
- return t;
- }
- double gtaoidcore::calbgt::dFunPianP_n(double dx, double dKn, double dBn, double dDeErTan, double dan, double dUn,
- double dMiun, double dTaon, double DXiGeMan, double dE, double dAr) {
- return (dTaon / (dE * dAr) * dFunCH(dBn * dx) + (dDeErTan * dBn - dan * dMiun) * dFunSH(dBn * dx)) *
- std::cos(dan * dx) -
- (DXiGeMan / (dE * dAr) * dFunSH(dBn * dx) + (dDeErTan * dan + dBn * dMiun) * dFunCH(dBn * dx)) *
- std::sin(dan * dx);
- }
- double
- gtaoidcore::calbgt::dFunUxt(double dx, double dWuMiGa, double dXiGeMa0, double dMiu0, double dE, double dAr, int iCShn,
- double *dOn, double *dPn, double dShiJian_t) {
- double dFunUxt = dXiGeMa0 / (2 * dE * dAr) * dx + dMiu0 / 2;
- for (int i = 1; i < iCShn; i++) {
- dFunUxt = dFunUxt + dOn[i] * std::cos(i * dWuMiGa * dShiJian_t) + dPn[i] * std::sin(i * dWuMiGa * dShiJian_t);
- }
- return dFunUxt;
- }
- double gtaoidcore::calbgt::dFunFxt(double dWuMiGa, double dXiGeMa0, double dE, double dAr, int iCShn, double *dPianOn,
- double *dPianPn, double dShiJian_t) {
- double dFunFxt = 0;
- for (int i = 1; i < iCShn; i++) {
- dFunFxt = dFunFxt + dPianOn[i] * std::cos(i * dWuMiGa * dShiJian_t) +
- dPianPn[i] * std::sin(i * dWuMiGa * dShiJian_t);
- }
- dFunFxt = dFunFxt + dXiGeMa0 / (2 * dE * dAr);
- double t = dE * dAr * dFunFxt;
- return t;
- }
- std::vector<double>
- gtaoidcore::cal_ylandon(std::vector<std::vector<double>> sgt, std::vector<std::vector<double>> bgt, double cc,
- double cc1, std::string zdjg,
- double bj, double bs, double hsl, double smd, double ymd, double qyb,
- double dym, double bdxs, double gradient_1, double gradient_10,
- double gradient_2, double gradient_3, double gradient_4, double gradient_5,
- double gradient_6, double gradient_7, double gradient_8, double gradient_9,
- double dividenum_1, double dividenum_2, double dividenum_3,
- double dividenum_4,
- double dividenum_5, double dividenum_6, double dividenum_7,
- double dividenum_8,
- double dividenum_9, double dividenum_10) {
- /*double Card_Load;
- double Card_Shift;*/
- /*double PumpCard_Load;
- double PumpCard_Shift;*/
- double Card_MaxShift;
- double Card_MinShift;
- double Card_MaxLoad;
- double Card_MinLoad;
- double Card_Power;
- double PumpCard_MaxShift;
- double PumpCard_MinShift;
- double PumpCard_MaxLoad;
- double PumpCard_MinLoad;
- double PumpCard_Power;
- std::vector<CardSlopeRec> CardSlope_array;
- int Card_Point;
- std::string L_cjsj;
- std::string L_jh;
- std::vector<std::vector<double>> L_bgt;
- std::vector<std::vector<double>> L_sgt;
- double L_Cycle;
- double L_Cc;
- double L_Bj;
- double L_Llbj;
- double L_Hs;
- double L_Bx;
- double L_Rcl;
- double L_Rcyl;
- double L_Rcsl;
- double L_RclT;
- double L_RcylT;
- double L_RcslT;
- double L_Rcql;
- double L_Ccsmd;
- double L_Dmyybz;
- double L_Qyb;
- double L_Dym;
- double L_Cmd;
- double L_Bs;
- double L_DownLoadLevel = 0;
- double L_UpLoadLevel = 0;
- double L_TheoryLoadLiquid = 0;
- double Productioncoefficient = 0;
- double L_TempDownLevel;
- double L_TempUpLevel;
- int L_TempNum;
- std::string L_Zdjg;
- std::string L_ZdjgJc;
- std::string L_Load;
- std::string L_Shift;
- std::string L_ShiftLoad;
- int L_Count;
- double l_StrokeRatio;
- int I = 1;
- int j = 0;
- int L_LeftDownPoint;
- int L_RightDownPoint;
- double L_LeftDownLoad;
- double L_RightDownLoad;
- double L_LeftDownStroke;
- double L_LeftDownStroke1;
- double L_LeftDownStroke2;
- double L_RightDownStroke;
- int L_LeftUpPoint;
- int L_RightUpPoint;
- double L_LeftUpLoad;
- double L_RightUpLoad;
- double L_LeftUpStroke;
- double L_RightUpStroke;
- double L_UpEffectiveStroke;
- double L_DivideLoad;
- std::string L_Zyq;
- double L_Sjcc;
- double L_Yxcc;
- double L_Zcc;
- double L_Ycc;
- double L_Ccss;
- double L_Llpl;
- double L_Lsss;
- double L_Gyss;
- double L_PumpDepth = 0;
- double L_DivideNum;
- double L_LeftDownLeak;
- double L_DownPointDivide;
- double L_Gradient = 15;
- double L_Gradient1 = 15;
- int L_UpPointDivide = 0;
- double L_Bdxs1;
- double L_Bdxs;
- L_sgt = sgt;
- L_bgt = bgt;
- L_Cc = cc;
- L_Cycle = cc1;
- L_Zdjg = zdjg;
- L_Bj = bj;
- L_Bs = bs;
- L_Hs = hsl;
- L_Ccsmd = smd;
- L_Dmyybz = ymd;
- L_Qyb = qyb;
- L_Dym = dym;
- L_Bdxs = bdxs;
- //L_zyq = zyq;
- L_LeftDownStroke = 0;
- L_LeftDownPoint = 0;
- L_LeftDownLoad = 0;
- Card_MaxShift = 0;
- Card_MinShift = 0;
- Card_MaxLoad = 0;
- Card_MinLoad = 0;
- Card_Power = 0;
- PumpCard_MaxShift = 0;
- PumpCard_MinShift = 0;
- PumpCard_MaxLoad = 0;
- PumpCard_MinLoad = 0;
- PumpCard_Power = 0;
- Card_Point = 0;
- Card_Point = L_sgt.size();
- Card_Power = 0;
- PumpCard_Power = 0;
- L_LeftDownStroke1 = 15;
- L_LeftDownStroke2 = -15;
- //Card_MaxLoad=std::atof(L_sgt.substr(3+8*(-1),5))/100;
- for (int i = 0; i < Card_Point; i++) {
- CardSlopeRec CardSlope;
- /* Card_Shift = L_sgt[i][0];
- Card_Load = L_sgt[i][1];
- PumpCard_Shift = L_bgt[i][0];
- PumpCard_Load = L_bgt[i][1];*/
- int previousindex = i - 1;
- if (i == 0) {
- previousindex = Card_Point - 1;
- Card_MaxLoad = L_sgt[i][1];
- Card_MinLoad = L_sgt[i][1];
- Card_MaxShift = L_sgt[i][0];
- Card_MinShift = L_sgt[i][0];
- PumpCard_MaxLoad = L_bgt[i][1];
- PumpCard_MinLoad = L_bgt[i][1];
- PumpCard_MaxShift = L_bgt[i][0];
- PumpCard_MinShift = L_bgt[i][0];
- L_LeftDownStroke = L_bgt[i][0];
- L_LeftDownLoad = L_bgt[i][1];
- L_LeftDownPoint = i;
- }
- if (Card_MaxLoad < L_sgt[i][1]) Card_MaxLoad = L_sgt[i][1];
- else if (Card_MinLoad > L_sgt[i][1]) Card_MinLoad = L_sgt[i][1];
- if (Card_MaxShift < L_sgt[i][0]) Card_MaxShift = L_sgt[i][0];
- else if (Card_MinShift > L_sgt[i][0]) Card_MinShift = L_sgt[i][0];
- if (PumpCard_MaxLoad < L_bgt[i][1]) PumpCard_MaxLoad = L_bgt[i][1];
- else if (PumpCard_MinLoad > L_bgt[i][1]) PumpCard_MinLoad = L_bgt[i][1];
- if (PumpCard_MaxShift < L_bgt[i][0]) PumpCard_MaxShift = L_bgt[i][0];
- else if (PumpCard_MinShift > L_bgt[i][0]) PumpCard_MinShift = L_bgt[i][0];
- if (L_bgt[i][0] >= 0 && L_bgt[previousindex][1] <= 0) {
- if (L_LeftDownStroke1 > (L_bgt[i][0] + L_bgt[previousindex][0]) / 2)
- L_LeftDownStroke1 = (L_bgt[i][0] + L_bgt[previousindex][0]) / 2;
- }
- if (L_bgt[i][0] <= 0 && L_bgt[previousindex][1] >= 0) {
- if (L_LeftDownStroke2 < (L_bgt[i][0] + L_bgt[previousindex][0]) / 2) {
- L_LeftDownStroke2 = (L_bgt[i][0] + L_bgt[i][0]) / 2;
- //用的I TODO:check
- //L_LeftDownStroke2 = (L_bgt[i][0] + L_bgt[previousindex][0]) / 2;
- }
- }
- int nextindex = i + 1;
- if (i == Card_Point - 1) {
- nextindex = 0;
- }
- Card_Power = Card_Power + (L_sgt[nextindex][1] + L_sgt[i][1]) * (L_sgt[nextindex][0] - L_sgt[i][0]) / 2;
- PumpCard_Power =
- PumpCard_Power + (L_bgt[nextindex][1] + L_bgt[i][1]) * (L_bgt[nextindex][0] - L_bgt[i][0]) / 2;
- if ((L_sgt[nextindex][0] - L_sgt[i][0]) == 0)
- CardSlope.Card_Slope = 100;
- else
- CardSlope.Card_Slope = std::abs((L_sgt[nextindex][1] - L_sgt[i][1]) / (L_sgt[nextindex][0] - L_sgt[i][0]));
- if ((L_bgt[nextindex][0] - L_bgt[i][0]) == 0)
- CardSlope.PumpCard_Slope = 100;
- else
- CardSlope.PumpCard_Slope = std::abs(
- (L_bgt[nextindex][1] - L_bgt[i][1]) / (L_bgt[nextindex][0] - L_bgt[i][0]));
- CardSlope.PumpCard_Shift = L_bgt[i][0];
- if (CardSlope.Card_Slope >= 100)
- CardSlope.Card_Slope = 100;
- if (CardSlope.Card_Slope <= -100)
- CardSlope.Card_Slope = 100;
- if (CardSlope.PumpCard_Slope >= 100)
- CardSlope.PumpCard_Slope = 100;
- if (CardSlope.PumpCard_Slope <= -100)
- CardSlope.PumpCard_Slope = 100;
- CardSlope_array.push_back(CardSlope);
- }
- Card_Power = std::abs(Card_Power) / (60 / L_Cycle);
- PumpCard_Power = std::abs(PumpCard_Power) / (60 / L_Cycle);
- L_Bx = 0;
- L_Rcl = 0;
- L_Rcyl = 0;
- L_Rcsl = 0;
- L_Rcql = 0;
- L_RightDownPoint = 0;
- L_RightDownLoad = 0;
- L_RightDownStroke = 0;
- L_LeftUpPoint = 0;
- L_RightUpPoint = 0;
- L_LeftUpLoad = 0;
- L_RightUpLoad = 0;
- L_LeftUpStroke = 0;
- L_RightUpStroke = 0;
- L_UpEffectiveStroke = 0;
- L_Sjcc = 0;
- L_Yxcc = 0;
- L_Ccss = 0;
- L_Llpl = 0;
- L_Lsss = 0;
- L_Gyss = 0;
- L_Cmd = 0;
- L_Gradient = 35;
- L_UpPointDivide = 0;
- l_StrokeRatio = 0;
- L_DivideNum = 3.5;
- L_DivideLoad = (PumpCard_MaxLoad - PumpCard_MinLoad) / L_DivideNum;
- for (int i = 0; i < Card_Point / 2; i++) {
- int lastindex = Card_Point - i - 1;
- if (L_bgt[lastindex][1] < (PumpCard_MinLoad + L_DivideLoad) &&
- CardSlope_array[lastindex].PumpCard_Slope < L_Gradient)//jkl
- L_RightDownLoad = L_bgt[lastindex][1];
- L_RightDownStroke = CardSlope_array[lastindex].PumpCard_Shift;
- L_RightDownPoint = lastindex;
- }
- if (L_RightDownStroke == 0)
- L_RightDownStroke = L_LeftDownStroke;
- if ((PumpCard_MaxShift - PumpCard_MinShift) != 0) {
- l_StrokeRatio = (L_RightDownStroke - L_LeftDownStroke) * 100 / (PumpCard_MaxShift - PumpCard_MinShift);
- }
- if (false)
- if (L_Bdxs <= 0) {
- L_Bdxs = 1;
- }
- //IF L_BDXS IS NULL OR L_BDXS<=0 THEN L_BDXS=1; END IF;
- bool p_gybz = std::strcmp(L_Zdjg.c_str(), "供液不足") >= 0;
- if ((std::strcmp(L_Zdjg.c_str(), "供液正常") >= 0 || p_gybz) && l_StrokeRatio > 80)
- L_Gradient = gradient_1;
- L_DivideNum = dividenum_1;
- if (p_gybz && l_StrokeRatio <= 80)
- L_Gradient = gradient_2;
- L_DivideNum = dividenum_2;
- if (p_gybz && l_StrokeRatio <= 45)
- L_Gradient = gradient_3;
- L_DivideNum = dividenum_3;
- if (p_gybz && l_StrokeRatio <= 35)
- L_Gradient = gradient_4;
- L_DivideNum = dividenum_4;
- if (p_gybz && l_StrokeRatio <= 25)
- L_Gradient = gradient_5;
- L_DivideNum = dividenum_5;
- if (p_gybz && l_StrokeRatio <= 20)
- L_Gradient = gradient_6;
- L_DivideNum = dividenum_6;
- if (p_gybz && l_StrokeRatio <= 15)
- L_Gradient = gradient_7;
- L_DivideNum = dividenum_7;
- auto p_qyx = std::strcmp(L_Zdjg.c_str(), "气影响") >= 0;
- if (p_qyx && l_StrokeRatio >= 35)
- L_Gradient = gradient_8;
- L_DivideNum = dividenum_8;
- if (p_qyx && l_StrokeRatio < 35)
- L_Gradient = gradient_9;
- L_DivideNum = dividenum_9;
- if (p_qyx && l_StrokeRatio < 20)
- L_Gradient = gradient_10;
- L_DivideNum = dividenum_10;
- L_DivideLoad = (PumpCard_MaxLoad - PumpCard_MinLoad) / L_DivideNum;
- L_DownPointDivide = 0;
- L_LeftDownLeak = 0;
- L_LeftUpStroke = 0;
- L_LeftDownLeak = 0;
- if (L_Bj > 57)
- L_Gradient1 = 5;
- for (int i = 0; i < Card_Point / 2; i++) {
- int lastindex = Card_Point - i - 1;
- if (L_bgt[lastindex][1] < (PumpCard_MinLoad + L_DivideLoad) &&
- CardSlope_array[lastindex].PumpCard_Slope < L_Gradient) {
- L_RightDownLoad = L_bgt[lastindex][1];
- L_RightDownStroke = CardSlope_array[lastindex].PumpCard_Shift;
- L_RightDownPoint = lastindex;
- if (L_DownPointDivide == 0 && std::abs(CardSlope_array[lastindex].PumpCard_Slope) < 25 &&
- L_bgt[lastindex][1] < (PumpCard_MinLoad + L_DivideLoad)) {
- L_LeftDownLeak = CardSlope_array[lastindex].PumpCard_Shift;
- L_DownPointDivide = 1;
- }
- }
- if (L_UpPointDivide == 0 && std::abs(CardSlope_array[i].PumpCard_Slope) < 5 &&
- L_bgt[i][1] > ((PumpCard_MaxLoad - PumpCard_MinLoad) * 0.7 + PumpCard_MinLoad)) {
- L_LeftUpLoad = L_bgt[i][1];
- L_LeftUpStroke = CardSlope_array[i].PumpCard_Shift;
- L_LeftUpPoint = i;
- L_UpPointDivide = 1;
- }
- if (L_UpPointDivide == 1 && std::abs(CardSlope_array[i].PumpCard_Slope) < 5 &&
- L_bgt[i][1] > ((PumpCard_MaxLoad - PumpCard_MinLoad) * 0.8 + PumpCard_MinLoad)) {
- L_RightUpLoad = L_bgt[i][1];
- L_RightUpStroke = CardSlope_array[i].PumpCard_Shift;
- L_RightUpPoint = i;
- }
- }
- if (L_RightDownStroke <= 0) {
- L_RightDownStroke = L_LeftDownStroke;
- }
- //if L_RightDownStroke is null then L_RightDownStroke=L_LeftDownStroke; end if;
- if (L_Cc <= 0) {
- L_Cc = Card_MaxShift;
- }
- //if L_Cc is null then L_Cc=card_maxshift; end if;
- L_Ycc = L_RightDownStroke;
- L_Zcc = L_LeftDownStroke;
- if (L_Bj <= 95) {
- L_Llpl = L_Cycle * L_Cc * 24 * 60 * L_Bj * L_Bj * MATH_PI / 4000000;
- }
- //if L_Bj<=95 then L_Llpl=L_Cycle*L_Cc*24*60*L_Bj*L_Bj*3.1415926/4000000; end if;--理论排量---------------------------------
- L_Sjcc = PumpCard_MaxShift - PumpCard_MinShift;//--实际冲程
- L_Ccss = L_Cc - L_Sjcc;//--冲程损失
- if (L_Ccss < 0)
- L_Ccss = 0;
- //if L_Ccss<0 then L_Ccss=0; end if;
- L_Lsss = 0;
- if (std::strcmp(L_Zdjg.c_str(), "泵工作正常") >= 0 || std::strcmp(L_Zdjg.c_str(), "碰泵") >= 0)
- L_Lsss = 0;
- if (std::strcmp(L_Zdjg.c_str(), "游动凡尔漏失") >= 0)
- L_Lsss = (PumpCard_MaxShift - L_RightUpStroke) * 2;
- if (std::strcmp(L_Zdjg.c_str(), "固定凡尔漏失") >= 0)
- L_Lsss = L_Lsss + (L_LeftDownLeak - PumpCard_MinShift) * 2;
- if (std::strcmp(L_Zdjg.c_str(), "冲次过快") >= 0)
- L_Lsss = (PumpCard_MaxShift - L_RightUpStroke) * 2;
- if (L_Lsss < 0)
- L_Lsss = 0;
- L_Yxcc = L_RightDownStroke - L_LeftDownStroke - L_Lsss;
- if (L_Yxcc <= 0)
- L_Yxcc = 0;
- L_Gyss = L_Sjcc - L_Yxcc;
- if (L_Gyss < 0)
- L_Gyss = 0;
- if (L_Gyss == 0)
- L_Bx = 0;
- else L_Bx = L_Yxcc / L_Cc * 100;
- if (L_Bj > 0 && L_Bj <= 95) {
- if (L_Bj * L_Bj * MATH_PI / 4 * 24 * 60 * L_Cycle * L_Cc * L_Bx / 100000000 >
- 0.0087 * std::pow(2.71828, 0.0027 * L_Bs))
- L_Rcl = L_Bj * L_Bj * MATH_PI / 4 * 24 * 60 * L_Cycle * L_Cc * L_Bx / 100000000 *
- L_Bdxs;//---0.0087*power(2.71828,0.0027*nvl(L_Bs,0));
- else
- L_Rcl = L_Bj * L_Bj * MATH_PI / 4 * 24 * 60 * L_Cycle * L_Cc * L_Bx / 100000000 * L_Bdxs;
- if (L_Rcl <= 0)
- L_Rcl = 0;
- if (L_Hs <= 100) {
- L_Rcsl = L_Rcl * L_Hs / 100;
- L_Rcyl = L_Rcl - L_Rcsl;
- if (L_Ccsmd > 1 && L_Ccsmd < 1.5) {}
- else
- L_Ccsmd = 1.05;
- if (L_Dmyybz > 0.6 && L_Dmyybz < 1.5) {}
- else
- L_Dmyybz = 0.83;
- if (L_Bs > 0)
- L_TheoryLoadLiquid = MATH_PI / 4 * (L_Bj * L_Bj / 1000000) * L_Bs *
- ((1 - L_Hs / 100) * L_Dmyybz + L_Hs / 100 * L_Ccsmd) * 9.8 *
- (1 + L_Cycle * Card_MaxShift / 127);
- else
- L_TheoryLoadLiquid = MATH_PI / 4 * (L_Bj * L_Bj / 1000000) * L_PumpDepth *
- ((1 - L_Hs / 100) * L_Dmyybz + L_Hs / 100 * L_Ccsmd) * 9.8 *
- (1 + L_Cycle * Card_MaxShift / 127);
- if (L_Qyb >= 0)
- L_Rcql = L_Qyb * L_Rcyl;
- Productioncoefficient = 1;
- if ((PumpCard_MaxLoad - PumpCard_MinLoad) / L_TheoryLoadLiquid < 0.8 && !std::strcmp(zdjg.c_str(), "喷抽") &&
- L_Bs > 1750)
- Productioncoefficient = (PumpCard_MaxLoad - PumpCard_MinLoad) / L_TheoryLoadLiquid;
- else
- Productioncoefficient = 1;
- L_Rcsl = L_Ccsmd * L_Rcsl * Productioncoefficient;
- L_Rcyl = L_Dmyybz * L_Rcyl * Productioncoefficient;
- L_Rcl = L_Rcsl + L_Rcyl;
- } else {
- L_Llbj = std::sqrt((PumpCard_MaxLoad - PumpCard_MinLoad) * 4 / (9.8 * L_PumpDepth * MATH_PI)) *
- 1000;//--+power(0.019,2)
- }
- }
- if (L_Hs < 0 || L_Dmyybz < 0 || L_Ccsmd < 0 || L_Qyb < 0 || L_Bj <= 0 || L_Bj > 95) {
- L_ZdjgJc = "基本数据不全";
- L_Zdjg += L_ZdjgJc;
- }
- L_Dym = -10;//什么情况
- if (L_Dym >= 0 && L_Bj <= 95)//什么情况
- {
- if (L_Bs <= 0)
- L_Bs = L_PumpDepth;
- if (L_Hs < 0 || L_Hs > 100)
- L_Hs = 60;
- if (L_Dmyybz <= 0)
- L_Dmyybz = 0.84;
- if (L_Ccsmd <= 0)
- L_Ccsmd = 1.05;
- if (L_Bj <= 0)
- L_Bj = 38;
- } else {
- if (L_Bs <= 0)
- L_Bs = L_PumpDepth;
- if (L_Hs < 0 || L_Hs > 100)
- L_Hs = 60;
- if (L_Dmyybz <= 0)
- L_Dmyybz = 0.84;
- if (L_Ccsmd <= 0)
- L_Ccsmd = 1.05;
- if (L_Bj <= 0 || L_Bj > 95)
- L_Bj = 38;
- if ((((1 - L_Hs / 100) * L_Dmyybz + L_Hs / 100 * L_Ccsmd) * 9.8 * 0.25 * MATH_PI * std::pow(L_Bj, 2) / 1000) == 0)
- L_Cmd = 0;
- else {
- L_Cmd = std::abs(PumpCard_MinLoad * L_Yxcc / L_Sjcc) * 1000 /
- (((1 - L_Hs / 100) * L_Dmyybz + L_Hs / 100 * L_Ccsmd) * 9.8 * 0.25 * MATH_PI * std::pow(L_Bj, 2) /
- 1000);
- L_Dym = L_Bs - L_Cmd;
- }
- }
- if (L_Gyss < PumpCard_MaxShift || L_Ccss < PumpCard_MaxShift || L_Lsss < PumpCard_MaxShift)
- PumpCard_MaxShift = L_Cc;
- double rcyl1 = L_Rcl;
- double rcyl = L_Rcyl;
- double rcsl = L_Rcsl;
- double rcql = L_Rcql;
- double bx = L_Bx;
- double llpl = L_Llpl;
- double sjcc = L_Sjcc;
- double yxcc = L_Yxcc;
- double zcc = L_Zcc;
- double ycc = L_Ycc;
- double ccss = L_Ccss;
- double lsss = L_Lsss;
- double gyss = L_Gyss;
- double pumpdepth = L_PumpDepth;
- /* std::string str = "";
- str += std::to_string(rcyl1) + ";" + std::to_string(rcyl) + ";" + std::to_string(rcsl) + ";" +
- std::to_string(rcql) + ";" + std::to_string(bx) + ";" + std::to_string(llpl) + ";" + std::to_string(sjcc) +
- ";" + std::to_string(
- yxcc) + ";" + std::to_string(zcc) +
- ";" + std::to_string(ycc) + ";" + std::to_string(ccss) + ";" + std::to_string(lsss) + ";" + std::to_string(
- gyss) + ";" + std::to_string(l_StrokeRatio) + ";";*/
- std::vector<double> res;
- res.push_back(rcyl1);
- res.push_back(rcyl);
- res.push_back(rcsl);
- res.push_back(rcql);
- res.push_back(bx);
- res.push_back(llpl);
- res.push_back(sjcc);
- res.push_back(yxcc);
- res.push_back(zcc);
- res.push_back(ycc);
- res.push_back(ccss);
- res.push_back(lsss);
- res.push_back(gyss);
- res.push_back(l_StrokeRatio);
- return res;
- }
|