{"ScriptPreparationCode":"const { cos, pow, PI, sin, sqrt } = Math\r\nconst sq = x =\u003E x*x\r\n\r\nfunction dfdxStraightNew (method, cBlow, Dcable, lCable, cableCount, Wn, Bn, Dduct, cof, A, P, pressure, pressureHead, slope, x, y) {\r\n const psonic = (1 - cBlow) * pressure\r\n let WB = 0\r\n let TEF = 0\r\n if (A / 100 \u003E (Dduct - Dcable) / 2000) {\r\n WB = 3 * (A / 100 - Dduct / 2000 \u002B Dcable / 2000) * Bn / 2 / pow(P / 4, 4)\r\n TEF = 8 * PI * (A / 100 - Dduct / 2000 \u002B Dcable / 2000) / (P * P)\r\n }\r\n const Buckle = (Dduct - Dcable) / (1000 * PI * PI * Bn)\r\n\r\n let pp = 0\r\n if (method === \u0027jetting\u0027) {\r\n pp = PI * Dcable * Dduct / 8 / lCable * (pow(pressure \u002B 1, 2) - pow(psonic \u002B pressureHead \u002B 1, 2)) / sqrt(pow(pressure \u002B 1, 2) - (pow(pressure \u002B 1, 2) - pow(psonic \u002B pressureHead \u002B 1, 2)) * x / lCable) / 10\r\n } else if (method === \u0027waterpushpull\u0027 || method === \u0027floating\u0027 || method === \u0027freefloating\u0027) {\r\n pp = PI * Dcable * Dduct / 4 / lCable * (pressure - psonic - pressureHead) / 10 * cableCount * (Dduct \u002B Dcable) / (Dduct \u002B cableCount * Dcable)\r\n }\r\n\r\n if (y \u003E 0) {\r\n return cof * sqrt(pow(Wn * cos(slope), 2) \u002B pow(TEF * y \u002B WB, 2)) \u002B Wn * sin(slope) - pp\r\n } else {\r\n return cof * sqrt(pow(Wn * cos(slope), 2) \u002B pow(TEF * y \u002B WB, 2) \u002B pow(Buckle * y * y, 2)) \u002B Wn * sin(slope) - pp\r\n }\r\n}\r\n\r\nfunction dfdxStraightNew2 (method, cBlow, Dcable, lCable, cableCount, Wn, Bn, Dduct, cof, A, P, pressure, pressureHead, slope, x, y) {\r\n const psonic = (1 - cBlow) * pressure\r\n let WB = 0\r\n let TEF = 0\r\n if (A / 100 \u003E (Dduct - Dcable) / 2000) {\r\n WB = 3 * (A / 100 - Dduct / 2000 \u002B Dcable / 2000) * Bn / 2 / pow(P / 4, 4)\r\n TEF = 8 * PI * (A / 100 - Dduct / 2000 \u002B Dcable / 2000) / (P * P)\r\n }\r\n const Buckle = (Dduct - Dcable) / 1000 / (PI * PI) / Bn\r\n\r\n let pp = 0\r\n if (method === \u0027jetting\u0027) {\r\n pp = PI * Dcable * Dduct / 8 / lCable * (sq(pressure \u002B 1) - sq(psonic \u002B pressureHead \u002B 1)) / sqrt(sq(pressure \u002B 1) - (sq(pressure \u002B 1) - sq(psonic \u002B pressureHead \u002B 1)) * x / lCable) / 10\r\n } else if (method === \u0027waterpushpull\u0027 || method === \u0027floating\u0027 || method === \u0027freefloating\u0027) {\r\n pp = PI * Dcable * Dduct / 4 / lCable * (pressure - psonic - pressureHead) / 10 * cableCount * (Dduct \u002B Dcable) / (Dduct \u002B cableCount * Dcable)\r\n }\r\n\r\n if (y \u003E 0) {\r\n return cof * sqrt(sq(Wn * cos(slope)) \u002B sq(TEF * y \u002B WB)) \u002B Wn * sin(slope) - pp\r\n } else {\r\n return cof * sqrt(sq(Wn * cos(slope)) \u002B sq(TEF * y \u002B WB) \u002B sq(Buckle * y * y)) \u002B Wn * sin(slope) - pp\r\n }\r\n}","TestCases":[{"Name":"pow","Code":"dfdxStraightNew(\u0027jetting\u0027, 1, 19, 2437, 1, 2.941994999999995, 9.5, 42, 0.1092, 5, 10, 12, 0.33886251591322436, 0, 1001.3587388228319, 9.17014015195002)","IsDeferred":false},{"Name":"sq","Code":"dfdxStraightNew2(\u0027jetting\u0027, 1, 19, 2437, 1, 2.941994999999995, 9.5, 42, 0.1092, 5, 10, 12, 0.33886251591322436, 0, 1001.3587388228319, 9.17014015195002)","IsDeferred":false}]}