diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..addd9cd6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.vscode + +build +reflexxes + +local.sh \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..e3728f70 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,68 @@ +cmake_minimum_required(VERSION 3.11) + + +project(ruckig VERSION 0.1.0 LANGUAGES CXX) +list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake) + + +option(BUILD_PYTHON_MODULE "Build python module" ON) +option(BUILD_TESTS "Build tests" ON) + + +find_package(Eigen3 3.3.7 REQUIRED NO_MODULE) +find_package(Reflexxes) + +message("Found Eigen Version: ${Eigen3_VERSION}") + +if(Reflexxes) + set(REFLEXXES_TYPE "ReflexxesTypeII" CACHE STRING "Type of Reflexxes library") # or ReflexxesTypeIV + + message("Found Reflexxes ${REFLEXXES_TYPE}") +else() + message("Did not found Reflexxes.") +endif() + + +add_library(ruckig SHARED + src/ruckig.cpp +) +target_compile_features(ruckig PUBLIC cxx_std_17) +target_include_directories(ruckig PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) +target_link_libraries(ruckig PUBLIC Eigen3::Eigen) + + +if(Reflexxes) + target_compile_definitions(ruckig PUBLIC WITH_REFLEXXES) + target_link_libraries(ruckig PUBLIC Reflexxes::Reflexxes) +endif() + + +if(BUILD_PYTHON_MODULE) + # Check if pybind11 exists as a subdirectory + if(EXISTS pybind11) + add_subdirectory(pybind11) + else() + find_package(Python COMPONENTS Interpreter Development) + find_package(pybind11 2.6 REQUIRED) + endif() + + pybind11_add_module(_ruckig src/python.cpp) + target_compile_features(_ruckig PUBLIC cxx_std_17) + target_link_libraries(_ruckig PUBLIC ruckig) +endif() + + +if(BUILD_TESTS) + enable_testing() + + find_package(Catch2 REQUIRED) + + foreach(test IN ITEMS otg-test) + add_executable(${test} "test/${test}.cpp") + if(Reflexxes) + target_compile_definitions(${test} PUBLIC WITH_REFLEXXES) + endif() + target_link_libraries(${test} PRIVATE ruckig Catch2::Catch2) + add_test(NAME ${test} COMMAND ${test}) + endforeach() +endif() diff --git a/README.md b/README.md new file mode 100644 index 00000000..ec20ee0f --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Ruckig + +Online Trajectory Generation. Real-time. Jerk-constrained. \ No newline at end of file diff --git a/cmake/FindReflexxes.cmake b/cmake/FindReflexxes.cmake new file mode 100644 index 00000000..8e7fd07e --- /dev/null +++ b/cmake/FindReflexxes.cmake @@ -0,0 +1,12 @@ +if(NOT TARGET Reflexxes::Reflexxes) + if(NOT ${Reflexxes_ROOT_DIR} STREQUAL "") + set(Reflexxes_LIB_DIR "${Reflexxes_ROOT_DIR}/MacOS/x64/release/lib/") + set(Reflexxes_INCLUDE_DIR "${Reflexxes_ROOT_DIR}/include") + endif() + + find_library(Reflexxes ${REFLEXXES_TYPE} PATHS ${Reflexxes_LIB_DIR}) + + add_library(Reflexxes::Reflexxes INTERFACE IMPORTED) + target_include_directories(Reflexxes::Reflexxes INTERFACE ${Reflexxes_INCLUDE_DIR}) + target_link_libraries(Reflexxes::Reflexxes INTERFACE ${Reflexxes}) +endif() diff --git a/include/ruckig/parameter.hpp b/include/ruckig/parameter.hpp new file mode 100644 index 00000000..90660a5d --- /dev/null +++ b/include/ruckig/parameter.hpp @@ -0,0 +1,112 @@ +#pragma once + +#include + +#include + + +namespace ruckig { + +enum class Result { + Working, + Finished, + Error +}; + + +template +struct InputParameter { + using Vector = Eigen::Matrix; + static constexpr size_t degrees_of_freedom {DOFs}; + + enum class Type { + Position, + Velocity, + } type {Type::Position}; + + Vector current_position; + Vector current_velocity {Vector::Zero()}; + Vector current_acceleration {Vector::Zero()}; + + Vector target_position; + Vector target_velocity {Vector::Zero()}; + Vector target_acceleration {Vector::Zero()}; + + Vector max_velocity; + Vector max_acceleration; + Vector max_jerk; + + std::array enabled; + std::optional minimum_duration; + + InputParameter() { + enabled.fill(true); + } + + bool operator!=(const InputParameter& rhs) const { + return ( + current_position != rhs.current_position + || current_velocity != rhs.current_velocity + || current_acceleration != rhs.current_acceleration + || target_position != rhs.target_position + || target_velocity != rhs.target_velocity + || target_acceleration != rhs.target_acceleration + || max_velocity != rhs.max_velocity + || max_acceleration != rhs.max_acceleration + || max_jerk != rhs.max_jerk + || enabled != rhs.enabled + || minimum_duration != rhs.minimum_duration + || type != rhs.type + ); + } + + std::string to_string(size_t dof) const { + std::stringstream ss; + ss << "p0: " << current_position[dof] << ", "; + ss << "v0: " << current_velocity[dof] << ", "; + ss << "a0: " << current_acceleration[dof] << ", "; + ss << "pf: " << target_position[dof] << ", "; + ss << "vf: " << target_velocity[dof] << ", "; + ss << "vMax: " << max_velocity[dof] << ", "; + ss << "aMax: " << max_acceleration[dof] << ", "; + ss << "jMax: " << max_jerk[dof]; + return ss.str(); + } + + std::string to_string() const { + Eigen::IOFormat formatter(10, 0, ", ", "\n", "[", "]"); + + std::stringstream ss; + ss << "\ninp.current_position = " << current_position.transpose().format(formatter) << "\n"; + ss << "inp.current_velocity = " << current_velocity.transpose().format(formatter) << "\n"; + ss << "inp.current_acceleration = " << current_acceleration.transpose().format(formatter) << "\n"; + ss << "inp.target_position = " << target_position.transpose().format(formatter) << "\n"; + ss << "inp.target_velocity = " << target_velocity.transpose().format(formatter) << "\n"; + ss << "inp.target_acceleration = " << target_acceleration.transpose().format(formatter) << "\n"; + ss << "inp.max_velocity = " << max_velocity.transpose().format(formatter) << "\n"; + ss << "inp.max_acceleration = " << max_acceleration.transpose().format(formatter) << "\n"; + ss << "inp.max_jerk = " << max_jerk.transpose().format(formatter) << "\n"; + return ss.str(); + } +}; + + +template +struct OutputParameter { + using Vector = Eigen::Matrix; + static constexpr size_t degrees_of_freedom {DOFs}; + + Vector new_position; + Vector new_velocity; + Vector new_acceleration; + + double duration; // [s] + bool new_calculation {false}; + double calculation_duration; // [µs] + + // Vector independent_min_durations; + // Vector min_positions, max_positions; + // Vector time_min_positions, time_max_positions; +}; + +} // namespace ruckig diff --git a/include/ruckig/quintic.hpp b/include/ruckig/quintic.hpp new file mode 100644 index 00000000..670c0a7d --- /dev/null +++ b/include/ruckig/quintic.hpp @@ -0,0 +1,91 @@ +#pragma once + +#include + +#include + + +namespace ruckig { + +template +class Quintic { + using Vector = Eigen::Matrix; + + // Trajectory + Vector a, b, c, d, e, f; + double t, tf; + InputParameter current_input; + + bool calculate(const InputParameter& input, OutputParameter& output) { + current_input = input; + + const Vector& x0 = input.current_position; + const Vector& v0 = input.current_velocity; + const Vector& a0 = input.current_acceleration; + const Vector& xf = input.target_position; + const Vector& vf = input.target_velocity; + const Vector& af = input.target_acceleration; + const Vector& v_max = input.max_velocity; + const Vector& a_max = input.max_acceleration; + const Vector& j_max = input.max_jerk; + + // Check input + if ((v_max.array() <= 0.0).any() || (a_max.array() <= 0.0).any() || (j_max.array() <= 0.0).any()) { + return false; + } + + // Approximations for v0 == 0, vf == 0, a0 == 0, af == 0 + Vector v_max_tfs = (15 * (x0 - xf).array().abs()) / (8 * v_max).array(); + Vector a_max_tfs = (std::sqrt(10) * (x0.array().pow(2) - 2 * x0.array() * xf.array() + xf.array().pow(2)).pow(1./4)) / (std::pow(3, 1./4) * a_max.array().sqrt()); + Vector j_max_tfs = ((60 * (x0 - xf).array().abs()) / j_max.array()).pow(1./3); // Also solvable for v0 != 0 + + tf = std::max({v_max_tfs.maxCoeff(), a_max_tfs.maxCoeff(), j_max_tfs.maxCoeff()}); + if (input.minimum_duration.has_value()) { + tf = std::max({tf, input.minimum_duration.value()}); + } + + a = -((a0 - af) * std::pow(tf, 2) + 6 * tf * (v0 + vf) + 12 * (x0 - xf)) / (2 * std::pow(tf, 5)); + b = -((2 * af - 3 * a0) * std::pow(tf, 2) - 16 * tf * v0 - 14 * tf * vf - 30 * (x0 - xf)) / (2 * std::pow(tf, 4)); + c = -((3 * a0 - af) * std::pow(tf, 2) + 12 * tf * v0 + 8 * tf * vf + 20 * (x0 - xf)) / (2 * std::pow(tf, 3)); + d = a0 / 2; + e = v0; + f = x0; + + t = 0.0; + output.duration = tf; + output.new_calculation = true; + return true; + } + +public: + double delta_time; + + explicit Quintic(double delta_time): delta_time(delta_time) { } + + Result update(const InputParameter& input, OutputParameter& output) { + t += delta_time; + output.new_calculation = false; + + if (input != current_input && !calculate(input, output)) { + return Result::Error; + } + + if (t >= tf) { + output.new_position = input.target_position; + output.new_velocity = input.target_velocity; + output.new_acceleration = input.target_acceleration; + return Result::Finished; + } + + output.new_position = f + t * (e + t * (d + t * (c + t * (b + a * t)))); + output.new_velocity = e + t * (2 * d + t * (3 * c + t * (4 * b + 5 * a * t))); + output.new_acceleration = 2 * d + t * (6 * c + t * (12 * b + t * (20 * a))); + + current_input.current_position = output.new_position; + current_input.current_velocity = output.new_velocity; + current_input.current_acceleration = output.new_acceleration; + return Result::Working; + } +}; + +} // namespace ruckig diff --git a/include/ruckig/reflexxes.hpp b/include/ruckig/reflexxes.hpp new file mode 100644 index 00000000..9f5cb37a --- /dev/null +++ b/include/ruckig/reflexxes.hpp @@ -0,0 +1,146 @@ +#pragma once + +#include + +#include + +#include +#include +#include +#include + +#include + + +namespace ruckig { + +template +class Reflexxes { + InputParameter current_input; + std::shared_ptr rml; + std::shared_ptr input_parameters; + std::shared_ptr output_parameters; + std::shared_ptr input_vel_parameters; + std::shared_ptr output_vel_parameters; + + int result_value {0}; + RMLPositionFlags flags; + RMLVelocityFlags vel_flags; + +public: + double delta_time; + + explicit Reflexxes(double delta_time): delta_time(delta_time) { + rml = std::make_shared(DOFs, delta_time); + input_parameters = std::make_shared(DOFs); + output_parameters = std::make_shared(DOFs); + input_vel_parameters = std::make_shared(DOFs); + output_vel_parameters = std::make_shared(DOFs); + + flags.SynchronizationBehavior = RMLPositionFlags::PHASE_SYNCHRONIZATION_IF_POSSIBLE; + vel_flags.SynchronizationBehavior = RMLVelocityFlags::PHASE_SYNCHRONIZATION_IF_POSSIBLE; + } + + Result update(const InputParameter& input, OutputParameter& output) { + auto start = std::chrono::high_resolution_clock::now(); + + if (input != current_input) { + current_input = input; + + if ((input.target_acceleration.array() != 0.0).any()) { + return Result::Error; + } + + switch (input.type) { + case InputParameter::Type::Position: { + if (input.minimum_duration.has_value()) { + input_parameters->SetMinimumSynchronizationTime(input.minimum_duration.value()); + } + + input_parameters->SetSelectionVector(input.enabled.data()); + input_parameters->SetCurrentPositionVector(input.current_position.data()); + input_parameters->SetCurrentVelocityVector(input.current_velocity.data()); + input_parameters->SetCurrentAccelerationVector(input.current_acceleration.data()); + input_parameters->SetTargetPositionVector(input.target_position.data()); + input_parameters->SetTargetVelocityVector(input.target_velocity.data()); + input_parameters->SetMaxVelocityVector(input.max_velocity.data()); + input_parameters->SetMaxAccelerationVector(input.max_acceleration.data()); + input_parameters->SetMaxJerkVector(input.max_jerk.data()); + } break; + case InputParameter::Type::Velocity: { + if (input.minimum_duration.has_value()) { + input_vel_parameters->SetMinimumSynchronizationTime(input.minimum_duration.value()); + } + + input_vel_parameters->SetSelectionVector(input.enabled.data()); + input_vel_parameters->SetCurrentPositionVector(input.current_position.data()); + input_vel_parameters->SetCurrentVelocityVector(input.current_velocity.data()); + input_vel_parameters->SetCurrentAccelerationVector(input.current_acceleration.data()); + input_vel_parameters->SetTargetVelocityVector(input.target_velocity.data()); + input_vel_parameters->SetMaxAccelerationVector(input.max_acceleration.data()); + input_vel_parameters->SetMaxJerkVector(input.max_jerk.data()); + } break; + } + } + + switch (input.type) { + case InputParameter::Type::Position: { + result_value = rml->RMLPosition(*input_parameters, output_parameters.get(), flags); + + for (size_t i = 0; i < DOFs; i += 1) { + output.new_position(i) = output_parameters->NewPositionVector->VecData[i]; + output.new_velocity(i) = output_parameters->NewVelocityVector->VecData[i]; + output.new_acceleration(i) = output_parameters->NewAccelerationVector->VecData[i]; + } + output.duration = output_parameters->GetSynchronizationTime(); + output.new_calculation = output_parameters->WasACompleteComputationPerformedDuringTheLastCycle(); + } break; + case InputParameter::Type::Velocity: { + result_value = rml->RMLVelocity(*input_vel_parameters, output_vel_parameters.get(), vel_flags); + + for (size_t i = 0; i < DOFs; i += 1) { + output.new_position(i) = output_vel_parameters->NewPositionVector->VecData[i]; + output.new_velocity(i) = output_vel_parameters->NewVelocityVector->VecData[i]; + output.new_acceleration(i) = output_vel_parameters->NewAccelerationVector->VecData[i]; + } + output.duration = output_vel_parameters->GetSynchronizationTime(); + output.new_calculation = output_vel_parameters->WasACompleteComputationPerformedDuringTheLastCycle(); + } break; + } + + auto stop = std::chrono::high_resolution_clock::now(); + output.calculation_duration = std::chrono::duration_cast(stop - start).count() / 1000.0; + + if (result_value == ReflexxesAPI::RML_FINAL_STATE_REACHED) { + return Result::Finished; + } else if (result_value < 0) { + return Result::Error; + } + return Result::Working; + } + + void atTime(double time, OutputParameter& output) { + switch (current_input.type) { + case InputParameter::Type::Position: { + rml->RMLPositionAtAGivenSampleTime(time, output_parameters.get()); + + for (size_t i = 0; i < DOFs; i += 1) { + output.new_position(i) = output_parameters->NewPositionVector->VecData[i]; + output.new_velocity(i) = output_parameters->NewVelocityVector->VecData[i]; + output.new_acceleration(i) = output_parameters->NewAccelerationVector->VecData[i]; + } + } break; + case InputParameter::Type::Velocity: { + rml->RMLVelocityAtAGivenSampleTime(time, output_vel_parameters.get()); + + for (size_t i = 0; i < DOFs; i += 1) { + output.new_position(i) = output_vel_parameters->NewPositionVector->VecData[i]; + output.new_velocity(i) = output_vel_parameters->NewVelocityVector->VecData[i]; + output.new_acceleration(i) = output_vel_parameters->NewAccelerationVector->VecData[i]; + } + } break; + } + } +}; + +} // namespace ruckig diff --git a/include/ruckig/roots.hpp b/include/ruckig/roots.hpp new file mode 100644 index 00000000..789164fa --- /dev/null +++ b/include/ruckig/roots.hpp @@ -0,0 +1,344 @@ +#pragma once + +#define _USE_MATH_DEFINES +#include +#include +#include + + +namespace Roots { + +inline double polyEval(double *p, int len, double x) { + double retVal = 0.0; + + if (len > 0) { + if (fabs(x) < DBL_EPSILON) { + retVal = p[len - 1]; + } else if (x == 1.0) { + for (int i = len - 1; i >= 0; i--) { + retVal += p[i]; + } + } else { + double xn = 1.0; + + for (int i = len - 1; i >= 0; i--) { + retVal += p[i] * xn; + xn *= x; + } + } + } + + return retVal; +} + +// Calculate all roots of a*x^3 + b*x^2 + c*x + d = 0 +inline std::set solveCub(double a, double b, double c, double d) { + std::set roots; + + constexpr double cos120 = -0.50; + constexpr double sin120 = 0.866025403784438646764; + + if (fabs(d) < DBL_EPSILON) { + // First solution is x = 0 + roots.insert(0.0); + + // Converting to a quadratic equation + d = c; + c = b; + b = a; + a = 0.0; + } + + if (fabs(a) < DBL_EPSILON) { + if (fabs(b) < DBL_EPSILON) { + // Linear equation + if (fabs(c) > DBL_EPSILON) { + roots.insert(-d / c); + } + + } else { + // Quadratic equation + double discriminant = c * c - 4.0 * b * d; + if (discriminant >= 0) { + double inv2b = 1.0 / (2.0 * b); + double y = sqrt(discriminant); + roots.insert((-c + y) * inv2b); + roots.insert((-c - y) * inv2b); + } + } + + } else { + // Cubic equation + double inva = 1.0 / a; + double invaa = inva * inva; + double bb = b * b; + double bover3a = b * (1.0 / 3.0) * inva; + double p = (3.0 * a * c - bb) * (1.0 / 3.0) * invaa; + double halfq = (2.0 * bb * b - 9.0 * a * b * c + 27.0 * a * a * d) * (0.5 / 27.0) * invaa * inva; + double yy = p * p * p / 27.0 + halfq * halfq; + + if (yy > DBL_EPSILON) { + // Sqrt is positive: one real solution + double y = sqrt(yy); + double uuu = -halfq + y; + double vvv = -halfq - y; + double www = fabs(uuu) > fabs(vvv) ? uuu : vvv; + double w = (www < 0) ? -pow(fabs(www), 1.0 / 3.0) : pow(www, 1.0 / 3.0); + roots.insert(w - p / (3.0 * w) - bover3a); + } else if (yy < -DBL_EPSILON) { + // Sqrt is negative: three real solutions + double x = -halfq; + double y = sqrt(-yy); + double theta; + double r; + double ux; + double uyi; + // Convert to polar form + if (fabs(x) > DBL_EPSILON) { + theta = (x > 0.0) ? atan(y / x) : (atan(y / x) + M_PI); + r = sqrt(x * x - yy); + } else { + // Vertical line + theta = M_PI / 2.0; + r = y; + } + // Calculate cube root + theta /= 3.0; + r = pow(r, 1.0 / 3.0); + // Convert to complex coordinate + ux = cos(theta) * r; + uyi = sin(theta) * r; + // First solution + roots.insert(ux + ux - bover3a); + // Second solution, rotate +120 degrees + roots.insert(2.0 * (ux * cos120 - uyi * sin120) - bover3a); + // Third solution, rotate -120 degrees + roots.insert(2.0 * (ux * cos120 + uyi * sin120) - bover3a); + } else { + // Sqrt is zero: two real solutions + double www = -halfq; + double w = (www < 0.0) ? -pow(fabs(www), 1.0 / 3.0) : pow(www, 1.0 / 3.0); + // First solution + roots.insert(w + w - bover3a); + // Second solution, rotate +120 degrees + roots.insert(2.0 * w * cos120 - bover3a); + } + } + return roots; +} + +// Solve resolvent eqaution of corresponding Quartic equation +// The input x must be of length 3 +// Number of zeros are returned +inline int solveResolvent(double *x, double a, double b, double c) { + double a2 = a * a; + double q = (a2 - 3.0 * b) / 9.0; + double r = (a * (2.0 * a2 - 9.0 * b) + 27.0 * c) / 54.0; + double r2 = r * r; + double q3 = q * q * q; + double A, B; + if (r2 < q3) { + double t = r / sqrt(q3); + if (t < -1.0) { + t = -1.0; + } + if (t > 1.0) { + t = 1.0; + } + t = acos(t); + a /= 3.0; + q = -2.0 * sqrt(q); + x[0] = q * cos(t / 3.0) - a; + x[1] = q * cos((t + M_PI * 2.0) / 3.0) - a; + x[2] = q * cos((t - M_PI * 2.0) / 3.0) - a; + return 3; + } else { + A = -pow(fabs(r) + sqrt(r2 - q3), 1.0 / 3.0); + if (r < 0.0) { + A = -A; + } + B = (0.0 == A ? 0.0 : q / A); + + a /= 3.0; + x[0] = (A + B) - a; + x[1] = -0.5 * (A + B) - a; + x[2] = 0.5 * sqrt(3.0) * (A - B); + if (fabs(x[2]) < DBL_EPSILON) { + x[2] = x[1]; + return 2; + } + + return 1; + } +} + +// Calculate all roots of the monic quartic equation: +// x^4 + a*x^3 + b*x^2 + c*x +d = 0 +inline std::set solveQuartMonic(double a, double b, double c, double d) { + std::set roots; + + double a3 = -b; + double b3 = a * c - 4.0 * d; + double c3 = -a * a * d - c * c + 4.0 * b * d; + + // Solve the resolvent: y^3 - b*y^2 + (ac - 4*d)*y - a^2*d - c^2 + 4*b*d = 0 + double x3[3]; + int iZeroes = solveResolvent(x3, a3, b3, c3); + + double q1, q2, p1, p2, D, sqrtD, y; + + y = x3[0]; + // Choosing Y with maximal absolute value. + if (iZeroes != 1) { + if (fabs(x3[1]) > fabs(y)) { + y = x3[1]; + } + if (fabs(x3[2]) > fabs(y)) { + y = x3[2]; + } + } + + // h1 + h2 = y && h1*h2 = d <=> h^2 - y*h + d = 0 (h === q) + + D = y * y - 4.0 * d; + if (fabs(D) < DBL_EPSILON) { //In other words: D == 0 + q1 = q2 = y * 0.5; + // g1 + g2 = a && g1 + g2 = b - y <=> g^2 - a*g + b - y = 0 (p === g) + D = a * a - 4.0 * (b - y); + if (fabs(D) < DBL_EPSILON) { //In other words: D == 0 + p1 = p2 = a * 0.5; + } else { + sqrtD = sqrt(D); + p1 = (a + sqrtD) * 0.5; + p2 = (a - sqrtD) * 0.5; + } + } else { + sqrtD = sqrt(D); + q1 = (y + sqrtD) * 0.5; + q2 = (y - sqrtD) * 0.5; + // g1 + g2 = a && g1*h2 + g2*h1 = c ( && g === p ) Krammer + p1 = (a * q1 - c) / (q1 - q2); + p2 = (c - a * q2) / (q1 - q2); + } + + // Solve the quadratic equation: x^2 + p1*x + q1 = 0 + D = p1 * p1 - 4.0 * q1; + if (fabs(D) < DBL_EPSILON) { + roots.insert(-p1 * 0.5); + } else if (D > 0.0) { + sqrtD = sqrt(D); + roots.insert((-p1 + sqrtD) * 0.5); + roots.insert((-p1 - sqrtD) * 0.5); + } + + // Solve the quadratic equation: x^2 + p2*x + q2 = 0 + D = p2 * p2 - 4.0 * q2; + if (fabs(D) < DBL_EPSILON) { + roots.insert(-p2 * 0.5); + } else if (D > 0.0) { + sqrtD = sqrt(D); + roots.insert((-p2 + sqrtD) * 0.5); + roots.insert((-p2 - sqrtD) * 0.5); + } + + return roots; +} + +// Calculate the quartic equation: a*x^4 + b*x^3 + c*x^2 + d*x + e = 0 +// All coefficients can be zero +inline std::set solveQuart(double a, double b, double c, double d, double e) { + if (fabs(a) < DBL_EPSILON) { + return solveCub(b, c, d, e); + } + return solveQuartMonic(b / a, c / a, d / a, e / a); +} + +inline std::set solveQuart(const std::array& polynom) { + return solveQuart(polynom[0], polynom[1], polynom[2], polynom[3], polynom[4]); +} + +// Calculate the derivative poly coefficients of a given poly +inline void polyDeri(double *coeffs, double *dcoeffs, int len) { + int horder = len - 1; + for (int i = 0; i < horder; i++) { + dcoeffs[i] = (horder - i) * coeffs[i]; + } + return; +} + +// Safe Newton Method +// Requirements: f(l)*f(h)<=0 +template +inline double safeNewton(const F &func, const DF &dfunc, const double &l, const double &h, const double &tol, const int &maxIts) { + double xh, xl; + double fl = func(l); + double fh = func(h); + if (fl == 0.0) { + return l; + } + if (fh == 0.0) { + return h; + } + if (fl < 0.0) { + xl = l; + xh = h; + } else { + xh = l; + xl = h; + } + + double rts = 0.5 * (xl + xh); + double dxold = fabs(xh - xl); + double dx = dxold; + double f = func(rts); + double df = dfunc(rts); + double temp; + for (int j = 0; j < maxIts; j++) { + if ((((rts - xh) * df - f) * ((rts - xl) * df - f) > 0.0) || + (fabs(2.0 * f) > fabs(dxold * df))) { + dxold = dx; + dx = 0.5 * (xh - xl); + rts = xl + dx; + if (xl == rts) { + break; + } + } else { + dxold = dx; + dx = f / df; + temp = rts; + rts -= dx; + if (temp == rts) { + break; + } + } + + if (fabs(dx) < tol) { + break; + } + + f = func(rts); + df = dfunc(rts); + if (f < 0.0) { + xl = rts; + } else { + xh = rts; + } + } + + return rts; +} + +// Calculate a single zero of poly coeffs(x) inside [lbound, ubound] +// Requirements: coeffs(lbound)*coeffs(ubound) < 0, lbound < ubound +inline double shrinkInterval(double *coeffs, int numCoeffs, double lbound, double ubound, double tol) { + double *dcoeffs = new double[numCoeffs - 1]; + polyDeri(coeffs, dcoeffs, numCoeffs); + auto func = [&coeffs, &numCoeffs](double x) { return polyEval(coeffs, numCoeffs, x); }; + auto dfunc = [&dcoeffs, &numCoeffs](double x) { return polyEval(dcoeffs, numCoeffs - 1, x); }; + constexpr int maxDblIts = 128; + double rts = safeNewton(func, dfunc, lbound, ubound, tol, maxDblIts); + delete[] dcoeffs; + return rts; +} + +} // namespace Roots diff --git a/include/ruckig/ruckig.hpp b/include/ruckig/ruckig.hpp new file mode 100644 index 00000000..c2b6497f --- /dev/null +++ b/include/ruckig/ruckig.hpp @@ -0,0 +1,275 @@ +#pragma once + +#include +#include +#include +#include + +#include + + +namespace ruckig { + +struct Profile { + //! Profile names indicate which limits are reached. + enum class Type { + UP_ACC0_ACC1_VEL, UP_VEL, UP_ACC0, UP_ACC1, UP_ACC0_ACC1, UP_ACC0_VEL, UP_ACC1_VEL, UP_NONE, + DOWN_ACC0_ACC1_VEL, DOWN_VEL, DOWN_ACC0, DOWN_ACC1, DOWN_ACC0_ACC1, DOWN_ACC0_VEL, DOWN_ACC1_VEL, DOWN_NONE + }; + + Type type; + std::array t, t_sum, j; + std::array a, v, p; + + //! Total time of the braking segments + std::optional t_brake; + + //! Allow up to two segments of braking before the "correct" profile starts + std::array t_brakes, j_brakes, a_brakes, v_brakes, p_brakes; + + void set(double p0, double v0, double a0, const std::array& j); + bool check(double pf, double vf, double vMax, double aMax) const; + + //! Integrate with constant jerk for duration t. Returns new position, new velocity, and new acceleration. + static std::tuple integrate(double t, double p0, double v0, double a0, double j); +}; + + +struct RuckigStep1 { + static bool time_up_acc0_acc1_vel(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_up_acc1_vel(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_up_acc0_vel(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_up_vel(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_up_acc0_acc1(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_up_acc1(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_up_acc0(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_up_none(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + + static bool time_down_acc0_acc1_vel(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_down_acc1_vel(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_down_acc0_vel(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_down_vel(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_down_acc0_acc1(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_down_acc1(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_down_acc0(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_down_none(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + + static bool get_profile(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + + static void get_brake_trajectory(double v0, double a0, double vMax, double aMax, double jMax, std::array& t_brake, std::array& j_brake); +}; + + +struct RuckigStep2 { + static bool time_up_acc0_acc1_vel(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_up_acc1_vel(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_up_acc0_vel(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_up_vel(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_up_acc0_acc1(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_up_acc1(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_up_acc0(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_up_none(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + + static bool time_down_acc0_acc1_vel(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_down_acc1_vel(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_down_acc0_vel(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_down_vel(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_down_acc0_acc1(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_down_acc1(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_down_acc0(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + static bool time_down_none(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); + + static bool get_profile(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax); +}; + + +template +class Ruckig { + InputParameter current_input; + + double t, tf; + std::array profiles; + + bool calculate(const InputParameter& input, OutputParameter& output) { + current_input = input; + + // Check input + if ((input.max_velocity.array() <= 0.0).any() || (input.max_acceleration.array() <= 0.0).any() || (input.max_jerk.array() <= 0.0).any()) { + return false; + } + + if (DOFs > 1 && (input.target_velocity.array() != 0.0).any()) { + std::cerr << "Ruckig does not support a target velocity for multiple DoFs." << std::endl; + return false; + } + + if ((input.target_velocity.array().abs() > input.max_velocity.array()).any()) { + std::cerr << "Target velocity exceeds maximal velocity." << std::endl; + return false; + } + + if ((input.target_acceleration.array() != 0.0).any()) { + std::cerr << "Ruckig does not support a target acceleration." << std::endl; + return false; + } + + if (input.minimum_duration.has_value()) { + std::cerr << "Ruckig does not support a minimum duration." << std::endl; + return false; + } + + // Calculate brakes (if input exceeds or will exceed limits) + for (size_t dof = 0; dof < DOFs; dof += 1) { + if (!input.enabled[dof]) { + continue; + } + + RuckigStep1::get_brake_trajectory(input.current_velocity[dof], input.current_acceleration[dof], input.max_velocity[dof], input.max_acceleration[dof], input.max_jerk[dof], profiles[dof].t_brakes, profiles[dof].j_brakes); + profiles[dof].t_brake = profiles[dof].t_brakes[0] + profiles[dof].t_brakes[1]; + + // std::cout << dof << ": " << t_brakes_[dof][0] << " " << t_brakes_[dof][1] << std::endl; + } + + std::array tfs; // Profile duration + std::array p0s, v0s, a0s; // Starting point of profiles without brake trajectory + for (size_t dof = 0; dof < DOFs; dof += 1) { + if (!input.enabled[dof]) { + tfs[dof] = 0.0; + continue; + } + + p0s[dof] = input.current_position[dof]; + v0s[dof] = input.current_velocity[dof]; + a0s[dof] = input.current_acceleration[dof]; + + if (profiles[dof].t_brakes[0] > 0.0) { + profiles[dof].p_brakes[0] = p0s[dof]; + profiles[dof].v_brakes[0] = v0s[dof]; + profiles[dof].a_brakes[0] = a0s[dof]; + std::tie(p0s[dof], v0s[dof], a0s[dof]) = Profile::integrate(profiles[dof].t_brakes[0], p0s[dof], v0s[dof], a0s[dof], profiles[dof].j_brakes[0]); + + if (profiles[dof].t_brakes[1] > 0.0) { + profiles[dof].p_brakes[1] = p0s[dof]; + profiles[dof].v_brakes[1] = v0s[dof]; + profiles[dof].a_brakes[1] = a0s[dof]; + std::tie(p0s[dof], v0s[dof], a0s[dof]) = Profile::integrate(profiles[dof].t_brakes[1], p0s[dof], v0s[dof], a0s[dof], profiles[dof].j_brakes[1]); + } + } + + bool found_profile = RuckigStep1::get_profile(profiles[dof], p0s[dof], v0s[dof], a0s[dof], input.target_position[dof], input.target_velocity[dof], input.max_velocity[dof], input.max_acceleration[dof], input.max_jerk[dof]); + if (!found_profile) { + throw std::runtime_error("[ruckig] error in step 1: " + input.to_string(dof) + " all: " + input.to_string()); + } + tfs[dof] = profiles[dof].t_sum[6] + profiles[dof].t_brake.value_or(0.0); + } + + auto tf_max_pointer = std::max_element(tfs.begin(), tfs.end()); + size_t limiting_dof = std::distance(tfs.begin(), tf_max_pointer); + tf = *tf_max_pointer; + + if (tf > 0.0) { + for (size_t dof = 0; dof < DOFs; dof += 1) { + if (!input.enabled[dof] || dof == limiting_dof) { + continue; + } + + double t_profile = tf - profiles[dof].t_brake.value_or(0.0); + + bool found_time_synchronization = RuckigStep2::get_profile(profiles[dof], t_profile, p0s[dof], v0s[dof], a0s[dof], input.target_position[dof], input.target_velocity[dof], input.max_velocity[dof], input.max_acceleration[dof], input.max_jerk[dof]); + if (!found_time_synchronization) { + throw std::runtime_error("[ruckig] error in step 2: " + input.to_string(dof) + " all: " + input.to_string()); + } + } + } + + t = 0.0; + output.duration = tf; + output.new_calculation = true; + return true; + } + +public: + //! Time step between updates (cycle time) in [s] + const double delta_time; + + explicit Ruckig(double delta_time): delta_time(delta_time) { } + + Result update(const InputParameter& input, OutputParameter& output) { + t += delta_time; + output.new_calculation = false; + + auto start = std::chrono::high_resolution_clock::now(); + + if (input != current_input && !calculate(input, output)) { + return Result::Error; + } + + atTime(t, output); + + auto stop = std::chrono::high_resolution_clock::now(); + output.calculation_duration = std::chrono::duration_cast(stop - start).count() / 1000.0; + + if (t + delta_time > tf) { + return Result::Finished; + } + + current_input.current_position = output.new_position; + current_input.current_velocity = output.new_velocity; + current_input.current_acceleration = output.new_acceleration; + return Result::Working; + } + + void atTime(double time, OutputParameter& output) { + if (time + delta_time > tf) { + // Keep velocity + output.new_position = current_input.target_position + current_input.target_velocity * (time - tf); + output.new_velocity = current_input.target_velocity; + output.new_acceleration = current_input.target_acceleration; + return; + } + + for (size_t dof = 0; dof < DOFs; dof += 1) { + if (!current_input.enabled[dof]) { + output.new_acceleration[dof] = current_input.current_acceleration[dof]; + output.new_velocity[dof] = current_input.current_velocity[dof]; + output.new_position[dof] = current_input.current_position[dof]; + } + + auto& p = profiles[dof]; + + double t_diff = time; + if (p.t_brake.has_value()) { + if (t_diff < p.t_brake.value()) { + size_t index = (t_diff < p.t_brakes[0]) ? 0 : 1; + if (index > 0) { + t_diff -= p.t_brakes[index - 1]; + } + + std::tie(output.new_position[dof], output.new_velocity[dof], output.new_acceleration[dof]) = Profile::integrate(t_diff, p.p_brakes[index], p.v_brakes[index], p.a_brakes[index], p.j_brakes[index]); + continue; + } else { + t_diff -= p.t_brake.value(); + } + } + + // Non-time synchronization + if (t_diff >= p.t_sum[6]) { + output.new_position[dof] = p.p[7]; + output.new_velocity[dof] = p.v[7]; + output.new_acceleration[dof] = p.a[7]; + continue; + } + + auto index_ptr = std::upper_bound(p.t_sum.begin(), p.t_sum.end(), t_diff); + size_t index = std::distance(p.t_sum.begin(), index_ptr); + + if (index > 0) { + t_diff -= p.t_sum[index - 1]; + } + + std::tie(output.new_position[dof], output.new_velocity[dof], output.new_acceleration[dof]) = Profile::integrate(t_diff, p.p[index], p.v[index], p.a[index], p.j[index]); + } + } +}; + +} // namespace ruckig diff --git a/include/ruckig/smoothie.hpp b/include/ruckig/smoothie.hpp new file mode 100644 index 00000000..470f6afe --- /dev/null +++ b/include/ruckig/smoothie.hpp @@ -0,0 +1,147 @@ +# pragma once + +#include + +#include + + +namespace ruckig { + +/** + * Adapted from: Wisama Khalil and Etienne Dombre. 2002. Modeling, Identification and Control of Robots (Kogan Page Science Paper edition). + */ +template +class Smoothie { + using Vector = Eigen::Matrix; + + static constexpr double q_delta_motion_finished {1e-6}; + + InputParameter current_input; + double time; + + Vector q_initial, q_delta; + Vector dq_max_sync_, q_1_; + Vector t_1_sync, t_2_sync, t_f_sync; + Vector dq_max_, ddq_max_initial, ddq_max_target; + + void calculateSynchronizedValues() { + Vector dq_max_reach(dq_max_); + Vector t_f = Vector::Zero(); + Vector delta_t_2 = Vector::Zero(); + Vector t_1 = Vector::Zero(); + Vector delta_t_2_sync = Vector::Zero(); + Vector sign_delta_q = q_delta.cwiseSign(); + + time = 0.0; + + for (size_t i = 0; i < DOFs; i++) { + if (std::abs(q_delta[i]) > q_delta_motion_finished) { + if (std::abs(q_delta[i]) < (3.0 / 4.0 * (std::pow(dq_max_[i], 2.0) / ddq_max_initial[i]) + 3.0 / 4.0 * (std::pow(dq_max_[i], 2.0) / ddq_max_target[i]))) { + dq_max_reach[i] = std::sqrt(4.0 / 3.0 * q_delta[i] * sign_delta_q[i] * (ddq_max_initial[i] * ddq_max_target[i]) / (ddq_max_initial[i] + ddq_max_target[i])); + } + t_1[i] = 1.5 * dq_max_reach[i] / ddq_max_initial[i]; + delta_t_2[i] = 1.5 * dq_max_reach[i] / ddq_max_target[i]; + t_f[i] = t_1[i] / 2.0 + delta_t_2[i] / 2.0 + std::abs(q_delta[i]) / dq_max_reach[i]; + } + } + + double max_t_f = t_f.maxCoeff(); + for (size_t i = 0; i < DOFs; i++) { + if (std::abs(q_delta[i]) > q_delta_motion_finished) { + double a = 1.5 / 2.0 * (ddq_max_target[i] + ddq_max_initial[i]); + double b = -1.0 * max_t_f * ddq_max_target[i] * ddq_max_initial[i]; + double c = std::abs(q_delta[i]) * ddq_max_target[i] * ddq_max_initial[i]; + double delta = b * b - 4.0 * a * c; + if (delta < 0.0) { + delta = 0.0; + } + dq_max_sync_[i] = (-1.0 * b - std::sqrt(delta)) / (2.0 * a); + t_1_sync[i] = 1.5 * dq_max_sync_[i] / ddq_max_initial[i]; + delta_t_2_sync[i] = 1.5 * dq_max_sync_[i] / ddq_max_target[i]; + t_f_sync[i] = (t_1_sync)[i] / 2.0 + delta_t_2_sync[i] / 2.0 + std::abs(q_delta[i] / dq_max_sync_[i]); + t_2_sync[i] = (t_f_sync)[i] - delta_t_2_sync[i]; + q_1_[i] = (dq_max_sync_)[i] * sign_delta_q[i] * (0.5 * (t_1_sync)[i]); + } + } + } + + bool calculateDesiredValues(double t, Vector& q_delta_d) const { + Vector sign_delta_q = q_delta.cwiseSign(); + Vector t_d = t_2_sync - t_1_sync; + Vector delta_t_2_sync = t_f_sync - t_2_sync; + std::array joint_motion_finished {}; + + for (size_t i = 0; i < DOFs; i++) { + if (std::abs(q_delta[i]) < q_delta_motion_finished) { + q_delta_d[i] = 0; + joint_motion_finished[i] = true; + } else { + if (t < t_1_sync[i]) { + q_delta_d[i] = -1.0 / std::pow(t_1_sync[i], 3.0) * dq_max_sync_[i] * sign_delta_q[i] * (0.5 * t - t_1_sync[i]) * std::pow(t, 3.0); + } else if (t >= t_1_sync[i] && t < t_2_sync[i]) { + q_delta_d[i] = q_1_[i] + (t - t_1_sync[i]) * dq_max_sync_[i] * sign_delta_q[i]; + } else if (t >= t_2_sync[i] && t < t_f_sync[i]) { + q_delta_d[i] = q_delta[i] + 0.5 * (1.0 / std::pow(delta_t_2_sync[i], 3.0) * (t - t_1_sync[i] - 2.0 * delta_t_2_sync[i] - t_d[i]) * std::pow((t - t_1_sync[i] - t_d[i]), 3.0) + (2.0 * t - 2.0 * t_1_sync[i] - delta_t_2_sync[i] - 2.0 * t_d[i])) * dq_max_sync_[i] * sign_delta_q[i]; + } else { + q_delta_d[i] = q_delta[i]; + joint_motion_finished[i] = true; + } + } + } + return std::all_of(joint_motion_finished.cbegin(), joint_motion_finished.cend(), [](bool x) { return x; }); + } + +public: + double delta_time; + + explicit Smoothie(double delta_time): delta_time(delta_time) { } + + Result update(const InputParameter& input, OutputParameter& output) { + time += delta_time; + output.new_calculation = false; + + if (input != current_input) { + current_input = input; + + if ((input.max_velocity.array() <= 0.0).any() || (input.max_acceleration.array() <= 0.0).any()) { + return Result::Error; + } + if ((input.target_velocity.array() != 0.0).any() || (input.target_acceleration.array() != 0.0).any()) { + return Result::Error; + } + + dq_max_ = input.max_velocity; + ddq_max_initial = input.max_acceleration; + ddq_max_target = input.max_acceleration; + + q_initial = input.current_position; + q_delta = input.target_position - q_initial; + calculateSynchronizedValues(); + + output.duration = t_f_sync.maxCoeff(); + output.new_calculation = true; + } + + Vector q_delta_d; + bool motion_finished = calculateDesiredValues(time, q_delta_d); + + output.new_position = q_initial + q_delta_d; + output.new_velocity = Vector::Zero(); + output.new_acceleration = Vector::Zero(); + + current_input.current_position = output.new_position; + current_input.current_velocity = output.new_velocity; + current_input.current_acceleration = output.new_acceleration; + + if (motion_finished) { + output.new_position = input.target_position; + output.new_velocity = input.target_velocity; + output.new_acceleration = input.target_acceleration; + + return Result::Finished; + } + return Result::Working; + } +}; + +} // namespace ruckig diff --git a/include/ruckig/wolfram.hpp b/include/ruckig/wolfram.hpp new file mode 100644 index 00000000..cdb7c7df --- /dev/null +++ b/include/ruckig/wolfram.hpp @@ -0,0 +1,84 @@ +#pragma once + +#include + + +namespace ruckig { + +inline double Power(double v, int e) { + return std::pow(v, e); +} + +inline double Power(double v, double e) { + return std::pow(v, e); +} + +inline double Sqrt(double v) { + return std::sqrt(v); +} + +inline double Abs(double v) { + return std::abs(v); +} + +inline std::complex Complex(double a, double b) { + return std::complex(a, b); +} + +inline std::complex SqrtComplex(double v) { + return std::sqrt(std::complex(v, 0)); +} + +inline std::complex SqrtComplex(std::complex v) { + return std::sqrt(v); +} + +inline std::complex PowerComplex(std::complex v, int e) { + return std::pow(v, e); +} + +inline std::complex PowerComplex(std::complex v, double e) { + return std::pow(v, e); +} + +inline long double PowerLong(long double v, int e) { + return std::pow(v, e); +} + +inline long double PowerLong(long double v, double e) { + return std::pow(v, e); +} + +inline long double SqrtLong(long double v) { + return std::sqrt(v); +} + +inline long double AbsLong(long double v) { + return std::abs(v); +} + +inline std::complex ComplexLong(long double a, double b) { + return std::complex(a, b); +} + +inline std::complex SqrtComplexLong(long double v) { + return std::sqrt(std::complex(v, 0)); +} + +inline std::complex SqrtComplexLong(std::complex v) { + return std::sqrt(v); +} + +inline std::complex PowerComplexLong(std::complex v, double e) { + return std::pow(v, e); +} + +inline double eval(std::array polynom, double t) { + return polynom[5] + t * (polynom[4] + t * (polynom[3] + t * (polynom[2] + t * (polynom[1] + t * polynom[0])))); +} + +inline double eval(std::array polynom, double t) { + return polynom[6] + t * (polynom[5] + t * (polynom[4] + t * (polynom[3] + t * (polynom[2] + t * (polynom[1] + t * polynom[0]))))); +} + +} // namespace ruckig diff --git a/notebooks/quintic.nb b/notebooks/quintic.nb new file mode 100644 index 00000000..52c6d99e --- /dev/null +++ b/notebooks/quintic.nb @@ -0,0 +1,575 @@ +(* Content-type: application/vnd.wolfram.mathematica *) + +(*** Wolfram Notebook File ***) +(* http://www.wolfram.com/nb *) + +(* CreatedBy='Mathematica 12.0' *) + +(*CacheID: 234*) +(* Internal cache information: +NotebookFileLineBreakTest +NotebookFileLineBreakTest +NotebookDataPosition[ 158, 7] +NotebookDataLength[ 22650, 567] +NotebookOptionsPosition[ 20925, 529] +NotebookOutlinePosition[ 21265, 544] +CellTagsIndexPosition[ 21222, 541] +WindowFrame->Normal*) + +(* Beginning of Notebook Content *) +Notebook[{ + +Cell[CellGroupData[{ +Cell["Quintic Spline Generator", "Subtitle", + CellChangeTimes->{{3.812353928354472*^9, + 3.812353934160544*^9}},ExpressionUUID->"49c4c500-4bca-43fe-93e9-\ +78ce2c1ef69c"], + +Cell[BoxData[ + RowBox[{ + RowBox[{"r", "[", "t_", "]"}], ":=", + RowBox[{ + RowBox[{"a", " ", + SuperscriptBox["t", "5"]}], "+", + RowBox[{"b", " ", + SuperscriptBox["t", "4"]}], "+", + RowBox[{"c", " ", + SuperscriptBox["t", "3"]}], "+", + RowBox[{"d", " ", + SuperscriptBox["t", "2"]}], "+", + RowBox[{"e", " ", "t"}], "+", "f"}]}]], "Input", + CellChangeTimes->{{3.812274198148899*^9, 3.8122742330843363`*^9}}, + CellLabel->"In[1]:=",ExpressionUUID->"bbf5bef9-06a2-42d0-a385-df0fa3ad505f"], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{"res", "=", + RowBox[{ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"r", "[", "0", "]"}], "\[Equal]", "x0"}], ",", + "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"r", "'"}], "[", "0", "]"}], "\[Equal]", "v0"}], ",", + "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"r", "''"}], "[", "0", "]"}], "\[Equal]", "a0"}], ",", + "\[IndentingNewLine]", + RowBox[{ + RowBox[{"r", "[", "tf", "]"}], "\[Equal]", "xf"}], ",", + "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"r", "'"}], "[", "tf", "]"}], "\[Equal]", "vf"}], ",", + "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"r", "''"}], "[", "tf", "]"}], "\[Equal]", "af"}]}], + "\[IndentingNewLine]", "}"}], ",", + RowBox[{"{", + RowBox[{"a", ",", "b", ",", "c", ",", "d", ",", "e", ",", "f"}], + "}"}]}], "]"}], "[", + RowBox[{"[", "1", "]"}], "]"}]}]], "Input", + CellChangeTimes->{{3.8122742397411203`*^9, 3.8122742971169167`*^9}, { + 3.812274409895113*^9, 3.8122744109341383`*^9}}, + CellLabel->"In[2]:=",ExpressionUUID->"d2dfbb51-4c09-4581-9aa3-86a1fd092da5"], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{ + RowBox[{"a", "\[Rule]", + RowBox[{"-", + FractionBox[ + RowBox[{ + RowBox[{"a0", " ", + SuperscriptBox["tf", "2"]}], "-", + RowBox[{"af", " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"6", " ", "tf", " ", "v0"}], "+", + RowBox[{"6", " ", "tf", " ", "vf"}], "+", + RowBox[{"12", " ", "x0"}], "-", + RowBox[{"12", " ", "xf"}]}], + RowBox[{"2", " ", + SuperscriptBox["tf", "5"]}]]}]}], ",", + RowBox[{"b", "\[Rule]", + RowBox[{"-", + FractionBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "3"}], " ", "a0", " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"2", " ", "af", " ", + SuperscriptBox["tf", "2"]}], "-", + RowBox[{"16", " ", "tf", " ", "v0"}], "-", + RowBox[{"14", " ", "tf", " ", "vf"}], "-", + RowBox[{"30", " ", "x0"}], "+", + RowBox[{"30", " ", "xf"}]}], + RowBox[{"2", " ", + SuperscriptBox["tf", "4"]}]]}]}], ",", + RowBox[{"c", "\[Rule]", + RowBox[{"-", + FractionBox[ + RowBox[{ + RowBox[{"3", " ", "a0", " ", + SuperscriptBox["tf", "2"]}], "-", + RowBox[{"af", " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"12", " ", "tf", " ", "v0"}], "+", + RowBox[{"8", " ", "tf", " ", "vf"}], "+", + RowBox[{"20", " ", "x0"}], "-", + RowBox[{"20", " ", "xf"}]}], + RowBox[{"2", " ", + SuperscriptBox["tf", "3"]}]]}]}], ",", + RowBox[{"d", "\[Rule]", + FractionBox["a0", "2"]}], ",", + RowBox[{"e", "\[Rule]", "v0"}], ",", + RowBox[{"f", "\[Rule]", "x0"}]}], "}"}]], "Output", + CellChangeTimes->{{3.812274288494832*^9, 3.812274297503636*^9}, + 3.812274411272402*^9, {3.812353943604505*^9, 3.812353946254325*^9}, + 3.812366289675829*^9, 3.81415978575902*^9}, + CellLabel->"Out[2]=",ExpressionUUID->"6b34bb2b-ef07-457e-93a9-ed0db6aac60b"] +}, Open ]], + +Cell["Find Maximum of Velocity, Acceleration, and Jerk", "Text", + CellChangeTimes->{{3.812354010301882*^9, + 3.812354019986682*^9}},ExpressionUUID->"150a2e9b-cfd9-47f1-963c-\ +d508da0e68a0"], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"maxJerkT", "=", + RowBox[{ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"r", "''''"}], "[", "t", "]"}], "\[Equal]", "0"}], ",", "t"}], + "]"}], "/.", "res"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{"maxJerkTf", "=", + RowBox[{ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"r", "'''"}], "[", "t", "]"}], "/.", + RowBox[{"maxJerkT", "[", + RowBox[{"[", "1", "]"}], "]"}]}], "/.", "res"}], "/.", + RowBox[{"{", + RowBox[{ + RowBox[{"a0", "\[Rule]", "0"}], ",", + RowBox[{"af", "\[Rule]", "0"}], ",", + RowBox[{"v0", "\[Rule]", "0"}], ",", + RowBox[{"vf", "\[Rule]", "0"}]}], "}"}]}], ")"}], "\[Equal]", + "jMax"}], ",", "tf"}], "]"}], "[", + RowBox[{"[", "2", "]"}], "]"}]}]}], "Input", + CellChangeTimes->{{3.81235396112649*^9, 3.812353984009347*^9}, { + 3.812354030048271*^9, 3.81235422994519*^9}, {3.812354262794305*^9, + 3.812354442841771*^9}, {3.812354698451507*^9, 3.812354709526368*^9}, { + 3.8123662941358967`*^9, 3.81236629529646*^9}, {3.8123663356866426`*^9, + 3.812366337582245*^9}, {3.812366417190226*^9, 3.812366514519258*^9}, { + 3.812369893128203*^9, 3.8123699190234337`*^9}, {3.81237000708965*^9, + 3.812370146408964*^9}, {3.812370478232766*^9, 3.812370480814286*^9}, { + 3.814159840955447*^9, 3.814159893546583*^9}, {3.814159929291947*^9, + 3.814160028035316*^9}, {3.814160125052609*^9, 3.814160138860087*^9}, + 3.814160172781646*^9, {3.814160237389709*^9, 3.814160239149007*^9}}, + CellLabel-> + "In[101]:=",ExpressionUUID->"2e466dc4-e8ae-4ba0-a21c-ad42c0ce4a37"], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{"tf", "\[Rule]", + FractionBox[ + RowBox[{ + SuperscriptBox["30", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"x0", "-", "xf"}], ")"}], + RowBox[{"1", "/", "3"}]]}], + SuperscriptBox["jMax", + RowBox[{"1", "/", "3"}]]]}], "}"}]], "Output", + CellChangeTimes->{{3.8123539668694763`*^9, 3.812353984505331*^9}, { + 3.812354032404314*^9, 3.812354130783642*^9}, {3.81235416170765*^9, + 3.812354230330439*^9}, {3.812354265106627*^9, 3.81235444308022*^9}, + 3.812354473761189*^9, {3.812354700185112*^9, 3.8123547099095573`*^9}, + 3.812366295657493*^9, 3.8123663385962677`*^9, {3.8123664182841587`*^9, + 3.812366514877822*^9}, {3.812369895412538*^9, 3.8123699193905497`*^9}, { + 3.812370017996215*^9, 3.812370146880855*^9}, {3.8123704785834427`*^9, + 3.812370481181272*^9}, 3.814159788909965*^9, {3.8141598464534082`*^9, + 3.814159894112802*^9}, {3.8141599297775917`*^9, 3.8141600285226192`*^9}, { + 3.8141601255205812`*^9, 3.814160139122129*^9}, 3.8141601736174183`*^9, + 3.814160239512063*^9}, + CellLabel-> + "Out[102]=",ExpressionUUID->"9297535f-d9cb-469c-8a2f-2277fbb42a0d"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"maxAccT", "=", + RowBox[{ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"r", "'''"}], "[", "t", "]"}], "\[Equal]", "0"}], ",", "t"}], + "]"}], "/.", "res"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{"maxAccTf", "=", + RowBox[{ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"r", "''"}], "[", "t", "]"}], "/.", "res"}], "/.", + RowBox[{"maxAccT", "[", + RowBox[{"[", "1", "]"}], "]"}]}], "/.", + RowBox[{"{", + RowBox[{ + RowBox[{"a0", "\[Rule]", "0"}], ",", + RowBox[{"af", "\[Rule]", "0"}], ",", + RowBox[{"v0", "\[Rule]", "0"}], ",", + RowBox[{"vf", "\[Rule]", "0"}]}], "}"}]}], ")"}], "\[Equal]", + "aMax"}], ",", "tf"}], "]"}], "[", + RowBox[{"[", "4", "]"}], "]"}]}]}], "Input", + CellChangeTimes->{{3.8123544651987257`*^9, 3.812354584370565*^9}, { + 3.812354662747362*^9, 3.812354692210718*^9}, {3.812366284426289*^9, + 3.812366285799551*^9}, {3.8123663405313683`*^9, 3.812366344098298*^9}, { + 3.814160261357587*^9, 3.8141602619651337`*^9}, {3.81416029352555*^9, + 3.814160293628995*^9}}, + CellLabel-> + "In[107]:=",ExpressionUUID->"5fe6730b-ea10-4a0c-ac7a-37c7ada0a707"], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{"tf", "\[Rule]", + FractionBox[ + RowBox[{ + SqrtBox["10"], " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{ + SuperscriptBox["x0", "2"], "-", + RowBox[{"2", " ", "x0", " ", "xf"}], "+", + SuperscriptBox["xf", "2"]}], ")"}], + RowBox[{"1", "/", "4"}]]}], + RowBox[{ + SuperscriptBox["3", + RowBox[{"1", "/", "4"}]], " ", + SqrtBox["aMax"]}]]}], "}"}]], "Output", + CellChangeTimes->{{3.812354480268215*^9, 3.812354584816472*^9}, { + 3.812354667233481*^9, 3.8123546926717653`*^9}, {3.812366286609042*^9, + 3.812366297765739*^9}, 3.812366344654502*^9, 3.8123834634152727`*^9, + 3.8141598023472147`*^9, {3.814160259226156*^9, 3.814160294736022*^9}}, + CellLabel-> + "Out[108]=",ExpressionUUID->"5196904a-7b5f-4545-a07c-7fb4254d1db9"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"maxVelT", "=", + RowBox[{ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"r", "''"}], "[", "t", "]"}], "\[Equal]", "0"}], ",", "t"}], + "]"}], "/.", "res"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{"maxVelTf", "=", + RowBox[{ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"r", "'"}], "[", "t", "]"}], "/.", "res"}], "/.", + RowBox[{"maxVelT", "[", + RowBox[{"[", "1", "]"}], "]"}]}], "/.", + RowBox[{"{", + RowBox[{ + RowBox[{"a0", "\[Rule]", "0"}], ",", + RowBox[{"af", "\[Rule]", "0"}], ",", + RowBox[{"v0", "\[Rule]", "0"}], ",", + RowBox[{"vf", "\[Rule]", "0"}]}], "}"}]}], ")"}], "\[Equal]", + "vMax"}], ",", "tf"}], "]"}], "[", + RowBox[{"[", "1", "]"}], "]"}]}]}], "Input", + CellChangeTimes->{{3.812354592830155*^9, 3.812354686867679*^9}, { + 3.812366300774168*^9, 3.812366301992361*^9}, {3.812366346210133*^9, + 3.812366347721609*^9}, {3.812370560741046*^9, 3.812370584352597*^9}, { + 3.814159813539048*^9, 3.81415981419401*^9}, {3.814160297957967*^9, + 3.814160306189053*^9}}, + CellLabel-> + "In[113]:=",ExpressionUUID->"50603568-f240-4489-934b-d9cfa2d95318"], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{"tf", "\[Rule]", + RowBox[{"-", + FractionBox[ + RowBox[{"15", " ", + RowBox[{"(", + RowBox[{"x0", "-", "xf"}], ")"}]}], + RowBox[{"8", " ", "vMax"}]]}]}], "}"}]], "Output", + CellChangeTimes->{{3.812354624090929*^9, 3.812354687584631*^9}, + 3.812366302731291*^9, 3.8123663485390778`*^9, {3.812370561051642*^9, + 3.8123705987155867`*^9}, 3.81238336165096*^9, {3.81415981049634*^9, + 3.8141598150883217`*^9}, {3.814160296551602*^9, 3.814160306805706*^9}}, + CellLabel-> + "Out[114]=",ExpressionUUID->"826715a6-d289-4ff5-861d-1653e0d76163"] +}, Open ]], + +Cell["Plot Examples", "Text", + CellChangeTimes->{{3.812366321001575*^9, + 3.812366322825717*^9}},ExpressionUUID->"dd20d9e9-61a2-4cfa-a470-\ +400e57447904"], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"data", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"x0", "\[Rule]", "0"}], ",", + RowBox[{"v0", "\[Rule]", "1"}], ",", + RowBox[{"a0", "\[Rule]", "0"}], ",", + RowBox[{"xf", "\[Rule]", "1"}], ",", + RowBox[{"vf", "\[Rule]", "0"}], ",", + RowBox[{"af", "\[Rule]", "0"}], ",", + RowBox[{"vMax", "\[Rule]", "1"}], ",", + RowBox[{"aMax", "\[Rule]", "1"}], ",", + RowBox[{"jMax", "\[Rule]", "1"}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{"Plot", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"r", "'''"}], "[", "t", "]"}], "/.", "res"}], "/.", "data"}], + "/.", "tfdata"}], "}"}], ",", + RowBox[{"{", + RowBox[{"t", ",", "0", ",", "1"}], "}"}]}], "]"}]}], "Input", + CellChangeTimes->{{3.8123663302969103`*^9, 3.812366428832733*^9}, { + 3.812366526224143*^9, 3.812366578067265*^9}, {3.81236672262925*^9, + 3.812366723078273*^9}, {3.812366758931038*^9, 3.812366780849244*^9}, { + 3.812369772962038*^9, 3.812369888193581*^9}, {3.812383478184202*^9, + 3.8123834786651278`*^9}}, + CellLabel-> + "In[313]:=",ExpressionUUID->"f40b15f2-ed60-47f6-91af-891adbe8ec3c"], + +Cell[BoxData[ + GraphicsBox[{{{}, {}, + TagBox[ + {RGBColor[0.368417, 0.506779, 0.709798], AbsoluteThickness[1.6], Opacity[ + 1.], LineBox[CompressedData[" +1:eJwV1nk8ldvXAHCkUoQMGZIo83nOQwi3ZD3HkAqFFEqmKEld002mHwpJikqu +ynCUbqJCKUNk15W6IkLGM0oyH3VdQ5F3v3+dz/dzztlrPWuvvZ+l7vu7s7+I +kJDQKmEhof//3OM//BGNHLCY9I9qXFoypUStlIO5SsZQ8C1Cve27KWWUn53z +VMkaWNo3Ku58MaXsWrqf5Cq5wNh18vze96aUq99s3TUlPzgeyH6Fskwptv4F +q8tK4cCXpr2RIk0ppvy+5FSlROiwSv7s6mlCJYg91b6olAlVDPO4jDfGlJt7 +QenUt0IoM5fyqDm1hRJfSvCwVS2FJlepExnDBKXpNDn896UKUJzwmNM/pE1F +fPgNsqerYTRBiH/wjjqlULGWIyxcD5RP+qs+Qol6PmDV3Gr+GgzOzhbo1K2h +Xgfmrncfb4CpX9wYTsZ/8J/WDqlHp95CvJfMmPGKr/Ui8yXS6zWbwHtSNupy +yApksuT9fP/jZhD9g1pYDJJBzYnGHxr1WgFlKPx1ZkoRbcwYm38w2QbDJ/dI +ePttRGOzXM4ng3ZQTCg+J3FyEyocfdEkeaUDsnf/d2N8jSaS3HBfMDjYCVS8 +s4XQfm2UduLZMaZGFxTd1h7S19FFo9SjFHG9LojpaL6eoq+LbBXvFZ/R7wLp +dgtFlokuEnmbOWm/rQvSNl+8F2ajiyI1ws/M7+sCpkLlRz9fXXSMa5jsHN0F +4dZng/fd1kWMA2X3RNu7oK0s/a3NKj00Q5UMBsR1w0KHDOv5Jz1UWzh2OyKx +G95tWVD27NdD58SI/ckXuyHAi98nxNdDkm0PX9293g0Sevlss3E9pOX1OI9z +vxs0YocnQ0Vo6GBsuZtLWzfEKD+hpEgaelZd2QzqPXg99YLhBBqK2jB3fq9W +Dzy8mLi0lExDVILZ9iO0HvAu/8yRSaOh5l3VD6K29oBZ8A01WhYNDXbXJD/b +3QNlJY2lmsU0JDdTR9FCe6BTyXvR8iMNhRs2VKz7uweY7acPqKoQ6JixGvPq +ux4wGDFKXqFOIDeTmEsSH3rA3uvC7yOaBNq+zdhXpLcHhAJ7T+brE0jEslBq +crIH0LyueLMlgdKdEgPfKPeCnEjsoHYAgYqDrdXCQ3sh5/mo8OhjAuWEMsUF +Eb3QXBdtrfuUQJfDF2ZOxPZCisZtOFpJoOCzFS1eKdjSSV5v6wlkGq8RbZfX +Cw2+y3c6thGoIV20a1NTL5hNVT7ymyIQ93HDpY/qfcB7PPj1T4KO2iZExw21 ++8AxSJC+wYCOEGFjn0n0gYGRvXqeER0xi99IuJr2gTT751L6Njry/avxMsu+ +D5gFRo9MdtHRUO679K8RffBuQvRtui8dTaQ1X19swb5GzgVfpyPOe4lpz44+ +mIqJatqfRUcfVju4oJ4+SAtWTN5yk44ep7TInf+Mvw/bU83Oo6PgxA83xOb7 +IGYsWWr+AR1NR7f9KavRDxW5PtHb6+noZ2Dnbd2ofmBK5jkKvtCRi8mRq2Rc +P3RuD2wTG6ajh8JDyUaJ/cCLjhrYMEpHntmzITuu9EOG8fG6bZN09OqN8i6n +O/3glhKyF2bo6IKaz/TZpn4wq97NDltOIt7YyEhsaz+Yy7km7FxJIrPKUO65 +zn5QPFdUKbeKRKMOiU1pnH4IylLovytBIofo+0zm937wLtBaTJMlkWzXhP07 +ZRY8pMQep6qRKKjgjGXLRhbE/HPwzLpNJGoIWjJt12CBjv9IW+5mEp1ZtnYz +i2SBxKc+83wtEvUaGM8LLFlg/uekIIggUf6lqHsKJ1kwV9j72siURHMHl91W +CWZB5uETpWfNSOS4KS1D/Q8WiGnuIKt/I5FIdW40LQ5/P1U2QJiTyH8IOcF1 +Fkyd+EeLS5GIxlj569gLFigO1a3/fTeJyopLtHsQzk/w8si5PSQylnN02t3I +ApdXq05m2JHI/Gt2Ie0jC1JexnzNcSDR3st6dlNDOB/VnuMRTiRqn/kQ7jPO +Ao8gbVEfZxK5eofltX9jgdk5dNJmP4m8jWq/VSywIHhlW84vFxKF9jpkR8qw +YTjCL9nQjUQzlt9fjSqwgVolEvsdO/ph1tjhDWxQOTpi8cidRIlxXAsLHTb4 +Bd/QkD1MIrGR8wGldDbUbj606yX2ZWeda2pGbGDmB5j6eZAoSzPki4gFG3qm +fCOYR0iknC4vFW7FBuvGve9MPHE956rNvuzC6/slDr7FLnovkvZ2Pxvc5pv/ +1+dFImLr/Wdm7nj9Ke7CYW9cnzw77gNPvH6Z+c4e7OqQTMO0E2wYvNix7ZUP +iSz6zTwWT7PB/O6aIboviV5bs5NOh7NBJ+mqxw3snY8TSrmRbIjX98qbxW5S +0Op1jGNDwJ0zJS5HcT0TmkReJ7IBsbvPP8TuGD1NGKXiePxz2kvYrLrKOPkb +OJ7l87ZMP1xPbY8HybfYYM+06OrG/pIh1DGbzwaiUfq+vD+JAn8ULgTcY0Nm +BWG1F3vy6G6tvmI2hJ+8VpyAHdoysc+uDNdnlMEuxZ41uRZZ+4wNVYbb+3uw +Y5gmd+kv2KBo9b/CBWyh1f3NeYgNoiriv60/hvcjLG5GqhHnX8fPNsZexd6s +lvCeDbu0RRp2YV/Z+W739zY2FLkH1bhiy5QFhR3tYkOGi1qMD3aW0trczn42 +TCmorjqGvf78s0YbPhtYd/19/LGZ4+5Tz4dwP8zNJHphaxz8paQzjusp3x7m +gl1Uf8fq5jc2JP6YoVtj03VtT62eZUNwkf9TEvvJtbGs6AU2tKmqisphmyyk +o3FhDlQcUVObxs9T4288emQlB1T8g1a2Ylu09si2SnBgwVikphD7tVnsDkqG +A0EtfNM/sG3vqB8vV+DALlI8gcI2zpbUalThQErCkazV2GpXfg72qXOgIWNc +vQ3vx5rE4bsCLQ4IeVRtvor9I/KTryjBAYPP6LYD9tffX6srbeGAt9aK1OXY +nf6lPLoJBzI1Uyar8H4/crro6UpxYNrVUlkG+5btmQ1BNhxQuxTFr8T9k7zj +KCt+DweoKIGqO7a37o5DxS4cSEtLX7iM+1FW+NuBxQAOiCUUWb7C/Sw0y5aT +Oc0BnczGF5bY4+NNHVphHDA/ql5Sj/u/safQyTGWAwFbL4+X4PMSWebmcPcq +B5gPdvxwwOfr2F82ElVZ2DkMzZJDJHLOMXzffJsDD+3ONS7DJlIkds/cw/Vl +V5+8j88v1wtZ767hQNFHYUbVARI1H3i0zLMeu3Bswzd8/qvsbr0ObeBAjpFM +iCb2NdNwKucDB+KT5KPi8f1hI6VjLhjggPH89DqhfSQyXC7/c9kwBxQfNtyT +20si1Z/CNYoTHJhT/lisge+juaF+U8tZXH+CqWCK76uSl+lGN8S5YKCmEKNp +S6LsipjvD6S5IPa0uVZ+J+7f4hPlL+W5wBOuDxO2IZFnlpX+8EYunO1wt35v +SaK1p2f1thtzoWhnQLCOBYkiNnht4ntwgRk0/K+YMYl8HQ0Osny4kNlXf6zS +EJ/f88Kp3ce4IKotEuuzhURaI3e/tQRzIfjw2+tFJN7fimFUk4jXN3QJFNEl +kYF9qFfmQy4MZke8GFQhkUqc1fX0ci5MTy74Oawn0concm9Tn3PxfDVRXq5E +Io5CJZmAuGCtI2lyah2J0j7/XDzVyQVWvvPXUikSDUcl5dgucMHP9svEUWH8 +fjpICygQ4gEzSfFD8hIdeU/JimxcxgOPO8+d7i3Skd3mL1uVxXjgFmFk9Wme +jjZdvJArLcOD+HT9VqHveB5waQ5a1OSBztktl5L5dESMHxDvduCBAc3jun0d +HVW52NenOvKgwvOKe2kNHVnVWYZZ7OeBo33hokQVHR26ot9/z40H6EA0t+oJ +HV00WFUSfhTno961quM+nhfCa/fIRPKAyrWYl76K54vFTakOhTwY3txv+dQL +xzumZCF8nwdCtxLfhHjQUeUHqe8VD3hANK3Vornj+SF/wV2llAfv3LrjrzjT +0SKjS3esmgfTpFSugg2On3zxn5RWHmjUbwk20qUjWakpsYYfPJg7bZlwdYJA +7XWpF3Yv4udNq8yYHCHQtSDNFa1L+P+ujdq2QwSSaTq0rE+UD21zZeOjHOyk +N4sCST64+dZ8XGglkPTPW9/Xb+ZDUWeu2J5yAkl8tWGF2fHBzOS+bmowgZpv +8A7NO/CBkHUm3IIIlGYd3fs/Rz6o5WU9V8fznfidsq6LB/gwVTfuc9+LQKuP +rP+Y78WHcM0W2di9BBLrmHrzPowPZdc9B51oBBKtv126OYcPEhN/mxXwaajP +3HoXN48PwQcZ85EsGiqtGefdKuBD9quzkQ7dNHTo+Q4Zmfs431z56sFmGip/ +xA0XesIHlcCVWzsracgzZ/M29lucj/v7jZV4/q2KLGnI+pcPjpc7UZohDZ00 +ftG7ym4ABh3GDSJO6yHU9ulhlcMAmKVJaagG6CH5U1Nxxx0HoOHXlZXIRw/V +39PUenNgAHLi7+RPu+ghWYWM0HjvAQifXS+nvl0PvZj3E5/9YwCY5W6SF1bo +IfF6yR2DzAF46Dpve+GmLirZ7ct8OTMAbYHdrW5lOui/MWXpoazPIH2zbYp6 +q4We7bddlmk9iO9fL6ft/hoobldSfsXQIEjLvs4W5asjdfaenrtJX4DnPczs +3KmKtpkmZioZDoHQH5X/mlcqIA/V1nnhjiFg/gRoF12L/mu6PBCc8BWECn4w +bKxEULaoZ7izxjAI8VRMnDrb62U5z+6INAwDJSrekPdkAZbHJrj8FjKCz0fQ +8VV90pTQA8/SAZlRoNbYZQycUaZCb5Velnk9ClO2jQ96X22i6mgpYmtPj4Ga +6dZr0fE61No9ocQ5yXGY6hKdv6FJUix6W0dk7TjovDP/12iPIVWWBxqDnhPA +LD2yIix4K3Wk1GTthl8ToCPr/KdIsRkVn1SQwCqeBEqy5rGskzn1aHjDbUl7 +AbjNZhy8jl8DKblJ3py9AgjW14p9hX/m5zyh+dhJABlpW05+/wWUSm1tmYOr +ABYOfdr7WIqiUtMPN6b5CiDHV5bUNaCoAJOb31ZHCkBn7E6+TwhFbUqU27Xy +LwE086T2sacp6pdZzJruIgEwW2p71RYpqnfic/tfJQKYatZ457+cQWW4Pj2y +s1wAxsu02v6VZ1BLes5hSbU4nsNEmpopg2J9TM9b1iGAMo/06tpIBlWVPHu0 +45MABkMm4tadY1CZ27107/bg9W+uKA5JZVB298gKS44ACtUCdYnbDKrmbMs/ +CSMCmJOY6SyvZVBZ9K3pTuMC8H5OVK97w6BCBnJc1AUCsA9VFY5tYVA69kFc +NI3jqRvVOnAYlKhwZ2HGrAAI+YP6VUMMivdse6D3DwGYrTdeoSFgULWBd/UN +FgXQYNRCXZ1lUH9uFP9vaUkAbZ7q3KUlBvV/zb8peA== + "]]}, + Annotation[#, "Charting`Private`Tag$39106#1"]& ]}, {}}, + AspectRatio->NCache[GoldenRatio^(-1), 0.6180339887498948], + Axes->{True, True}, + AxesLabel->{None, None}, + AxesOrigin->{0, 0}, + DisplayFunction->Identity, + Frame->{{False, False}, {False, False}}, + FrameLabel->{{None, None}, {None, None}}, + FrameTicks->{{Automatic, + Charting`ScaledFrameTicks[{Identity, Identity}]}, {Automatic, + Charting`ScaledFrameTicks[{Identity, Identity}]}}, + GridLines->{None, None}, + GridLinesStyle->Directive[ + GrayLevel[0.5, 0.4]], + ImagePadding->All, + Method->{ + "DefaultBoundaryStyle" -> Automatic, + "DefaultGraphicsInteraction" -> { + "Version" -> 1.2, "TrackMousePosition" -> {True, False}, + "Effects" -> { + "Highlight" -> {"ratio" -> 2}, "HighlightPoint" -> {"ratio" -> 2}, + "Droplines" -> { + "freeformCursorMode" -> True, + "placement" -> {"x" -> "All", "y" -> "None"}}}}, "DefaultMeshStyle" -> + AbsolutePointSize[6], "ScalingFunctions" -> None, + "CoordinatesToolOptions" -> {"DisplayFunction" -> ({ + (Identity[#]& )[ + Part[#, 1]], + (Identity[#]& )[ + Part[#, 2]]}& ), "CopiedValueFunction" -> ({ + (Identity[#]& )[ + Part[#, 1]], + (Identity[#]& )[ + Part[#, 2]]}& )}}, + PlotRange->{{0, 1}, {-15.199997219966434`, 35.99999608163273}}, + PlotRangeClipping->True, + PlotRangePadding->{{ + Scaled[0.02], + Scaled[0.02]}, { + Scaled[0.05], + Scaled[0.05]}}, + Ticks->{Automatic, Automatic}]], "Output", + CellChangeTimes->{{3.812366375946026*^9, 3.812366438878806*^9}, { + 3.812366491178611*^9, 3.812366578514271*^9}, 3.812366723380484*^9, { + 3.812366759386574*^9, 3.8123667813784246`*^9}, {3.812369773744829*^9, + 3.8123698850833683`*^9}, {3.812383473244947*^9, 3.812383479081012*^9}}, + CellLabel-> + "Out[314]=",ExpressionUUID->"638fffd5-4baf-4565-b222-693a588710da"] +}, Open ]] +}, Open ]] +}, +WindowSize->{1848, 1016}, +WindowMargins->{{-1988, Automatic}, {170, Automatic}}, +FrontEndVersion->"12.0 for Linux x86 (64-bit) (April 8, 2019)", +StyleDefinitions->"Default.nb" +] +(* End of Notebook Content *) + +(* Internal cache information *) +(*CellTagsOutline +CellTagsIndex->{} +*) +(*CellTagsIndex +CellTagsIndex->{} +*) +(*NotebookFileOutline +Notebook[{ +Cell[CellGroupData[{ +Cell[580, 22, 170, 3, 54, "Subtitle",ExpressionUUID->"49c4c500-4bca-43fe-93e9-78ce2c1ef69c"], +Cell[753, 27, 512, 14, 33, "Input",ExpressionUUID->"bbf5bef9-06a2-42d0-a385-df0fa3ad505f"], +Cell[CellGroupData[{ +Cell[1290, 45, 1286, 35, 193, "Input",ExpressionUUID->"d2dfbb51-4c09-4581-9aa3-86a1fd092da5"], +Cell[2579, 82, 1923, 53, 59, "Output",ExpressionUUID->"6b34bb2b-ef07-457e-93a9-ed0db6aac60b"] +}, Open ]], +Cell[4517, 138, 190, 3, 36, "Text",ExpressionUUID->"150a2e9b-cfd9-47f1-963c-d508da0e68a0"], +Cell[CellGroupData[{ +Cell[4732, 145, 1772, 42, 55, "Input",ExpressionUUID->"2e466dc4-e8ae-4ba0-a21c-ad42c0ce4a37"], +Cell[6507, 189, 1195, 25, 62, "Output",ExpressionUUID->"9297535f-d9cb-469c-8a2f-2277fbb42a0d"] +}, Open ]], +Cell[CellGroupData[{ +Cell[7739, 219, 1354, 37, 55, "Input",ExpressionUUID->"5fe6730b-ea10-4a0c-ac7a-37c7ada0a707"], +Cell[9096, 258, 833, 22, 65, "Output",ExpressionUUID->"5196904a-7b5f-4545-a07c-7fb4254d1db9"] +}, Open ]], +Cell[CellGroupData[{ +Cell[9966, 285, 1346, 37, 55, "Input",ExpressionUUID->"50603568-f240-4489-934b-d9cfa2d95318"], +Cell[11315, 324, 604, 14, 54, "Output",ExpressionUUID->"826715a6-d289-4ff5-861d-1653e0d76163"] +}, Open ]], +Cell[11934, 341, 155, 3, 36, "Text",ExpressionUUID->"dd20d9e9-61a2-4cfa-a470-400e57447904"], +Cell[CellGroupData[{ +Cell[12114, 348, 1211, 32, 55, "Input",ExpressionUUID->"f40b15f2-ed60-47f6-91af-891adbe8ec3c"], +Cell[13328, 382, 7569, 143, 231, "Output",ExpressionUUID->"638fffd5-4baf-4565-b222-693a588710da"] +}, Open ]] +}, Open ]] +} +] +*) + diff --git a/notebooks/ruckig-step1.nb b/notebooks/ruckig-step1.nb new file mode 100644 index 00000000..c95a90c6 --- /dev/null +++ b/notebooks/ruckig-step1.nb @@ -0,0 +1,5805 @@ +(* Content-type: application/vnd.wolfram.mathematica *) + +(*** Wolfram Notebook File ***) +(* http://www.wolfram.com/nb *) + +(* CreatedBy='Mathematica 12.0' *) + +(*CacheID: 234*) +(* Internal cache information: +NotebookFileLineBreakTest +NotebookFileLineBreakTest +NotebookDataPosition[ 158, 7] +NotebookDataLength[ 213752, 5797] +NotebookOptionsPosition[ 201218, 5590] +NotebookOutlinePosition[ 201557, 5605] +CellTagsIndexPosition[ 201514, 5602] +WindowFrame->Normal*) + +(* Beginning of Notebook Content *) +Notebook[{ +Cell["\<\ +Ruckig: OTG with constrained Jerk, Zero Target Velocity +opt_control Paper: http://ais.uni-bonn.de/papers/ICUAS_2016_Beul.pdf\ +\>", "Text", + CellChangeTimes->{{3.812333727449677*^9, 3.812333730908003*^9}, { + 3.8123837241868753`*^9, 3.812383728276732*^9}, {3.814008457214835*^9, + 3.814008475537912*^9}},ExpressionUUID->"6747c71c-c66c-433d-9613-\ +bddcf8a50059"], + +Cell[BoxData[ + RowBox[{ + RowBox[{"toCCode", "[", + RowBox[{"result_", ",", "case_", ",", "n_", ",", "solution_"}], "]"}], ":=", + RowBox[{"Module", "[", + RowBox[{ + RowBox[{"{", "}"}], ",", "\[IndentingNewLine]", + RowBox[{"Return", "[", + RowBox[{"\"\\"", "<>", + RowBox[{"ToString", "[", + RowBox[{"n", "-", "1"}], "]"}], "<>", "\"\<] = \>\"", "<>", + RowBox[{"StringDelete", "[", + RowBox[{ + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{ + RowBox[{"Refine", "[", + RowBox[{"result", "[", + RowBox[{"[", + RowBox[{"case", ",", "solution", ",", "n", ",", "2"}], "]"}], + "]"}], "]"}], ",", + RowBox[{"{", + RowBox[{"jMax", "\[Element]", "Reals"}], "}"}]}], "]"}], ",", + "CForm"}], "]"}], ",", "\"\<\\\"\>\""}], "]"}], "<>", + "\"\<;\\n\>\""}], "]"}]}], "\[IndentingNewLine]", "]"}]}]], "Input", + CellChangeTimes->CompressedData[" +1:eJxTTMoPSmViYGAQBmIQnfVNaN6UhDeOymz7F4JoBWmddSA6aWnCJRC9pT3l +Hog+lWjwDkSL2Zy0mQqkvytkOIHo8LNrwkF0VMMBMD3hdmAGiF53tARMy94s +MtwDpI0f7DEC0aptsWs2J75xnLFo0TYQfXO/wSEQrRBtfAVEq2z5+gpEf/g6 +7Q2IjijbE7A0641jbfujMBAdKLQsCkS7XeaMBtHrnj9IBdG37/SkgWjXUy6y +y4C0y4wmMG1el3j/OJDW2Dr1CYj+ceK56gmQeP4SNRB9N+BL3ZHsN44561Xq +QfQ1/byMV0D6aY1CJojW/L5I4FPOG8fWbEUhEA0Ab/Wj9Q== + "], + CellLabel->"In[1]:=",ExpressionUUID->"eaed5991-b6cc-4fdf-bc63-1d49408dff17"], + +Cell[BoxData[{ + RowBox[{ + RowBox[{"jerkProfileUDDU", "=", + RowBox[{"{", + RowBox[{"jMax", ",", "0", ",", + RowBox[{"-", "jMax"}], ",", "0", ",", + RowBox[{"-", "jMax"}], ",", "0", ",", "jMax"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"jerkProfileDUUD", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"-", "jMax"}], ",", "0", ",", "jMax", ",", "0", ",", "jMax", ",", + "0", ",", + RowBox[{"-", "jMax"}]}], "}"}]}], ";"}]}], "Input", + CellChangeTimes->{{3.8124264397735767`*^9, 3.812426441789057*^9}, { + 3.814009402238038*^9, 3.814009416778562*^9}, {3.814011127145894*^9, + 3.814011140157218*^9}, 3.815153442979525*^9}, + CellLabel->"In[2]:=",ExpressionUUID->"582d570a-5169-47df-b546-722be9ef7658"], + +Cell[BoxData[{ + RowBox[{ + RowBox[{ + RowBox[{"jerkProfile", "=", "jerkProfileUDDU"}], ";"}], + "\[IndentingNewLine]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"a1", "=", + RowBox[{"a0", "+", + RowBox[{"t1", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "1", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"a2", "=", + RowBox[{"a1", "+", + RowBox[{"t2", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "2", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"a3", "=", + RowBox[{"a2", "+", + RowBox[{"t3", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "3", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"a4", "=", + RowBox[{"a3", "+", + RowBox[{"t4", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "4", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"a5", "=", + RowBox[{"a4", "+", + RowBox[{"t5", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "5", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"a6", "=", + RowBox[{"a5", "+", + RowBox[{"t6", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "6", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"a7", "=", + RowBox[{"a6", "+", + RowBox[{"t7", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "7", "]"}], "]"}]}]}]}], ";"}], + "\[IndentingNewLine]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"v1", "=", + RowBox[{"v0", "+", + RowBox[{"t1", " ", "a0"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t1", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "1", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"v2", "=", + RowBox[{"v1", "+", + RowBox[{"t2", " ", "a1"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t2", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "2", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"v3", "=", + RowBox[{"v2", "+", + RowBox[{"t3", " ", "a2"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t3", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "3", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"v4", "=", + RowBox[{"v3", "+", + RowBox[{"t4", " ", "a3"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t4", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "4", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"v5", "=", + RowBox[{"v4", "+", + RowBox[{"t5", " ", "a4"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t5", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "5", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"v6", "=", + RowBox[{"v5", "+", + RowBox[{"t6", " ", "a5"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t6", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "6", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"v7", "=", + RowBox[{"v6", "+", + RowBox[{"t7", " ", "a6"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t7", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "7", "]"}], "]"}]}]}]}], ";"}], + "\[IndentingNewLine]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"p1", "=", + RowBox[{"p0", "+", + RowBox[{"t1", " ", "v0"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t1", "2"], " ", "a0"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t1", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "1", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"p2", "=", + RowBox[{"p1", "+", + RowBox[{"t2", " ", "v1"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t2", "2"], " ", "a1"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t2", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "2", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"p3", "=", + RowBox[{"p2", "+", + RowBox[{"t3", " ", "v2"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t3", "2"], " ", "a2"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t3", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "3", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"p4", "=", + RowBox[{"p3", "+", + RowBox[{"t4", " ", "v3"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t4", "2"], " ", "a3"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t4", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "4", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"p5", "=", + RowBox[{"p4", "+", + RowBox[{"t5", " ", "v4"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t5", "2"], " ", "a4"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t5", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "5", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"p6", "=", + RowBox[{"p5", "+", + RowBox[{"t6", " ", "v5"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t6", "2"], " ", "a5"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t6", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "6", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"p7", "=", + RowBox[{"p6", "+", + RowBox[{"t7", " ", "v6"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t7", "2"], " ", "a6"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t7", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "7", "]"}], "]"}]}]}]}], ";"}]}], "Input", + CellChangeTimes->{{3.812298845856036*^9, 3.812298928045364*^9}, { + 3.812383837870165*^9, 3.812384013866997*^9}, {3.8124264341093807`*^9, + 3.812426455482448*^9}, 3.814011689309369*^9, 3.814080342528859*^9, + 3.81476866812947*^9, {3.814770119433319*^9, 3.814770125545671*^9}}, + CellLabel->"In[4]:=",ExpressionUUID->"8f6504f9-2554-4bf6-b7e0-31a28a689144"], + +Cell[BoxData[{ + RowBox[{ + RowBox[{"tVars", "=", + RowBox[{"{", + RowBox[{ + "t1", ",", "t2", ",", "t3", ",", "t4", ",", "t5", ",", "t6", ",", "t7"}], + "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"resultT", "=", + RowBox[{"{", "\[IndentingNewLine]", + RowBox[{ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"a1", "\[Equal]", "aMax"}], ",", + RowBox[{"a5", "\[Equal]", + RowBox[{"-", "aMax"}]}], ",", + RowBox[{"v3", "\[Equal]", "vMax"}]}], "}"}], ",", "tVars"}], "]"}], + ",", "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"a1", "\[Equal]", "aMax"}], ",", + RowBox[{"a5", "\[Equal]", + RowBox[{"-", "aMax"}]}], ",", + RowBox[{"t4", "\[Equal]", "0"}]}], "}"}], ",", "tVars"}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"a5", "\[Equal]", + RowBox[{"-", "aMax"}]}], ",", + RowBox[{"v3", "\[Equal]", "vMax"}]}], "}"}], ",", "tVars"}], "]"}], + ",", "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"a1", "\[Equal]", "aMax"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"v3", "\[Equal]", "vMax"}]}], "}"}], ",", "tVars"}], "]"}], + ",", "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"v3", "\[Equal]", "vMax"}]}], "}"}], ",", "tVars"}], "]"}], + ",", "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"a5", "\[Equal]", + RowBox[{"-", "aMax"}]}], ",", + RowBox[{"t4", "\[Equal]", "0"}]}], "}"}], ",", "tVars"}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"a1", "\[Equal]", "aMax"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"t4", "\[Equal]", "0"}]}], "}"}], ",", "tVars"}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"t4", "\[Equal]", "0"}]}], "}"}], ",", "tVars"}], "]"}]}], + "\[IndentingNewLine]", "}"}]}], ";"}]}], "Input", + CellChangeTimes->{{3.814011188803513*^9, 3.8140112242015457`*^9}, { + 3.8140807651389236`*^9, 3.8140807761954527`*^9}, {3.814598875908167*^9, + 3.8145988769236603`*^9}, {3.814599757489683*^9, 3.8145997576964684`*^9}, { + 3.8151535158032007`*^9, 3.815153520751766*^9}, {3.8151535585435047`*^9, + 3.8151535619919*^9}, 3.815324705493132*^9, {3.815324807371518*^9, + 3.8153248076001587`*^9}, 3.815324925381845*^9, {3.8153250140636387`*^9, + 3.815325014350729*^9}}, + CellLabel->"In[26]:=",ExpressionUUID->"949497de-8cba-4eb9-93ab-b867d25cac1b"], + +Cell["\<\ +For Case1->1, Case2->2, Case3->2, Case4->2, Case5 -> 4, Case6->2/4, \ +Case7->2/4, Case8->1/2/3/4\ +\>", "Text", + CellChangeTimes->{{3.8145963964144783`*^9, 3.814596410198728*^9}, { + 3.81459737760816*^9, 3.814597379447958*^9}, {3.814675012678129*^9, + 3.814675014999237*^9}, {3.814675434223815*^9, 3.814675435778751*^9}, { + 3.814677245444907*^9, 3.814677247086051*^9}, {3.814677577971238*^9, + 3.8146775799480467`*^9}, {3.81467811003957*^9, 3.814678112258284*^9}, { + 3.814679138469221*^9, 3.814679138524722*^9}, {3.8146791706546307`*^9, + 3.814679170929491*^9}, {3.8152149593448973`*^9, 3.815214959801092*^9}, { + 3.815215057018126*^9, 3.81521505705013*^9}, {3.815215214483781*^9, + 3.815215214547587*^9}, {3.815246218505053*^9, 3.815246218972806*^9}, { + 3.8152806039057627`*^9, 3.815280604373784*^9}, {3.815282031126894*^9, + 3.815282031208784*^9}, {3.8159806545707693`*^9, 3.815980655026698*^9}, { + 3.815988581127006*^9, + 3.815988581471055*^9}},ExpressionUUID->"5d45ab23-1fee-430c-90e5-\ +5f8b0e08bfb1"], + +Cell[BoxData[ + RowBox[{ + RowBox[{"tmpData", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"p0", "\[Rule]", + RowBox[{"-", "0.7"}]}], ",", + RowBox[{"v0", "\[Rule]", "0.0"}], ",", + RowBox[{"a0", "\[Rule]", "0.0"}], ",", + RowBox[{"pf", "\[Rule]", + RowBox[{"-", "0.35"}]}], ",", + RowBox[{"vf", "\[Rule]", + RowBox[{"-", "0.5"}]}], ",", + RowBox[{"vMax", "\[Rule]", "8.4"}], ",", + RowBox[{"aMax", "\[Rule]", "2.5"}], ",", + RowBox[{"jMax", "\[Rule]", "6.3"}]}], "}"}]}], ";"}]], "Input", + CellChangeTimes->{{3.8158866449290867`*^9, 3.815886672672312*^9}, { + 3.815886739145801*^9, 3.815886763201823*^9}, {3.815886799553928*^9, + 3.815886803721595*^9}, {3.8158868786745863`*^9, 3.815886916714327*^9}, { + 3.815887133340382*^9, 3.815887133515131*^9}, {3.815887915485036*^9, + 3.815887917116212*^9}, {3.815889530817287*^9, 3.815889531688764*^9}, + 3.8158905996920767`*^9, {3.8158924822404003`*^9, 3.815892483247542*^9}, + 3.815894186853977*^9, {3.815980441321415*^9, 3.815980471561269*^9}, { + 3.815980514754574*^9, 3.815980517105686*^9}, {3.815980576746241*^9, + 3.8159805842671833`*^9}, {3.815980618394939*^9, 3.8159806185064487`*^9}, { + 3.815986071386758*^9, 3.815986100154087*^9}, {3.815988589896044*^9, + 3.81598860731138*^9}, {3.8159887776008673`*^9, 3.815988817545354*^9}}, + CellLabel-> + "In[379]:=",ExpressionUUID->"0d917997-47ce-4513-8d74-2b5287a21e54"], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{ + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", "6", "]"}], "]"}], "/.", "tmpData"}], "//", "N"}]], "Input", + CellChangeTimes->CompressedData[" +1:eJxTTMoPSmViYGAQBmIQvXD3yzkauW8ctf4dWwSil1eIrgfRK8w0N4Bosx8L +d4DoyojvYFoo3PMwiLZ3P3cERK8xna6pCaS3POTXAtEuF3Im2wNppveBM0D0 +AjvjBSBaQMgJTF+RV33qCaRTjDTegugCRyWdF0C6T1TQDESrLQ9a9RlIOzfm +rQfRRZVTXlnmvXH896DvPYi+01T8GUTrbpn4DUT/Epv2B0TvStv5H0TPlXVk +tQLSykIPwLRvpMPedCD9ZuLWgyB6IXNRQRaIPl0CppMi8jZkA+m8xYVg+sxW +2b0gur9HCUyvXLjzOIhmKNkLpgFf4phv + "], + CellLabel-> + "In[380]:=",ExpressionUUID->"e30a8adc-f57d-4ea5-af7e-e23e77c045e9"], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"t1", "\[Rule]", + RowBox[{ + RowBox[{"-", "0.39682539682539697`"}], "-", + RowBox[{"7.915133840143859`*^-9", " ", "\[ImaginaryI]"}]}]}], ",", + RowBox[{"t2", "\[Rule]", "0.`"}], ",", + RowBox[{"t3", "\[Rule]", + RowBox[{ + RowBox[{"-", "0.39682539682539697`"}], "-", + RowBox[{"7.915133840143857`*^-9", " ", "\[ImaginaryI]"}]}]}], ",", + RowBox[{"t4", "\[Rule]", "0.`"}], ",", + RowBox[{"t5", "\[Rule]", "0.3968253968253968`"}], ",", + RowBox[{"t6", "\[Rule]", + RowBox[{"0.20000000000000018`", "\[VeryThinSpace]", "+", + RowBox[{"1.6348618441128747`*^-8", " ", "\[ImaginaryI]"}]}]}], ",", + RowBox[{"t7", "\[Rule]", "0.3968253968253968`"}]}], "}"}], ",", + RowBox[{"{", + RowBox[{ + RowBox[{"t1", "\[Rule]", + RowBox[{"1.942890293094024`*^-16", "-", + RowBox[{"8.951835361825901`*^-9", " ", "\[ImaginaryI]"}]}]}], ",", + RowBox[{"t2", "\[Rule]", "0.`"}], ",", + RowBox[{"t3", "\[Rule]", + RowBox[{"1.7622587692462801`*^-16", "-", + RowBox[{"8.951835361825901`*^-9", " ", "\[ImaginaryI]"}]}]}], ",", + RowBox[{"t4", "\[Rule]", "0.`"}], ",", + RowBox[{"t5", "\[Rule]", "0.3968253968253968`"}], ",", + RowBox[{"t6", "\[Rule]", + RowBox[{ + RowBox[{"-", "0.19682539682539701`"}], "+", + RowBox[{"5.183507608410131`*^-10", " ", "\[ImaginaryI]"}]}]}], ",", + RowBox[{"t7", "\[Rule]", "0.3968253968253968`"}]}], "}"}], ",", + RowBox[{"{", + RowBox[{ + RowBox[{"t1", "\[Rule]", + RowBox[{ + RowBox[{"-", "0.39682539682539697`"}], "+", + RowBox[{"7.915133840143859`*^-9", " ", "\[ImaginaryI]"}]}]}], ",", + RowBox[{"t2", "\[Rule]", "0.`"}], ",", + RowBox[{"t3", "\[Rule]", + RowBox[{ + RowBox[{"-", "0.39682539682539697`"}], "+", + RowBox[{"7.915133840143857`*^-9", " ", "\[ImaginaryI]"}]}]}], ",", + RowBox[{"t4", "\[Rule]", "0.`"}], ",", + RowBox[{"t5", "\[Rule]", "0.3968253968253968`"}], ",", + RowBox[{"t6", "\[Rule]", + RowBox[{"0.20000000000000018`", "\[VeryThinSpace]", "-", + RowBox[{"1.6348618441128747`*^-8", " ", "\[ImaginaryI]"}]}]}], ",", + RowBox[{"t7", "\[Rule]", "0.3968253968253968`"}]}], "}"}], ",", + RowBox[{"{", + RowBox[{ + RowBox[{"t1", "\[Rule]", + RowBox[{"1.942890293094024`*^-16", "+", + RowBox[{"8.951835361825901`*^-9", " ", "\[ImaginaryI]"}]}]}], ",", + RowBox[{"t2", "\[Rule]", "0.`"}], ",", + RowBox[{"t3", "\[Rule]", + RowBox[{"1.7622587692462801`*^-16", "+", + RowBox[{"8.951835361825901`*^-9", " ", "\[ImaginaryI]"}]}]}], ",", + RowBox[{"t4", "\[Rule]", "0.`"}], ",", + RowBox[{"t5", "\[Rule]", "0.3968253968253968`"}], ",", + RowBox[{"t6", "\[Rule]", + RowBox[{ + RowBox[{"-", "0.19682539682539701`"}], "-", + RowBox[{"5.183507608410131`*^-10", " ", "\[ImaginaryI]"}]}]}], ",", + RowBox[{"t7", "\[Rule]", "0.3968253968253968`"}]}], "}"}]}], + "}"}]], "Output", + CellChangeTimes->{ + 3.8158867734637823`*^9, {3.815886805800742*^9, 3.815886846622553*^9}, { + 3.815886881428212*^9, 3.815886918148731*^9}, {3.8158871280475063`*^9, + 3.815887134918139*^9}, 3.815887919292042*^9, 3.815889534102347*^9, + 3.8158924853041697`*^9, 3.815980474268754*^9, {3.8159805224716187`*^9, + 3.81598058581785*^9}, 3.81598062081492*^9, 3.815981151270706*^9, + 3.815986052082103*^9, 3.81598610202033*^9, 3.815987005815884*^9, { + 3.8159886091075487`*^9, 3.81598861191088*^9}, {3.815988712081704*^9, + 3.815988713318471*^9}, {3.815988779483006*^9, 3.8159888196348763`*^9}}, + CellLabel-> + "Out[380]=",ExpressionUUID->"aaf913f0-5415-4bca-b861-f7784c84d612"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{"InputForm", "[", + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"8", ",", "2"}], "]"}], "]"}], "/.", + RowBox[{"{", + RowBox[{ + RowBox[{"p0", "\[Rule]", + RowBox[{"-", "0.413915"}]}], ",", + RowBox[{"v0", "\[Rule]", + RowBox[{"-", "0.974002"}]}], ",", + RowBox[{"a0", "\[Rule]", "0.16"}], ",", + RowBox[{"pf", "\[Rule]", + RowBox[{"-", "0.413927"}]}], ",", + RowBox[{"vf", "\[Rule]", "0"}], ",", + RowBox[{"vMax", "\[Rule]", "4.51627"}], ",", + RowBox[{"aMax", "\[Rule]", "0.844162"}], ",", + RowBox[{"jMax", "\[Rule]", "0.219483"}]}], "}"}]}], "]"}]], "Input", + CellChangeTimes->{{3.815742460786963*^9, 3.815742531691359*^9}}, + CellLabel-> + "In[376]:=",ExpressionUUID->"955a5b3f-9dc7-495c-a7ca-c9e014c5911a"], + +Cell["\<\ +{t1 -> 2.6796174951900813, t2 -> 0, t3 -> 2.679617495190081, t4 -> 0, t5 -> \ +1.6560894920813294, + t6 -> 0, t7 -> 1.6560894920813294}\ +\>", "Output", + CellChangeTimes->{{3.815742461191976*^9, 3.815742472697131*^9}, { + 3.8157425249631853`*^9, 3.815742532002203*^9}}, + CellLabel-> + "Out[376]//InputForm=",ExpressionUUID->"9ae71f1f-c27a-42d4-875f-\ +68090daded79"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"toCCode", "[", + RowBox[{"resultT", ",", "7", ",", "7", ",", "2"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->CompressedData[" +1:eJxTTMoPSmViYGAQB2IQff42i+6yrDeObUplBiBap4g7HUR3/VecDKIdlC/f +PQ6kv0wpvAei26enPgPR+9IzwbRwwYvXIPqO3fY3INphuY76CSD9KYdPB0QH ++8y8ejj7jWOSW8RjMN2y/wuI9vV+A6a/TE5kOgKkUxP0mEG0K1NXPIg+LXQD +TFt1Xi4E0ZUvIstAdGzu41oQrXbKrg5Ef92t5vkKSLecyvYD0VopfFkgWntR +XC6IbpiQfedjzhvHE8sKHoNoJhuh9yA63/rFJxD9bO/uHyA6bva3vyD6XMhe +nk9A+rpjGy+Itou/LAmiV+zeIQuihfb2aIDotIm3wbTT7TxPED3n7s8AEH2+ +9Vm7eu4bxxsNHB0g2rhLcwKIrlmjC6YBfdLLOg== + "], + CellLabel-> + "In[109]:=",ExpressionUUID->"ee2d0080-8083-421d-84f9-5778554cf350"], + +Cell[BoxData["$Aborted"], "Output", + CellChangeTimes->{{3.814011238140484*^9, 3.81401126826544*^9}, { + 3.8140117089879217`*^9, 3.814012057459238*^9}, {3.814080241495626*^9, + 3.814080307646434*^9}, {3.814080351781898*^9, 3.8140803584587593`*^9}, + 3.8140807486411047`*^9, {3.814080825907345*^9, 3.814080864890435*^9}, { + 3.8145962644916973`*^9, 3.81459637905472*^9}, {3.814596627576436*^9, + 3.8145966338333473`*^9}, 3.814597375057281*^9, {3.8145975190346823`*^9, + 3.8145975551858683`*^9}, 3.814597627898073*^9, {3.814675019741214*^9, + 3.8146750597926207`*^9}, {3.8146752780010347`*^9, 3.814675307571794*^9}, { + 3.815214820208681*^9, 3.8152148758393383`*^9}, {3.815214973605174*^9, + 3.815214999487235*^9}, {3.815215046848257*^9, 3.81521508809697*^9}, { + 3.815215203623413*^9, 3.815215212645095*^9}, 3.8152152549971313`*^9, { + 3.815215311069622*^9, 3.815215342029181*^9}, {3.815215428743206*^9, + 3.81521543132932*^9}, {3.815215695895108*^9, 3.815215752115509*^9}, + 3.8153247370140867`*^9, 3.8153248021360683`*^9, 3.815324861811455*^9}, + CellLabel-> + "Out[109]=",ExpressionUUID->"91a6267d-acc2-4b80-bf23-1a8d53d5900c"] +}, Open ]], + +Cell["Simplify Cased 6-8", "Text", + CellChangeTimes->{{3.814675426091942*^9, + 3.8146754297635508`*^9}},ExpressionUUID->"b48157a9-54ec-478e-9180-\ +6dc7afbc31e8"], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"re6h1", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"5", " ", + SuperscriptBox["a0", "2"]}], "+", + RowBox[{"6", " ", "a0", " ", "aMax"}], "+", + SuperscriptBox["aMax", "2"], "+", + RowBox[{"2", " ", "jMax", " ", "v0"}]}], "\[Rule]", "h1"}], ",", + RowBox[{ + RowBox[{ + RowBox[{"5", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"]}], "+", + RowBox[{"6", " ", "a0", " ", "aMax", " ", + SuperscriptBox["jMax", "2"]}], "+", + RowBox[{ + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "2"]}], "+", + RowBox[{"2", " ", + SuperscriptBox["jMax", "3"], " ", "v0"}]}], "\[Rule]", + RowBox[{"h1", " ", + SuperscriptBox["jMax", "2"]}]}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re6h2", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "a0"}], "+", "aMax"}], ")"}], "\[Rule]", "h2"}], + ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "a0", " ", + SuperscriptBox["jMax", "3"]}], "+", + RowBox[{"aMax", " ", + SuperscriptBox["jMax", "3"]}]}], ")"}], "\[Rule]", + RowBox[{"h2", " ", + SuperscriptBox["jMax", "3"]}]}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re6h3", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"3", " ", + SuperscriptBox["a0", "4"]}], "+", + RowBox[{"8", " ", + SuperscriptBox["a0", "3"], " ", "aMax"}], "+", + RowBox[{"6", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["aMax", "2"]}], "+", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "2"], " ", "p0"}], "-", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "2"], " ", "pf"}], "+", + RowBox[{"12", " ", + SuperscriptBox["a0", "2"], " ", "jMax", " ", "v0"}], "+", + RowBox[{"24", " ", "a0", " ", "aMax", " ", "jMax", " ", "v0"}], "+", + RowBox[{"12", " ", + SuperscriptBox["aMax", "2"], " ", "jMax", " ", "v0"}], "+", + RowBox[{"12", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"12", " ", + SuperscriptBox["aMax", "2"], " ", "jMax", " ", "vf"}], "-", + RowBox[{"12", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], "\[Rule]", "h3"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re6h4", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + SuperscriptBox["a0", "3"], "+", + RowBox[{"2", " ", + SuperscriptBox["a0", "2"], " ", "aMax"}], "+", + RowBox[{"a0", " ", + SuperscriptBox["aMax", "2"]}], "+", + RowBox[{"2", " ", "a0", " ", "jMax", " ", "v0"}], "+", + RowBox[{"2", " ", "aMax", " ", "jMax", " ", "v0"}]}], ")"}], + "\[Rule]", "h4"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + SuperscriptBox["a0", "3"], " ", "jMax"}], "+", + RowBox[{"2", " ", + SuperscriptBox["a0", "2"], " ", "aMax", " ", "jMax"}], "+", + RowBox[{"a0", " ", + SuperscriptBox["aMax", "2"], " ", "jMax"}], "+", + RowBox[{"2", " ", "a0", " ", + SuperscriptBox["jMax", "2"], " ", "v0"}], "+", + RowBox[{"2", " ", "aMax", " ", + SuperscriptBox["jMax", "2"], " ", "v0"}]}], ")"}], "\[Rule]", + RowBox[{"h4", " ", "jMax"}]}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re6h5", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"4", " ", + SuperscriptBox["a0", "4"]}], "+", + RowBox[{"8", " ", + SuperscriptBox["a0", "3"], " ", "aMax"}], " ", "+", + RowBox[{"4", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["aMax", "2"]}], "+", + SuperscriptBox["aMax", "4"], "+", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "2"], " ", "p0"}], "-", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "2"], " ", "pf"}], "-", + RowBox[{"16", " ", + SuperscriptBox["a0", "2"], " ", "jMax", " ", "v0"}], "-", + RowBox[{"24", " ", "a0", " ", "aMax", " ", "jMax", " ", "v0"}], "-", + RowBox[{"8", " ", + SuperscriptBox["aMax", "2"], " ", "jMax", " ", "v0"}], "+", + RowBox[{"16", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"12", " ", + SuperscriptBox["aMax", "2"], " ", "jMax", " ", "vf"}], "-", + RowBox[{"12", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], "\[Rule]", "h5"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"4", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"8", " ", + SuperscriptBox["a0", "3"], " ", "aMax", " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"4", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{ + SuperscriptBox["aMax", "4"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "p0"}], "-", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "pf"}], "-", + RowBox[{"16", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "-", + RowBox[{"24", " ", "a0", " ", "aMax", " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "-", + RowBox[{"8", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "+", + RowBox[{"16", " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"12", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "vf"}], "-", + RowBox[{"12", " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], "\[Rule]", + RowBox[{"h5", " ", + SuperscriptBox["jMax", "4"]}]}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"576", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"1152", " ", + SuperscriptBox["a0", "3"], " ", "aMax", " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"576", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"144", " ", + SuperscriptBox["aMax", "4"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"3456", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "p0"}], "-", + RowBox[{"3456", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "pf"}], "-", + RowBox[{"2304", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "-", + RowBox[{"3456", " ", "a0", " ", "aMax", " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "-", + RowBox[{"1152", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "+", + RowBox[{"2304", " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"1728", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "vf"}], "-", + RowBox[{"1728", " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], "\[Rule]", + RowBox[{"144", "h5", " ", + SuperscriptBox["jMax", "4"]}]}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re6h6", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"3456", " ", + SuperscriptBox["h1", "3"]}], " ", "-", + RowBox[{"10368", " ", "h1", " ", "h3"}], " ", "+", + RowBox[{"15552", " ", + SuperscriptBox["h2", "2"], " ", "h3"}], " ", "-", + RowBox[{"62208", " ", "h1", " ", "h2", " ", "h4"}], " ", "+", + RowBox[{"186624", " ", + SuperscriptBox["h4", "2"]}]}], "\[Rule]", "h6"}], ",", + RowBox[{ + RowBox[{ + RowBox[{"3456", " ", + SuperscriptBox["h1", "3"], " ", + SuperscriptBox["jMax", "6"]}], "-", + RowBox[{"10368", " ", "h1", " ", "h3", " ", + SuperscriptBox["jMax", "6"]}], "+", + RowBox[{"15552", " ", + SuperscriptBox["h2", "2"], " ", "h3", " ", + SuperscriptBox["jMax", "6"]}], "-", + RowBox[{"62208", " ", "h1", " ", "h2", " ", "h4", " ", + SuperscriptBox["jMax", "6"]}], "+", + RowBox[{"186624", " ", + SuperscriptBox["h4", "2"], " ", + SuperscriptBox["jMax", "6"]}]}], "\[Rule]", + RowBox[{"h6", " ", + SuperscriptBox["jMax", "6"]}]}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re6h7", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{ + RowBox[{"h6", " ", + SuperscriptBox["jMax", "6"]}], "+", + SqrtBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "11943936"}], " ", + SuperscriptBox["h5", "3"], " ", + SuperscriptBox["jMax", "12"]}], "+", + RowBox[{ + SuperscriptBox["h6", "2"], " ", + SuperscriptBox["jMax", "12"]}]}]]}], ")"}], + RowBox[{"1", "/", "3"}]], "\[Rule]", "h7"}], ",", + RowBox[{ + FractionBox["1", + SuperscriptBox[ + RowBox[{"(", + RowBox[{ + RowBox[{"h6", " ", + SuperscriptBox["jMax", "6"]}], "+", + SqrtBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "11943936"}], " ", + SuperscriptBox["h5", "3"], " ", + SuperscriptBox["jMax", "12"]}], "+", + RowBox[{ + SuperscriptBox["h6", "2"], " ", + SuperscriptBox["jMax", "12"]}]}]]}], ")"}], + RowBox[{"1", "/", "3"}]]], "\[Rule]", + FractionBox["1", "h7"]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re6h8", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + SqrtBox[ + RowBox[{ + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h5"}], "h7"], "+", + FractionBox["h7", + RowBox[{"36", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "4"]}]], "-", + FractionBox[ + RowBox[{"2", " ", "h1"}], + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"]}]], "+", + FractionBox[ + SuperscriptBox["h2", "2"], + SuperscriptBox["jMax", "2"]]}]], "\[Rule]", "h8"}], ",", + RowBox[{ + FractionBox["1", + SqrtBox[ + RowBox[{ + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h5"}], "h7"], "+", + FractionBox["h7", + RowBox[{"36", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "4"]}]], "-", + FractionBox[ + RowBox[{"2", " ", "h1"}], + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"]}]], "+", + FractionBox[ + SuperscriptBox["h2", "2"], + SuperscriptBox["jMax", "2"]]}]]], "\[Rule]", + FractionBox["1", "h8"]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re6h9", "=", + RowBox[{"{", + RowBox[{ + SqrtBox[ + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h5"}], "h7"]}], "-", + FractionBox[ + RowBox[{ + FractionBox[ + RowBox[{"8", " ", "h1", " ", "h2"}], + SuperscriptBox["jMax", "3"]], "-", + FractionBox[ + RowBox[{"8", " ", + SuperscriptBox["h2", "3"]}], + SuperscriptBox["jMax", "3"]], "-", + FractionBox[ + RowBox[{"16", " ", "h4"}], + SuperscriptBox["jMax", "3"]]}], + RowBox[{"4", " ", "h8"}]], "-", + FractionBox["h7", + RowBox[{"36", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "4"]}]], "-", + FractionBox[ + RowBox[{"4", " ", "h1"}], + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"]}]], "+", + FractionBox[ + RowBox[{"2", " ", + SuperscriptBox["h2", "2"]}], + SuperscriptBox["jMax", "2"]]}]], "\[Rule]", "h9"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"re6h10", "=", + RowBox[{"{", + RowBox[{ + SqrtBox[ + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h5"}], "h7"]}], "+", + FractionBox[ + RowBox[{ + FractionBox[ + RowBox[{"8", " ", "h1", " ", "h2"}], + SuperscriptBox["jMax", "3"]], "-", + FractionBox[ + RowBox[{"8", " ", + SuperscriptBox["h2", "3"]}], + SuperscriptBox["jMax", "3"]], "-", + FractionBox[ + RowBox[{"16", " ", "h4"}], + SuperscriptBox["jMax", "3"]]}], + RowBox[{"4", " ", "h8"}]], "-", + FractionBox["h7", + RowBox[{"36", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "4"]}]], "-", + FractionBox[ + RowBox[{"4", " ", "h1"}], + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"]}]], "+", + FractionBox[ + RowBox[{"2", " ", + SuperscriptBox["h2", "2"]}], + SuperscriptBox["jMax", "2"]]}]], "\[Rule]", "h10"}], "}"}]}], ";"}], + "\[IndentingNewLine]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re7h1", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{ + SuperscriptBox["aMax", "2"], "+", + RowBox[{"2", " ", "jMax", " ", "vf"}]}], "\[Rule]", "h1"}], ",", + RowBox[{ + RowBox[{ + RowBox[{ + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "2"]}], "+", + RowBox[{"2", " ", + SuperscriptBox["jMax", "3"], " ", "vf"}]}], "\[Rule]", + RowBox[{"h1", " ", + SuperscriptBox["jMax", "2"]}]}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re7h2", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"3", " ", + SuperscriptBox["a0", "4"]}], "-", + RowBox[{"8", " ", + SuperscriptBox["a0", "3"], " ", "aMax"}], "+", + RowBox[{"6", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["aMax", "2"]}], "-", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "2"], " ", "p0"}], "+", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "2"], " ", "pf"}], "-", + RowBox[{"12", " ", + SuperscriptBox["a0", "2"], " ", "jMax", " ", "v0"}], "+", + RowBox[{"24", " ", "a0", " ", "aMax", " ", "jMax", " ", "v0"}], "-", + RowBox[{"12", " ", + SuperscriptBox["aMax", "2"], " ", "jMax", " ", "v0"}], "+", + RowBox[{"12", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["v0", "2"]}], "-", + RowBox[{"12", " ", + SuperscriptBox["aMax", "2"], " ", "jMax", " ", "vf"}], "-", + RowBox[{"12", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], "\[Rule]", "h2"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re7h3", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "3"}], " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"8", " ", + SuperscriptBox["a0", "3"], " ", "aMax", " ", + SuperscriptBox["jMax", "4"]}], "-", + RowBox[{"6", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{ + SuperscriptBox["aMax", "4"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "p0"}], "-", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "pf"}], "+", + RowBox[{"12", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "-", + RowBox[{"24", " ", "a0", " ", "aMax", " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "+", + RowBox[{"12", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "-", + RowBox[{"12", " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["v0", "2"]}], "-", + RowBox[{"8", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "vf"}], "+", + RowBox[{"16", " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], "\[Rule]", "h3"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "432"}], " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"1152", " ", + SuperscriptBox["a0", "3"], " ", "aMax", " ", + SuperscriptBox["jMax", "4"]}], "-", + RowBox[{"864", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"144", " ", + SuperscriptBox["aMax", "4"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"3456", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "p0"}], "-", + RowBox[{"3456", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "pf"}], "+", + RowBox[{"1728", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "-", + RowBox[{"3456", " ", "a0", " ", "aMax", " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "+", + RowBox[{"1728", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "-", + RowBox[{"1728", " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["v0", "2"]}], "-", + RowBox[{"1152", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "vf"}], "+", + RowBox[{"2304", " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], "\[Rule]", + RowBox[{"144", " ", "h3"}]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re7h4", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "3456"}], " ", + SuperscriptBox["h1", "3"], " ", + SuperscriptBox["jMax", "6"]}], "+", + RowBox[{"15552", " ", + SuperscriptBox["aMax", "2"], " ", "h2", " ", + SuperscriptBox["jMax", "6"]}], "-", + RowBox[{"10368", " ", "h1", " ", "h2", " ", + SuperscriptBox["jMax", "6"]}], "+", + RowBox[{"124416", " ", + SuperscriptBox["aMax", "2"], " ", "h1", " ", + SuperscriptBox["jMax", "7"], " ", "vf"}], "-", + RowBox[{"746496", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "8"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], "\[Rule]", "h4"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re7h5", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"h4", "+", + SqrtBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "11943936"}], " ", + SuperscriptBox["h3", "3"]}], "+", + SuperscriptBox["h4", "2"]}]]}], ")"}], + RowBox[{"1", "/", "3"}]], "\[Rule]", "h5"}], ",", + RowBox[{ + FractionBox["1", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"h4", "+", + SqrtBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "11943936"}], " ", + SuperscriptBox["h3", "3"]}], "+", + SuperscriptBox["h4", "2"]}]]}], ")"}], + RowBox[{"1", "/", "3"}]]], "\[Rule]", + FractionBox["1", "h5"]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re7h6", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + SqrtBox[ + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h3"}], + RowBox[{"h5", " ", + SuperscriptBox["jMax", "4"]}]]}], "-", + FractionBox["h5", + RowBox[{"36", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox[ + SuperscriptBox["aMax", "2"], + SuperscriptBox["jMax", "2"]], "-", + FractionBox[ + RowBox[{"2", " ", "h1"}], + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"]}]]}]], "\[Rule]", "h6"}], ",", + RowBox[{ + FractionBox["1", + SqrtBox[ + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h3"}], + RowBox[{"h5", " ", + SuperscriptBox["jMax", "4"]}]]}], "-", + FractionBox["h5", + RowBox[{"36", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox[ + SuperscriptBox["aMax", "2"], + SuperscriptBox["jMax", "2"]], "-", + FractionBox[ + RowBox[{"2", " ", "h1"}], + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"]}]]}]]], "\[Rule]", + FractionBox["1", "h6"]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re7h7", "=", + RowBox[{"{", + RowBox[{ + SqrtBox[ + RowBox[{ + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h3"}], + RowBox[{"h5", " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox["h5", + RowBox[{"36", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox[ + RowBox[{"2", " ", + SuperscriptBox["aMax", "2"]}], + SuperscriptBox["jMax", "2"]], "-", + FractionBox[ + RowBox[{"4", " ", "h1"}], + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"]}]], "-", + FractionBox[ + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{"8", " ", + SuperscriptBox["aMax", "3"]}], + SuperscriptBox["jMax", "3"]]}], "+", + FractionBox[ + RowBox[{"8", " ", "aMax", " ", "h1"}], + SuperscriptBox["jMax", "3"]], "-", + FractionBox[ + RowBox[{"32", " ", "aMax", " ", "vf"}], + SuperscriptBox["jMax", "2"]]}], + RowBox[{"4", " ", "h6"}]]}]], "\[Rule]", "h7"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"re7h8", "=", + RowBox[{"{", + RowBox[{ + SqrtBox[ + RowBox[{ + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h3"}], + RowBox[{"h5", " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox["h5", + RowBox[{"36", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox[ + RowBox[{"2", " ", + SuperscriptBox["aMax", "2"]}], + SuperscriptBox["jMax", "2"]], "-", + FractionBox[ + RowBox[{"4", " ", "h1"}], + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"]}]], "+", + FractionBox[ + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{"8", " ", + SuperscriptBox["aMax", "3"]}], + SuperscriptBox["jMax", "3"]]}], "+", + FractionBox[ + RowBox[{"8", " ", "aMax", " ", "h1"}], + SuperscriptBox["jMax", "3"]], "-", + FractionBox[ + RowBox[{"32", " ", "aMax", " ", "vf"}], + SuperscriptBox["jMax", "2"]]}], + RowBox[{"4", " ", "h6"}]]}]], "\[Rule]", "h8"}], "}"}]}], ";"}], + "\[IndentingNewLine]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h1", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"2", " ", + SuperscriptBox["a0", "3"]}], "-", + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"], " ", "p0"}], "+", + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"], " ", "pf"}], "-", + RowBox[{"3", " ", "a0", " ", "jMax", " ", "v0"}], "+", + RowBox[{"6", " ", "a0", " ", "jMax", " ", "vf"}]}], "\[Rule]", "h1"}], + ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "3"]}], "-", + RowBox[{"3", " ", + SuperscriptBox["jMax", "5"], " ", "p0"}], "+", + RowBox[{"3", " ", + SuperscriptBox["jMax", "5"], " ", "pf"}], "-", + RowBox[{"3", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "v0"}], "+", + RowBox[{"6", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "vf"}]}], ")"}], "\[Rule]", + RowBox[{"h1", " ", + SuperscriptBox["jMax", "3"]}]}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h2", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}], "+", + RowBox[{"2", " ", "jMax", " ", "vf"}]}], ")"}], "\[Rule]", "h2"}], + ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "4"]}], "-", + RowBox[{"2", " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "+", + RowBox[{"2", " ", + SuperscriptBox["jMax", "5"], " ", "vf"}]}], ")"}], "\[Rule]", + RowBox[{"h2", " ", + SuperscriptBox["jMax", "4"]}]}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h3", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + SuperscriptBox["a0", "5"], "-", + RowBox[{"24", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", "p0"}], "+", + RowBox[{"24", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", "pf"}], "+", + RowBox[{"4", " ", + SuperscriptBox["a0", "3"], " ", "jMax", " ", "v0"}], "-", + RowBox[{"24", " ", + SuperscriptBox["jMax", "3"], " ", "p0", " ", "v0"}], "+", + RowBox[{"24", " ", + SuperscriptBox["jMax", "3"], " ", "pf", " ", "v0"}], "+", + RowBox[{"12", " ", "a0", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"12", " ", + SuperscriptBox["a0", "3"], " ", "jMax", " ", "vf"}], "+", + RowBox[{"24", " ", "a0", " ", + SuperscriptBox["jMax", "2"], " ", "v0", " ", "vf"}], "-", + RowBox[{"12", " ", "a0", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], "\[Rule]", "h3"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + SuperscriptBox["a0", "5"], " ", "jMax"}], "-", + RowBox[{"24", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "p0"}], "+", + RowBox[{"24", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "pf"}], "+", + RowBox[{"4", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", "v0"}], "-", + RowBox[{"24", " ", + SuperscriptBox["jMax", "4"], " ", "p0", " ", "v0"}], "+", + RowBox[{"24", " ", + SuperscriptBox["jMax", "4"], " ", "pf", " ", "v0"}], "+", + RowBox[{"12", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"12", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", "vf"}], "+", + RowBox[{"24", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", "v0", " ", "vf"}], "-", + RowBox[{"12", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], "\[Rule]", + RowBox[{"h3", " ", "jMax"}]}], ",", + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{ + RowBox[{ + SuperscriptBox["a0", "5"], " ", "jMax"}], "-", + RowBox[{"24", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "p0"}], "+", + RowBox[{"24", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "pf"}], "+", + RowBox[{"4", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", "v0"}], "-", + RowBox[{"24", " ", + SuperscriptBox["jMax", "4"], " ", "p0", " ", "v0"}], "+", + RowBox[{"24", " ", + SuperscriptBox["jMax", "4"], " ", "pf", " ", "v0"}], "+", + RowBox[{"12", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"12", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", "vf"}], "+", + RowBox[{"24", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", "v0", " ", "vf"}], "-", + RowBox[{"12", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], "2"], "\[Rule]", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"h3", " ", "jMax"}], ")"}], "2"]}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h4", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"3", " ", + SuperscriptBox["a0", "4"]}], "-", + RowBox[{"24", " ", "a0", " ", + SuperscriptBox["jMax", "2"], " ", "p0"}], "+", + RowBox[{"24", " ", "a0", " ", + SuperscriptBox["jMax", "2"], " ", "pf"}], "+", + RowBox[{"4", " ", + SuperscriptBox["a0", "2"], " ", "jMax", " ", "v0"}], "-", + RowBox[{"4", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"20", " ", + SuperscriptBox["a0", "2"], " ", "jMax", " ", "vf"}], "+", + RowBox[{"8", " ", + SuperscriptBox["jMax", "2"], " ", "v0", " ", "vf"}], "-", + RowBox[{"4", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["vf", "2"]}]}], "\[Rule]", "h4"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"3", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "2"]}], "-", + RowBox[{"24", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "p0"}], "+", + RowBox[{"24", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "pf"}], "+", + RowBox[{"4", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "v0"}], "-", + RowBox[{"4", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"20", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "vf"}], "+", + RowBox[{"8", " ", + SuperscriptBox["jMax", "4"], " ", "v0", " ", "vf"}], "-", + RowBox[{"4", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], "\[Rule]", + RowBox[{"h4", " ", + SuperscriptBox["jMax", "2"]}]}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h5", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + SuperscriptBox["a0", "6"], "-", + RowBox[{"48", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", "p0"}], "-", + RowBox[{"72", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["p0", "2"]}], "+", + RowBox[{"48", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", "pf"}], "+", + RowBox[{"144", " ", + SuperscriptBox["jMax", "4"], " ", "p0", " ", "pf"}], "-", + RowBox[{"72", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["pf", "2"]}], "+", + RowBox[{"6", " ", + SuperscriptBox["a0", "4"], " ", "jMax", " ", "v0"}], "-", + RowBox[{"144", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", "p0", " ", "v0"}], "+", + RowBox[{"144", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", "pf", " ", "v0"}], "+", + RowBox[{"36", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"72", " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["v0", "3"]}], "+", + RowBox[{"18", " ", + SuperscriptBox["a0", "4"], " ", "jMax", " ", "vf"}], "+", + RowBox[{"72", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", "v0", " ", "vf"}], "+", + RowBox[{"72", " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["v0", "2"], " ", "vf"}], "-", + RowBox[{"36", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["vf", "2"]}], "-", + RowBox[{"72", " ", + SuperscriptBox["jMax", "3"], " ", "v0", " ", + SuperscriptBox["vf", "2"]}], "-", + RowBox[{"72", " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["vf", "3"]}]}], ")"}], "\[Rule]", "h5"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h17", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", + SuperscriptBox["a0", "6"]}], " ", "jMax"}], "+", + RowBox[{"48", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "3"], " ", "p0"}], "+", + RowBox[{"72", " ", + SuperscriptBox["jMax", "5"], " ", + SuperscriptBox["p0", "2"]}], "-", + RowBox[{"48", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "3"], " ", "pf"}], "-", + RowBox[{"144", " ", + SuperscriptBox["jMax", "5"], " ", "p0", " ", "pf"}], "+", + RowBox[{"72", " ", + SuperscriptBox["jMax", "5"], " ", + SuperscriptBox["pf", "2"]}], "+", + RowBox[{"6", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "2"], " ", "v0"}], "-", + RowBox[{"144", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "p0", " ", "v0"}], "+", + RowBox[{"144", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "pf", " ", "v0"}], "-", + RowBox[{"36", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"72", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["v0", "3"]}], "-", + RowBox[{"18", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "2"], " ", "vf"}], "+", + RowBox[{"72", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "v0", " ", "vf"}], "-", + RowBox[{"72", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["v0", "2"], " ", "vf"}], "+", + RowBox[{"36", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["vf", "2"]}], "-", + RowBox[{"72", " ", + SuperscriptBox["jMax", "4"], " ", "v0", " ", + SuperscriptBox["vf", "2"]}], "+", + RowBox[{"72", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["vf", "3"]}]}], ")"}], "\[Rule]", "h17"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h6", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", + SuperscriptBox["a0", "8"]}], "+", + RowBox[{"192", " ", + SuperscriptBox["a0", "5"], " ", + SuperscriptBox["jMax", "2"], " ", "p0"}], "+", + RowBox[{"288", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["p0", "2"]}], "-", + RowBox[{"192", " ", + SuperscriptBox["a0", "5"], " ", + SuperscriptBox["jMax", "2"], " ", "pf"}], "-", + RowBox[{"576", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "4"], " ", "p0", " ", "pf"}], "+", + RowBox[{"288", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["pf", "2"]}], "+", + RowBox[{"8", " ", + SuperscriptBox["a0", "6"], " ", "jMax", " ", "v0"}], "-", + RowBox[{"960", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "3"], " ", "p0", " ", "v0"}], "-", + RowBox[{"576", " ", + SuperscriptBox["jMax", "5"], " ", + SuperscriptBox["p0", "2"], " ", "v0"}], "+", + RowBox[{"960", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "3"], " ", "pf", " ", "v0"}], "+", + RowBox[{"1152", " ", + SuperscriptBox["jMax", "5"], " ", "p0", " ", "pf", " ", "v0"}], "-", + + RowBox[{"576", " ", + SuperscriptBox["jMax", "5"], " ", + SuperscriptBox["pf", "2"], " ", "v0"}], "-", + RowBox[{"120", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"1152", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "p0", " ", + SuperscriptBox["v0", "2"]}], "-", + RowBox[{"1152", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "pf", " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"480", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["v0", "3"]}], "-", + RowBox[{"528", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["v0", "4"]}], "-", + RowBox[{"40", " ", + SuperscriptBox["a0", "6"], " ", "jMax", " ", "vf"}], "-", + RowBox[{"384", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "3"], " ", "p0", " ", "vf"}], "-", + RowBox[{"576", " ", + SuperscriptBox["jMax", "5"], " ", + SuperscriptBox["p0", "2"], " ", "vf"}], "+", + RowBox[{"384", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "3"], " ", "pf", " ", "vf"}], "+", + RowBox[{"1152", " ", + SuperscriptBox["jMax", "5"], " ", "p0", " ", "pf", " ", "vf"}], "-", + + RowBox[{"576", " ", + SuperscriptBox["jMax", "5"], " ", + SuperscriptBox["pf", "2"], " ", "vf"}], "+", + RowBox[{"240", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "2"], " ", "v0", " ", "vf"}], "+", + RowBox[{"1152", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "p0", " ", "v0", " ", "vf"}], "-", + + RowBox[{"1152", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "pf", " ", "v0", " ", "vf"}], "-", + + RowBox[{"288", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["v0", "2"], " ", "vf"}], "-", + RowBox[{"192", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["v0", "3"], " ", "vf"}], "+", + RowBox[{"360", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["vf", "2"]}], "-", + RowBox[{"1440", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "v0", " ", + SuperscriptBox["vf", "2"]}], "+", + RowBox[{"1440", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["v0", "2"], " ", + SuperscriptBox["vf", "2"]}], "+", + RowBox[{"96", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["vf", "3"]}], "-", + RowBox[{"192", " ", + SuperscriptBox["jMax", "4"], " ", "v0", " ", + SuperscriptBox["vf", "3"]}], "-", + RowBox[{"528", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["vf", "4"]}]}], ")"}], "\[Rule]", "h6"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", + SuperscriptBox["a0", "8"]}], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"192", " ", + SuperscriptBox["a0", "5"], " ", + SuperscriptBox["jMax", "6"], " ", "p0"}], "+", + RowBox[{"288", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "8"], " ", + SuperscriptBox["p0", "2"]}], "-", + RowBox[{"192", " ", + SuperscriptBox["a0", "5"], " ", + SuperscriptBox["jMax", "6"], " ", "pf"}], "-", + RowBox[{"576", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "8"], " ", "p0", " ", "pf"}], "+", + RowBox[{"288", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "8"], " ", + SuperscriptBox["pf", "2"]}], "+", + RowBox[{"8", " ", + SuperscriptBox["a0", "6"], " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "-", + RowBox[{"960", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "7"], " ", "p0", " ", "v0"}], "-", + RowBox[{"576", " ", + SuperscriptBox["jMax", "9"], " ", + SuperscriptBox["p0", "2"], " ", "v0"}], "+", + RowBox[{"960", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "7"], " ", "pf", " ", "v0"}], "+", + RowBox[{"1152", " ", + SuperscriptBox["jMax", "9"], " ", "p0", " ", "pf", " ", "v0"}], "-", + + RowBox[{"576", " ", + SuperscriptBox["jMax", "9"], " ", + SuperscriptBox["pf", "2"], " ", "v0"}], "-", + RowBox[{"120", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"1152", " ", "a0", " ", + SuperscriptBox["jMax", "8"], " ", "p0", " ", + SuperscriptBox["v0", "2"]}], "-", + RowBox[{"1152", " ", "a0", " ", + SuperscriptBox["jMax", "8"], " ", "pf", " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"480", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "7"], " ", + SuperscriptBox["v0", "3"]}], "-", + RowBox[{"528", " ", + SuperscriptBox["jMax", "8"], " ", + SuperscriptBox["v0", "4"]}], "-", + RowBox[{"40", " ", + SuperscriptBox["a0", "6"], " ", + SuperscriptBox["jMax", "5"], " ", "vf"}], "-", + RowBox[{"384", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "7"], " ", "p0", " ", "vf"}], "-", + RowBox[{"576", " ", + SuperscriptBox["jMax", "9"], " ", + SuperscriptBox["p0", "2"], " ", "vf"}], "+", + RowBox[{"384", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "7"], " ", "pf", " ", "vf"}], "+", + RowBox[{"1152", " ", + SuperscriptBox["jMax", "9"], " ", "p0", " ", "pf", " ", "vf"}], "-", + + RowBox[{"576", " ", + SuperscriptBox["jMax", "9"], " ", + SuperscriptBox["pf", "2"], " ", "vf"}], "+", + RowBox[{"240", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "6"], " ", "v0", " ", "vf"}], "+", + RowBox[{"1152", " ", "a0", " ", + SuperscriptBox["jMax", "8"], " ", "p0", " ", "v0", " ", "vf"}], "-", + + RowBox[{"1152", " ", "a0", " ", + SuperscriptBox["jMax", "8"], " ", "pf", " ", "v0", " ", "vf"}], "-", + + RowBox[{"288", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "7"], " ", + SuperscriptBox["v0", "2"], " ", "vf"}], "-", + RowBox[{"192", " ", + SuperscriptBox["jMax", "8"], " ", + SuperscriptBox["v0", "3"], " ", "vf"}], "+", + RowBox[{"360", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["vf", "2"]}], "-", + RowBox[{"1440", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "7"], " ", "v0", " ", + SuperscriptBox["vf", "2"]}], "+", + RowBox[{"1440", " ", + SuperscriptBox["jMax", "8"], " ", + SuperscriptBox["v0", "2"], " ", + SuperscriptBox["vf", "2"]}], "+", + RowBox[{"96", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "7"], " ", + SuperscriptBox["vf", "3"]}], "-", + RowBox[{"192", " ", + SuperscriptBox["jMax", "8"], " ", "v0", " ", + SuperscriptBox["vf", "3"]}], "-", + RowBox[{"528", " ", + SuperscriptBox["jMax", "8"], " ", + SuperscriptBox["vf", "4"]}]}], ")"}], "\[Rule]", + RowBox[{"h6", " ", + SuperscriptBox["jMax", "4"]}]}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "108"}], " ", + SuperscriptBox["a0", "8"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"20736", " ", + SuperscriptBox["a0", "5"], " ", + SuperscriptBox["jMax", "6"], " ", "p0"}], "+", + RowBox[{"31104", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "8"], " ", + SuperscriptBox["p0", "2"]}], "-", + RowBox[{"20736", " ", + SuperscriptBox["a0", "5"], " ", + SuperscriptBox["jMax", "6"], " ", "pf"}], "-", + RowBox[{"62208", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "8"], " ", "p0", " ", "pf"}], "+", + RowBox[{"31104", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "8"], " ", + SuperscriptBox["pf", "2"]}], "+", + RowBox[{"864", " ", + SuperscriptBox["a0", "6"], " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "-", + RowBox[{"103680", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "7"], " ", "p0", " ", "v0"}], "-", + RowBox[{"62208", " ", + SuperscriptBox["jMax", "9"], " ", + SuperscriptBox["p0", "2"], " ", "v0"}], "+", + RowBox[{"103680", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "7"], " ", "pf", " ", "v0"}], "+", + RowBox[{"124416", " ", + SuperscriptBox["jMax", "9"], " ", "p0", " ", "pf", " ", "v0"}], "-", + + RowBox[{"62208", " ", + SuperscriptBox["jMax", "9"], " ", + SuperscriptBox["pf", "2"], " ", "v0"}], "-", + RowBox[{"12960", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"124416", " ", "a0", " ", + SuperscriptBox["jMax", "8"], " ", "p0", " ", + SuperscriptBox["v0", "2"]}], "-", + RowBox[{"124416", " ", "a0", " ", + SuperscriptBox["jMax", "8"], " ", "pf", " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"51840", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "7"], " ", + SuperscriptBox["v0", "3"]}], "-", + RowBox[{"57024", " ", + SuperscriptBox["jMax", "8"], " ", + SuperscriptBox["v0", "4"]}], "-", + RowBox[{"4320", " ", + SuperscriptBox["a0", "6"], " ", + SuperscriptBox["jMax", "5"], " ", "vf"}], "-", + RowBox[{"41472", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "7"], " ", "p0", " ", "vf"}], "-", + RowBox[{"62208", " ", + SuperscriptBox["jMax", "9"], " ", + SuperscriptBox["p0", "2"], " ", "vf"}], "+", + RowBox[{"41472", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "7"], " ", "pf", " ", "vf"}], "+", + RowBox[{"124416", " ", + SuperscriptBox["jMax", "9"], " ", "p0", " ", "pf", " ", "vf"}], "-", + + RowBox[{"62208", " ", + SuperscriptBox["jMax", "9"], " ", + SuperscriptBox["pf", "2"], " ", "vf"}], "+", + RowBox[{"25920", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "6"], " ", "v0", " ", "vf"}], "+", + RowBox[{"124416", " ", "a0", " ", + SuperscriptBox["jMax", "8"], " ", "p0", " ", "v0", " ", "vf"}], "-", + + RowBox[{"124416", " ", "a0", " ", + SuperscriptBox["jMax", "8"], " ", "pf", " ", "v0", " ", "vf"}], "-", + + RowBox[{"31104", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "7"], " ", + SuperscriptBox["v0", "2"], " ", "vf"}], "-", + RowBox[{"20736", " ", + SuperscriptBox["jMax", "8"], " ", + SuperscriptBox["v0", "3"], " ", "vf"}], "+", + RowBox[{"38880", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["vf", "2"]}], "-", + RowBox[{"155520", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "7"], " ", "v0", " ", + SuperscriptBox["vf", "2"]}], "+", + RowBox[{"155520", " ", + SuperscriptBox["jMax", "8"], " ", + SuperscriptBox["v0", "2"], " ", + SuperscriptBox["vf", "2"]}], "+", + RowBox[{"10368", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "7"], " ", + SuperscriptBox["vf", "3"]}], "-", + RowBox[{"20736", " ", + SuperscriptBox["jMax", "8"], " ", "v0", " ", + SuperscriptBox["vf", "3"]}], "-", + RowBox[{"57024", " ", + SuperscriptBox["jMax", "8"], " ", + SuperscriptBox["vf", "4"]}]}], ")"}], "\[Rule]", + RowBox[{"108", "h6", " ", + SuperscriptBox["jMax", "4"]}]}]}], "\[IndentingNewLine]", "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h7", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"3", "*", + RowBox[{"(", + RowBox[{ + RowBox[{"36", "h2", " ", + SuperscriptBox["h3", "2"]}], "-", + RowBox[{"24", " ", "h1", " ", "h3", " ", "h4"}], " ", "+", + RowBox[{"3", " ", + SuperscriptBox["h4", "3"]}], "+", + RowBox[{"16", " ", + SuperscriptBox["h1", "2"], " ", "h5"}], "-", + RowBox[{"12", " ", "h2", " ", "h4", " ", "h5"}]}], " ", ")"}]}], + "\[Rule]", "h7"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"139968", " ", "h2", " ", + SuperscriptBox["h3", "2"]}], "-", + RowBox[{"93312", " ", "h1", " ", "h3", " ", "h4"}], " ", "+", + RowBox[{"11664", " ", + SuperscriptBox["h4", "3"]}], "+", + RowBox[{"62208", " ", + SuperscriptBox["h1", "2"], " ", "h5"}], "-", + RowBox[{"46656", " ", "h2", " ", "h4", " ", "h5"}]}], " ", ")"}], + "\[Rule]", + RowBox[{"1296", "h7"}]}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"139968", " ", "h2", " ", + SuperscriptBox["h3", "2"], " ", + SuperscriptBox["jMax", "6"]}], "-", + RowBox[{"93312", " ", "h1", " ", "h3", " ", "h4", " ", + SuperscriptBox["jMax", "6"]}], "+", + RowBox[{"11664", " ", + SuperscriptBox["h4", "3"], " ", + SuperscriptBox["jMax", "6"]}], "+", + RowBox[{"62208", " ", + SuperscriptBox["h1", "2"], " ", "h5", " ", + SuperscriptBox["jMax", "6"]}], "-", + RowBox[{"46656", " ", "h2", " ", "h4", " ", "h5", " ", + SuperscriptBox["jMax", "6"]}]}], ")"}], "\[Rule]", + RowBox[{"1296", "h7", " ", + SuperscriptBox["jMax", "6"]}]}], ",", + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{ + RowBox[{"139968", " ", "h2", " ", + SuperscriptBox["h3", "2"], " ", + SuperscriptBox["jMax", "6"]}], "-", + RowBox[{"93312", " ", "h1", " ", "h3", " ", "h4", " ", + SuperscriptBox["jMax", "6"]}], "+", + RowBox[{"11664", " ", + SuperscriptBox["h4", "3"], " ", + SuperscriptBox["jMax", "6"]}], "+", + RowBox[{"62208", " ", + SuperscriptBox["h1", "2"], " ", "h5", " ", + SuperscriptBox["jMax", "6"]}], "-", + RowBox[{"46656", " ", "h2", " ", "h4", " ", "h5", " ", + SuperscriptBox["jMax", "6"]}]}], ")"}], "2"], "\[Rule]", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"1296", "h7", " ", + SuperscriptBox["jMax", "6"]}], ")"}], "2"]}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h8", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{ + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["h1", "2"]}], + RowBox[{"9", " ", "h2"}]], "-", + FractionBox["h4", "3"]}], "\[Rule]", "h8"}], ",", + RowBox[{ + RowBox[{ + FractionBox[ + RowBox[{"8", " ", + SuperscriptBox["h1", "2"]}], + RowBox[{"9", " ", "h2"}]], "-", + FractionBox[ + RowBox[{"2", " ", "h4"}], "3"]}], "\[Rule]", + RowBox[{"2", "h8"}]}], ",", + RowBox[{ + RowBox[{ + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["h1", "2"]}], + RowBox[{"9", " ", + SuperscriptBox["h2", "2"], " ", + SuperscriptBox["jMax", "2"]}]], "-", + FractionBox["h4", + RowBox[{"3", " ", "h2", " ", + SuperscriptBox["jMax", "2"]}]]}], "\[Rule]", + FractionBox["h8", + RowBox[{"h2", " ", + SuperscriptBox["jMax", "2"]}]]}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h9", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{"16", " ", + SuperscriptBox["h1", "3"]}], + RowBox[{"27", " ", + SuperscriptBox["h2", "2"], " ", "jMax"}]]}], "+", + FractionBox[ + RowBox[{"2", " ", "h1", " ", "h4"}], + RowBox[{"3", " ", "h2", " ", "jMax"}]], "-", + FractionBox[ + RowBox[{"2", " ", "h3"}], + RowBox[{"3", " ", "jMax"}]]}], "\[Rule]", "h9"}], ",", + RowBox[{ + FractionBox[ + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{"64", " ", + SuperscriptBox["h1", "3"]}], + RowBox[{"27", " ", + SuperscriptBox["h2", "3"], " ", + SuperscriptBox["jMax", "3"]}]]}], "-", + FractionBox[ + RowBox[{"8", " ", "h3"}], + RowBox[{"3", " ", "h2", " ", + SuperscriptBox["jMax", "3"]}]], "+", + FractionBox[ + RowBox[{"8", " ", "h1", " ", "h4"}], + RowBox[{"3", " ", + SuperscriptBox["h2", "2"], " ", + SuperscriptBox["jMax", "3"]}]]}], "4"], "\[Rule]", + FractionBox["h9", + RowBox[{"4", "h2", " ", + SuperscriptBox["jMax", "2"]}]]}], ",", + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{"64", " ", + SuperscriptBox["h1", "3"]}], + RowBox[{"27", " ", + SuperscriptBox["h2", "3"], " ", + SuperscriptBox["jMax", "3"]}]]}], "-", + FractionBox[ + RowBox[{"8", " ", "h3"}], + RowBox[{"3", " ", "h2", " ", + SuperscriptBox["jMax", "3"]}]], "+", + FractionBox[ + RowBox[{"8", " ", "h1", " ", "h4"}], + RowBox[{"3", " ", + SuperscriptBox["h2", "2"], " ", + SuperscriptBox["jMax", "3"]}]]}], "4"]}], "\[Rule]", + RowBox[{"-", + FractionBox["h9", + RowBox[{"4", "h2", " ", + SuperscriptBox["jMax", "2"]}]]}]}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h82", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{"64", " ", + SuperscriptBox["h1", "3"]}], + RowBox[{"27", " ", + SuperscriptBox["h2", "3"], " ", + SuperscriptBox["jMax", "3"]}]]}], "-", + FractionBox[ + RowBox[{"8", " ", "h3"}], + RowBox[{"3", " ", "h2", " ", + SuperscriptBox["jMax", "3"]}]], "+", + FractionBox[ + RowBox[{"8", " ", "h1", " ", "h4"}], + RowBox[{"3", " ", + SuperscriptBox["h2", "2"], " ", + SuperscriptBox["jMax", "3"]}]]}], "\[Rule]", " ", + FractionBox["h9", + RowBox[{"h2", " ", + SuperscriptBox["jMax", "2"]}]]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h10", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"3", " ", + RowBox[{"(", + RowBox[{"h7", "+", + SqrtBox[ + RowBox[{ + SuperscriptBox["h7", "2"], "-", + RowBox[{"3", + SuperscriptBox["h6", "3"]}]}]]}], ")"}]}], ")"}], + RowBox[{"1", "/", "3"}]], "\[Rule]", "h10"}], ",", + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{ + RowBox[{"1296", " ", "h7", " ", + SuperscriptBox["jMax", "6"]}], "+", + SqrtBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "5038848"}], " ", + SuperscriptBox["h6", "3"], " ", + SuperscriptBox["jMax", "12"]}], "+", + RowBox[{"1679616", " ", + SuperscriptBox["h7", "2"], " ", + SuperscriptBox["jMax", "12"]}]}]]}], ")"}], + RowBox[{"1", "/", "3"}]], "\[Rule]", + RowBox[{ + SuperscriptBox["jMax", "2"], "h10"}]}], ",", + RowBox[{ + FractionBox["1", + SuperscriptBox[ + RowBox[{"(", + RowBox[{ + RowBox[{"1296", " ", "h7", " ", + SuperscriptBox["jMax", "6"]}], "+", + SqrtBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "5038848"}], " ", + SuperscriptBox["h6", "3"], " ", + SuperscriptBox["jMax", "12"]}], "+", + RowBox[{"1679616", " ", + SuperscriptBox["h7", "2"], " ", + SuperscriptBox["jMax", "12"]}]}]]}], ")"}], + RowBox[{"1", "/", "3"}]]], "\[Rule]", + FractionBox["1", + RowBox[{ + SuperscriptBox["jMax", "2"], "h10"}]]}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h11", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{ + FractionBox["h6", + RowBox[{"6", "h10"}]], "+", + FractionBox["h10", "18"]}], "\[Rule]", "h11"}], ",", + RowBox[{ + RowBox[{ + FractionBox[ + RowBox[{ + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], "h6"}], + RowBox[{"h2", " ", "h10", " ", + SuperscriptBox["jMax", "2"]}]], "+", + FractionBox["h10", + RowBox[{"108", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], "h2", " ", + SuperscriptBox["jMax", "2"]}]]}], "\[Rule]", + FractionBox["h11", + RowBox[{"h2", " ", + SuperscriptBox["jMax", "2"]}]]}], ",", + RowBox[{ + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{ + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h6"}], + RowBox[{"h2", " ", "h10", " ", + SuperscriptBox["jMax", "2"]}]]}], "-", + FractionBox["h10", + RowBox[{"108", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h2", " ", + SuperscriptBox["jMax", "2"]}]]}], "\[Rule]", + RowBox[{"-", + FractionBox["h11", + RowBox[{"h2", " ", + SuperscriptBox["jMax", "2"]}]]}]}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h12", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + SqrtBox[ + RowBox[{ + FractionBox["h8", + RowBox[{"h2", " ", + SuperscriptBox["jMax", "2"]}]], "+", + FractionBox["h11", + RowBox[{"h2", " ", + SuperscriptBox["jMax", "2"]}]]}]], "\[Rule]", "h12"}], ",", + RowBox[{ + FractionBox["1", + SqrtBox[ + RowBox[{ + FractionBox["h8", + RowBox[{"h2", " ", + SuperscriptBox["jMax", "2"]}]], "+", + FractionBox["h11", + RowBox[{"h2", " ", + SuperscriptBox["jMax", "2"]}]]}]]], "\[Rule]", "jMax"}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h13", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + FractionBox["h12", + RowBox[{"2", " ", "jMax"}]], "-", + RowBox[{ + FractionBox["1", "2"], " ", + SqrtBox[ + RowBox[{ + RowBox[{"-", "h11"}], "+", + RowBox[{"2", " ", "h8"}], "+", + FractionBox["h9", "h12"]}]]}], "-", + FractionBox["h1", + RowBox[{"3", " ", "h2", " ", "jMax"}]]}], "\[Rule]", "h13"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h14", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + FractionBox["h12", + RowBox[{"2", " ", "jMax"}]], "+", + RowBox[{ + FractionBox["1", "2"], " ", + SqrtBox[ + RowBox[{ + RowBox[{"-", "h11"}], "+", + RowBox[{"2", " ", "h8"}], "+", + FractionBox["h9", "h12"]}]]}], "-", + FractionBox["h1", + RowBox[{"3", " ", "h2", " ", "jMax"}]]}], "\[Rule]", "h14"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h15", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"-", + FractionBox["h12", + RowBox[{"2", " ", "jMax"}]]}], "+", + RowBox[{ + FractionBox["1", + RowBox[{"2", "jMax"}]], " ", + SqrtBox[ + RowBox[{ + RowBox[{"-", "h11"}], "+", + RowBox[{"2", " ", "h8"}], "-", + FractionBox["h9", "h12"]}]]}], "-", + FractionBox["h1", + RowBox[{"3", " ", "h2", " ", "jMax"}]]}], "\[Rule]", "h15"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"re8h16", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"-", + FractionBox["h12", + RowBox[{"2", " ", "jMax"}]]}], "-", + RowBox[{ + FractionBox["1", + RowBox[{"2", "jMax"}]], " ", + SqrtBox[ + RowBox[{ + RowBox[{"-", "h11"}], "+", + RowBox[{"2", " ", "h8"}], "-", + FractionBox["h9", "h12"]}]]}], "-", + FractionBox["h1", + RowBox[{"3", " ", "h2", " ", "jMax"}]]}], "\[Rule]", "h16"}], "}"}]}], + ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", + RowBox[{"tmp", "=", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"8", ",", "4", ",", "1", ",", "2"}], "]"}], "]"}], + "//.", "re8h1"}], "//.", "re8h2"}], "//.", "re8h3"}], "//.", + "re8h4"}], "//.", "re8h5"}], "//.", "re8h6"}], "//.", + "re8h7"}], "//.", "re8h8"}], "//.", "re8h9"}], "//.", "re8h82"}], + "//.", "re8h10"}], "//.", "re8h11"}], "//.", "re8h12"}], "//.", + "re8h13"}], "//.", "re8h14"}], "//.", "re8h15"}], "//.", + "re8h16"}]}]}], "Input", + CellChangeTimes->{{3.815153640765952*^9, 3.815153696106082*^9}, { + 3.8151537299006147`*^9, 3.815153824610457*^9}, {3.8151540774364758`*^9, + 3.815154084369618*^9}, {3.815154233752797*^9, 3.8151543105826797`*^9}, { + 3.815157877362908*^9, 3.815157960763833*^9}, {3.815157992696021*^9, + 3.815158023500614*^9}, {3.815158063727469*^9, 3.8151580783589077`*^9}, { + 3.815158109001047*^9, 3.815158159023212*^9}, {3.815158256808938*^9, + 3.815158493056101*^9}, {3.815158566355982*^9, 3.815158710187326*^9}, { + 3.815158758573915*^9, 3.815158881458187*^9}, {3.815158923702086*^9, + 3.815158953131955*^9}, {3.815159034494486*^9, 3.8151590498349333`*^9}, { + 3.815159201110901*^9, 3.815159204646475*^9}, {3.8151593088427258`*^9, + 3.815159377765357*^9}, {3.815159424599888*^9, 3.815159484222603*^9}, { + 3.8151595302518177`*^9, 3.8151595960442867`*^9}, {3.815159641221496*^9, + 3.815159662372807*^9}, {3.815159726500489*^9, 3.8151597400856733`*^9}, { + 3.815159807632163*^9, 3.8151598304582443`*^9}, {3.815159866586732*^9, + 3.815159874164919*^9}, {3.815159924166939*^9, 3.815159970954994*^9}, { + 3.815160003050291*^9, 3.815160278777464*^9}, {3.81516031890627*^9, + 3.8151604313651953`*^9}, {3.815160502309025*^9, 3.8151606667275677`*^9}, { + 3.815160844955847*^9, 3.815160904785411*^9}, {3.815160982388693*^9, + 3.815161250450329*^9}, {3.815161543093471*^9, 3.815161543133909*^9}, { + 3.8151621720776167`*^9, 3.8151622200516376`*^9}, {3.815162288104463*^9, + 3.8151622951472883`*^9}, {3.815189738301199*^9, 3.8151897700279913`*^9}, { + 3.8151898108957663`*^9, 3.815189863433361*^9}, {3.815189910689487*^9, + 3.815189934312417*^9}, {3.815189970190803*^9, 3.815189985541697*^9}, { + 3.815194923053339*^9, 3.815194982691846*^9}, {3.815196505654114*^9, + 3.815196666466791*^9}, {3.815197221431654*^9, 3.815197221489667*^9}, { + 3.815197261098199*^9, 3.815197313176196*^9}, 3.8151973500382423`*^9, { + 3.8151981429949903`*^9, 3.815198176403026*^9}, {3.815198210580349*^9, + 3.815198275695245*^9}, {3.8152119181375732`*^9, 3.815211932062541*^9}, { + 3.81521201298423*^9, 3.815212109030789*^9}, {3.815212364058296*^9, + 3.8152124555453377`*^9}, {3.815212516755362*^9, 3.8152126234135523`*^9}, { + 3.8152126559574347`*^9, 3.8152128138281097`*^9}, {3.8152128756545343`*^9, + 3.81521289447621*^9}, {3.815239981408065*^9, 3.8152400288417788`*^9}, { + 3.815245596183403*^9, 3.815245596247061*^9}, {3.815245659641797*^9, + 3.815245659719172*^9}, {3.815280615387938*^9, 3.8152806154710627`*^9}, { + 3.815374228549471*^9, 3.815374228659309*^9}, {3.815396377300087*^9, + 3.8153963803006907`*^9}, {3.815396531965301*^9, 3.815396566269096*^9}, { + 3.815396882960445*^9, 3.81539688994398*^9}, {3.815396952800412*^9, + 3.81539698883893*^9}, {3.81539714218435*^9, 3.815397311034308*^9}, { + 3.815397371329574*^9, 3.815397433002247*^9}, {3.8153975078187923`*^9, + 3.815397535107638*^9}, {3.81539769494984*^9, 3.815397755156206*^9}, + 3.81539816112302*^9, {3.8153981990365877`*^9, 3.815398234503454*^9}, { + 3.8153982672491837`*^9, 3.8153983033371162`*^9}, {3.815398529331192*^9, + 3.815398549107602*^9}, {3.815398596551013*^9, 3.815398597945586*^9}, { + 3.815398638308916*^9, 3.81539897365294*^9}, {3.815720171051367*^9, + 3.8157202878752327`*^9}, {3.815720318816345*^9, 3.8157203373708687`*^9}, { + 3.815720381372272*^9, 3.81572041181973*^9}, {3.81572067440546*^9, + 3.8157207757168016`*^9}, {3.815720827141341*^9, 3.8157208350441103`*^9}, { + 3.815720931813992*^9, 3.815720933220422*^9}, {3.815722509729373*^9, + 3.815722594001202*^9}, {3.815722671131947*^9, 3.8157226869215727`*^9}, { + 3.81572681694979*^9, 3.8157268490625668`*^9}, {3.815727025064886*^9, + 3.815727201482402*^9}, {3.815727309387282*^9, 3.815727357931253*^9}, { + 3.8157315767039127`*^9, 3.8157315920212173`*^9}, {3.815731698664824*^9, + 3.8157317011979523`*^9}, {3.815980792406657*^9, 3.815980799094434*^9}, { + 3.815980842775201*^9, 3.815980868382924*^9}, {3.815981963237615*^9, + 3.8159819680295973`*^9}, {3.815986695128377*^9, + 3.8159867053747473`*^9}},ExpressionUUID->"c2da0558-3f7e-405c-ab66-\ +8bcbea5dd387"], + +Cell[BoxData[ + RowBox[{ + FractionBox["h12", "2"], "+", + RowBox[{ + FractionBox["1", "2"], " ", + SqrtBox[ + RowBox[{ + FractionBox[ + RowBox[{"8", " ", + SuperscriptBox["h1", "2"]}], + RowBox[{"9", " ", + SuperscriptBox["h2", "2"], " ", + SuperscriptBox["jMax", "2"]}]], "-", + FractionBox["h11", + RowBox[{"h2", " ", + SuperscriptBox["jMax", "2"]}]], "-", + FractionBox[ + RowBox[{"2", " ", "h4"}], + RowBox[{"3", " ", "h2", " ", + SuperscriptBox["jMax", "2"]}]], "+", + FractionBox["h9", + RowBox[{"4", " ", "h2", " ", "jMax"}]]}]]}], "-", + FractionBox["h1", + RowBox[{"3", " ", "h2", " ", "jMax"}]]}]], "Output", + CellChangeTimes->{ + 3.815720289872127*^9, {3.8157203639548817`*^9, 3.815720412914291*^9}, + 3.8157206265098467`*^9, {3.815720702976091*^9, 3.815720742697895*^9}, + 3.815720777517899*^9, {3.815720827871519*^9, 3.815720842612625*^9}, + 3.815720934398802*^9, {3.8157225199170237`*^9, 3.815722594795624*^9}, { + 3.815722674519911*^9, 3.815722687390679*^9}, 3.815726850302671*^9, + 3.815727040041688*^9, {3.815727075170549*^9, 3.815727201971932*^9}, { + 3.815727339244755*^9, 3.815727358460771*^9}, {3.815731577874673*^9, + 3.81573159235885*^9}, 3.815731701713525*^9, 3.81574271464323*^9, + 3.8157429158848333`*^9, 3.815886964632929*^9, 3.815980698369953*^9, + 3.815980799394519*^9, 3.8159808690484333`*^9, 3.815981968526277*^9}, + CellLabel-> + "Out[250]=",ExpressionUUID->"13a8c792-240d-48c4-af08-56e65978c662"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"tmp", "=", + RowBox[{"re7h5", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Refine", "[", + RowBox[{ + RowBox[{"Simplify", "[", "tmp", "]"}], ",", + RowBox[{"{", + RowBox[{"jMax", "\[Element]", "Reals"}], "}"}]}], "]"}], ",", "CForm"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->CompressedData[" +1:eJxTTMoPSmViYGCQAWIQXXP58NJrOW8cBXccWgeitSZ8yrsOpH+3aVeB6K6V +vF0guuRsby+InnX46AoQfcr4DJj+tunUFhAtO2/+YRAdkqiudwMkvtUCTDMF +Pul+AaSVGp5OA9Fh6sfYXwJpawtmCRD9Y3Nj6QcgzfHMtBxEn+Rf2geiL99Z +Dqalrnx+BKIzH38H0wWsRW9A9LeEcjDt90aj4i+QXjRVB0z3pIXo/gPST6aG +g+lH0UZvGHKB5hw2AdOnLC0ZhYD0hG/WYFqq4OYJbyDtVSF1GkRXdC0/D6K5 +tHVug+i4uXEPQHRJvNdTEL1gW8+b9Lw3jsXz94HpqhnJQhlA+pBPLpjm+DZH +CkSbzFsCpvf+/2QPov3m/gDTBnc6i0D0ion7ikH0DdN5DNkg/b/ng2kZTX5l +EP1u5g01EN3x8IE/iJY9/TcIRGctMo0A0c9MrMA0AOJn8OE= + "], + CellLabel-> + "In[359]:=",ExpressionUUID->"d523a624-3b93-40a2-93e6-6b66fb9d315f"], + +Cell[BoxData["\<\"Power(h4 + Sqrt(-11943936*Power(h3,3) + \ +Power(h4,2)),0.3333333333333333)\"\>"], "Output", + CellChangeTimes->{{3.8151590884206533`*^9, 3.815159158553872*^9}, { + 3.81516069672327*^9, 3.815160785723687*^9}, {3.815160912850182*^9, + 3.815160941330422*^9}, {3.815161256323769*^9, 3.8151613733574333`*^9}, + 3.81516222625541*^9, {3.815195744105281*^9, 3.81519583147449*^9}, { + 3.815196734593046*^9, 3.8151967622392817`*^9}, {3.815196801913419*^9, + 3.815196891661048*^9}, {3.815211948805004*^9, 3.8152119619872417`*^9}, { + 3.815212140933909*^9, 3.8152121495849247`*^9}, 3.815212824311056*^9, + 3.8152128999791193`*^9, 3.8152385938370132`*^9, 3.815240043246743*^9, + 3.815245666417348*^9, 3.815280650397243*^9, {3.8153989835213623`*^9, + 3.815399001644071*^9}, {3.815399037640519*^9, 3.815399099268845*^9}, { + 3.815399130059082*^9, 3.815399210641345*^9}, 3.815980902426203*^9, + 3.815981203753921*^9, 3.815981269393936*^9, 3.815981568092519*^9, { + 3.815981973940255*^9, 3.815981982245804*^9}, 3.815986723902809*^9, + 3.815987205481987*^9, {3.815987480974827*^9, 3.8159875110717983`*^9}, { + 3.815987839416443*^9, 3.815987864353557*^9}, 3.8159879061047773`*^9}, + CellLabel-> + "Out[360]=",ExpressionUUID->"5321db0d-fb90-4f4f-abeb-c62bf1bb1720"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"7", ",", "4", ",", "5", ",", "2"}], "]"}], "]"}], "//.", + "re7h1"}], "//.", "re7h2"}], "//.", "re7h3"}], "//.", "re7h4"}], "//.", + "re7h5"}], "//.", "re7h6"}], "//.", "re7h7"}], "//.", + "re7h8"}]], "Input", + CellChangeTimes->{{3.815980782844791*^9, 3.8159808094359837`*^9}, { + 3.815980853149362*^9, 3.815980853308485*^9}, 3.815986715494567*^9}, + CellLabel-> + "In[275]:=",ExpressionUUID->"75d52310-ce4b-4cce-88e2-852c0f8332fd"], + +Cell[BoxData[ + RowBox[{ + FractionBox["h6", "2"], "+", + FractionBox["h8", "2"], "-", + FractionBox["aMax", + RowBox[{"2", " ", "jMax"}]]}]], "Output", + CellChangeTimes->{{3.8159807701636744`*^9, 3.815980809854459*^9}, + 3.8159808535240726`*^9, 3.815986716229677*^9}, + CellLabel-> + "Out[275]=",ExpressionUUID->"5df6b9e8-d4e9-4ac4-a5f5-4ec25d5911b8"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"re7h4", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}], "//.", + RowBox[{"{", + RowBox[{"h6", "\[Rule]", + RowBox[{"re7h6", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h5", "\[Rule]", + RowBox[{"re7h5", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h4", "\[Rule]", + RowBox[{"re7h4", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h3", "\[Rule]", + RowBox[{"re7h3", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h2", "\[Rule]", + RowBox[{"re7h2", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h1", "\[Rule]", + RowBox[{"re7h1", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + "tmpData"}]], "Input", + CellChangeTimes->{{3.815987282095842*^9, 3.8159874167937727`*^9}, { + 3.815987455321652*^9, 3.815987471744734*^9}, {3.815987795139151*^9, + 3.8159878298985643`*^9}}, + CellLabel-> + "In[346]:=",ExpressionUUID->"9a9e423d-663d-4a9b-bd16-d3038453a5dc"], + +Cell[BoxData["4.599031648148551`*^12"], "Output", + CellChangeTimes->{{3.8159872852124023`*^9, 3.815987417515781*^9}, { + 3.8159874556664677`*^9, 3.8159874724983263`*^9}, {3.815987795530785*^9, + 3.815987830159054*^9}}, + CellLabel-> + "Out[346]=",ExpressionUUID->"fb3d249f-7bb9-4dfd-8b76-b9aff446979a"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"re7h8", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}], "//.", + RowBox[{"{", + RowBox[{"h6", "\[Rule]", + RowBox[{"re7h6", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h5", "\[Rule]", + RowBox[{"re7h5", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h4", "\[Rule]", + RowBox[{"re7h4", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h3", "\[Rule]", + RowBox[{"re7h3", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h2", "\[Rule]", + RowBox[{"re7h2", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h1", "\[Rule]", + RowBox[{"re7h1", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + "tmpData"}]], "Input", + CellChangeTimes->{{3.81598736176011*^9, 3.8159873618804417`*^9}}, + CellLabel-> + "In[308]:=",ExpressionUUID->"d368fa06-8f72-4672-954c-13891a615a2f"], + +Cell[BoxData["1.1028242894496816`"], "Output", + CellChangeTimes->{3.815987362178896*^9}, + CellLabel-> + "Out[308]=",ExpressionUUID->"f6a3921b-b6f2-4b49-9a43-c81a6a92d8d1"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"tmp", "=", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"6", ",", "4", ",", "1", ",", "2"}], "]"}], "]"}], "//.", + "re6h1"}], "//.", "re6h2"}], "//.", "re6h3"}], "//.", "re6h4"}], + "//.", "re6h5"}], "//.", "re6h6"}], "//.", "re6h7"}], "//.", + "re6h8"}], "//.", "re6h9"}], "//.", "re6h10"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{"Refine", "[", "tmp", "]"}], "]"}], ",", "CForm"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.815980722555319*^9, 3.81598074667598*^9}, { + 3.81598082375776*^9, 3.815980831956381*^9}, {3.8159808765897617`*^9, + 3.815980887005032*^9}, {3.815981012702889*^9, 3.815981018830052*^9}, { + 3.815981074391271*^9, 3.815981074542426*^9}, {3.815981130759519*^9, + 3.815981130854966*^9}, {3.815981664130208*^9, 3.8159816642255774`*^9}}, + CellLabel-> + "In[211]:=",ExpressionUUID->"8c022a9d-f36b-4f78-b67d-a170aff14a0f"], + +Cell[BoxData["\<\"(-h2 + (h10 + h8)*jMax)/(2.*jMax)\"\>"], "Output", + CellChangeTimes->{ + 3.815980741464655*^9, {3.815980815136343*^9, 3.815980832225416*^9}, { + 3.8159808792377043`*^9, 3.815980887371657*^9}, {3.815981013068893*^9, + 3.815981029930204*^9}, 3.8159810748025627`*^9, 3.815981132224256*^9, + 3.8159814372894583`*^9, 3.8159816645119658`*^9}, + CellLabel-> + "Out[212]=",ExpressionUUID->"402f659c-f0f3-4a81-b1ed-fd2f58b2741c"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"tmp", "=", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"7", ",", "4", ",", "5", ",", "2"}], "]"}], "]"}], "//.", + "re7h1"}], "//.", "re7h2"}], "//.", "re7h3"}], "//.", "re7h4"}], "//.", + "re7h5"}], "//.", "re7h6"}], "//.", "re7h7"}], "//.", "re7h8"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{"Refine", "[", "tmp", "]"}], "]"}], ",", "CForm"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.815324897120294*^9, 3.8153249145106297`*^9}, { + 3.815982158653295*^9, 3.815982170556796*^9}, {3.815986415468029*^9, + 3.815986415563382*^9}, {3.8159866825331573`*^9, 3.815986682612671*^9}}, + CellLabel-> + "In[337]:=",ExpressionUUID->"60a32fc0-d69a-4463-a61a-61ba7f976211"], + +Cell[BoxData["\<\"(-aMax + (h6 + h8)*jMax)/(2.*jMax)\"\>"], "Output", + CellChangeTimes->{{3.815324914847105*^9, 3.815324942992923*^9}, { + 3.815982159133993*^9, 3.815982170793457*^9}, 3.815986415939763*^9, + 3.815986682992354*^9, 3.81598755000279*^9}, + CellLabel-> + "Out[338]=",ExpressionUUID->"a303f13e-5980-4522-98f2-f738edcb2ec7"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"tmp", "=", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"8", ",", "2", ",", "7", ",", "2"}], "]"}], "]"}], + "//.", "re8h1"}], "//.", "re8h2"}], "//.", "re8h3"}], "//.", + "re8h4"}], "//.", "re8h5"}], "//.", "re8h6"}], "//.", + "re8h7"}], "//.", "re8h8"}], "//.", "re8h9"}], "//.", + "re8h82"}], "//.", "re8h10"}], "//.", "re8h11"}], "//.", + "re8h12"}], "//.", "re8h13"}], "//.", "re8h14"}], "//.", "re8h15"}], + "//.", "re8h16"}], "//.", "re8h17"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{"Refine", "[", "tmp", "]"}], "]"}], ",", "CForm"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.8151585216981583`*^9, 3.815158557807578*^9}, { + 3.81515897249295*^9, 3.815159056285187*^9}, {3.8151591771768827`*^9, + 3.815159186742812*^9}, {3.815159217074959*^9, 3.81515924739176*^9}, { + 3.815160290190176*^9, 3.815160306864431*^9}, 3.815160450867374*^9, + 3.815160674737215*^9, {3.815161480170869*^9, 3.8151615533504143`*^9}, { + 3.815162163001487*^9, 3.815162163051363*^9}, {3.815197130228821*^9, + 3.815197209152314*^9}, {3.8151973580430403`*^9, 3.8151973590630713`*^9}, { + 3.8151976823299637`*^9, 3.8151976824064007`*^9}, {3.8151977146199293`*^9, + 3.8151977413046637`*^9}, 3.815211980429431*^9, {3.815212154894732*^9, + 3.815212191454501*^9}, {3.815238387255969*^9, 3.815238387322288*^9}, { + 3.815238428719446*^9, 3.815238430541134*^9}, {3.8152393691230097`*^9, + 3.815239422357934*^9}, {3.8152394896983*^9, 3.815239490312029*^9}, { + 3.815239583434781*^9, 3.8152396030023947`*^9}, {3.815239704301231*^9, + 3.8152397287210693`*^9}, {3.815240063883912*^9, 3.815240084781892*^9}, { + 3.81524561047099*^9, 3.81524562832297*^9}, {3.815245734748077*^9, + 3.815245748297505*^9}, {3.8152806690851192`*^9, 3.815280684054233*^9}, { + 3.815324877767015*^9, 3.815324881135187*^9}, {3.8153249407815027`*^9, + 3.8153249408904753`*^9}},ExpressionUUID->"fac44215-a6b1-4043-8264-\ +95800ba8898b"], + +Cell[BoxData["$Aborted"], "Output", + CellChangeTimes->{{3.815158528606917*^9, 3.8151585551338253`*^9}, { + 3.815158974189341*^9, 3.815159056933207*^9}, {3.815159177511653*^9, + 3.815159187103821*^9}, {3.8151592176432333`*^9, 3.815159247809874*^9}, { + 3.815160295672041*^9, 3.815160315970566*^9}, 3.8151604525750933`*^9, + 3.8151606792754917`*^9, {3.815161480680641*^9, 3.815161554450718*^9}, + 3.815162169377057*^9, {3.815197139577241*^9, 3.815197215414486*^9}, + 3.8151973594983807`*^9, {3.815197682789747*^9, 3.815197742483861*^9}, + 3.8152119821170483`*^9, 3.815212116482559*^9, {3.8152121568019133`*^9, + 3.815212192354459*^9}, {3.8152384201673737`*^9, 3.815238445610209*^9}, { + 3.815239360854373*^9, 3.8152394244319468`*^9}, 3.815239491454282*^9, { + 3.815239585787122*^9, 3.815239604809053*^9}, {3.815239710258802*^9, + 3.815239729968124*^9}, {3.8152400677401457`*^9, 3.815240086000123*^9}, + 3.815245629968206*^9, {3.815245715872697*^9, 3.8152457495725927`*^9}, { + 3.81528067017627*^9, 3.815280685293304*^9}, 3.8153248843744*^9}, + CellLabel-> + "Out[146]=",ExpressionUUID->"884d06da-74f6-4a15-afff-b33bc16cf337"] +}, Open ]], + +Cell["\<\ +With target velocity and target acceleration != 0, jMax != -jMin\ +\>", "Text", + CellChangeTimes->{{3.814011164056567*^9, + 3.814011177247073*^9}},ExpressionUUID->"51e771c4-f7f9-485c-92b2-\ +f4c257aec521"], + +Cell[BoxData[{ + RowBox[{ + RowBox[{"tVars", "=", + RowBox[{"{", + RowBox[{ + "t1", ",", "t2", ",", "t3", ",", "t4", ",", "t5", ",", "t6", ",", "t7"}], + "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"resultT", "=", + RowBox[{"{", "\[IndentingNewLine]", + RowBox[{ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "af"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"a1", "\[Equal]", "aMax"}], ",", + RowBox[{"a5", "\[Equal]", "aMin"}], ",", + RowBox[{"v3", "\[Equal]", "vMax"}]}], "}"}], ",", "tVars"}], "]"}], + ",", "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "af"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"a1", "\[Equal]", "aMax"}], ",", + RowBox[{"a5", "\[Equal]", "aMin"}], ",", + RowBox[{"t4", "\[Equal]", "0"}]}], "}"}], ",", "tVars"}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "af"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"a5", "\[Equal]", "aMin"}], ",", + RowBox[{"v3", "\[Equal]", "vMax"}]}], "}"}], ",", "tVars"}], "]"}], + ",", "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "af"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"a1", "\[Equal]", "aMax"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"v3", "\[Equal]", "vMax"}]}], "}"}], ",", "tVars"}], "]"}], + ",", "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "af"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"v3", "\[Equal]", "vMax"}]}], "}"}], ",", "tVars"}], "]"}], + ",", "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "af"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"a5", "\[Equal]", "aMin"}], ",", + RowBox[{"t4", "\[Equal]", "0"}]}], "}"}], ",", "tVars"}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "af"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"a1", "\[Equal]", "aMax"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"t4", "\[Equal]", "0"}]}], "}"}], ",", "tVars"}], "]"}]}], + "\[IndentingNewLine]", "}"}]}], ";"}]}], "Input", + CellChangeTimes->{{3.812299183728421*^9, 3.8122991851705112`*^9}, { + 3.8122992219092484`*^9, 3.8122992887053747`*^9}, {3.8122993381376553`*^9, + 3.812299340911338*^9}, {3.812299526737833*^9, 3.812299544509012*^9}, { + 3.812299581173987*^9, 3.8122996173038*^9}, {3.812299676857766*^9, + 3.812299689778468*^9}, {3.812426474684676*^9, 3.812426508683338*^9}, { + 3.812426546283989*^9, 3.812426736209405*^9}, {3.812426793570334*^9, + 3.812426794372705*^9}, {3.812426828309206*^9, 3.812426830051162*^9}, { + 3.8124269174496183`*^9, 3.812426946350765*^9}, 3.8124274339181213`*^9, { + 3.814008577068972*^9, 3.8140085778212*^9}, {3.814009049454867*^9, + 3.814009049627697*^9}}, + CellLabel->"In[51]:=",ExpressionUUID->"3668a80c-a752-4998-9de9-1f6e3e889e32"], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"toCCode", "[", + RowBox[{"resultT", ",", "2", ",", "1"}], "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.814008579745266*^9, 3.814008596403523*^9}, { + 3.8140088601043158`*^9, 3.814008959131021*^9}, {3.814009533746703*^9, + 3.8140095662765913`*^9}, {3.814009658309256*^9, 3.81400967876301*^9}, { + 3.814009741977841*^9, 3.814009742026147*^9}}, + CellLabel-> + "In[102]:=",ExpressionUUID->"4acef3d2-b8a0-495f-aa8e-89472efd7a84"], + +Cell[BoxData["\<\"double t1 = (-a0 + aMax)/jMax;\\n\"\>"], "Output", + CellChangeTimes->{ + 3.8140085898866987`*^9, {3.814008861922596*^9, 3.814008959654841*^9}, + 3.814009054736108*^9, {3.814009552313304*^9, 3.8140095665973263`*^9}, { + 3.814009656623764*^9, 3.8140096789979153`*^9}, 3.8140097424064417`*^9}, + CellLabel-> + "Out[102]=",ExpressionUUID->"e6826988-cc45-46e3-83dc-e9521da2f200"] +}, Open ]], + +Cell["For Case 7 and vf == 0, Case 1/2", "Text", + CellChangeTimes->{{3.815325345939969*^9, 3.815325349431642*^9}, { + 3.815326613714657*^9, 3.8153266165889397`*^9}, {3.815326800597905*^9, + 3.815326802042042*^9}},ExpressionUUID->"4b4ef72e-c306-481e-95b2-\ +18b8f25a9242"], + +Cell[BoxData[ + RowBox[{ + RowBox[{"resultT7", "=", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "0"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"a1", "\[Equal]", "aMax"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"t4", "\[Equal]", "0"}]}], "}"}], ",", "tVars"}], "]"}]}], + ";"}]], "Input", + CellChangeTimes->{{3.815325358461389*^9, 3.8153253624878902`*^9}}, + CellLabel-> + "In[253]:=",ExpressionUUID->"dacaf799-7636-4d00-9aab-abdd0ce66871"], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{"resultT7", "[", + RowBox[{"[", + RowBox[{"1", ",", "2", ",", "2"}], "]"}], "]"}], "]"}], ",", "CForm"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.8153253712035027`*^9, 3.815325438946122*^9}, { + 3.815326236271905*^9, 3.815326249937231*^9}, {3.815326523793831*^9, + 3.81532653949537*^9}}, + CellLabel-> + "In[245]:=",ExpressionUUID->"e4ffe61d-6b27-4e44-8719-5381389d90d5"], + +Cell[BoxData["\<\"(3*Power(a0,2) - 3*Power(aMax,2) - 6*jMax*v0 - \ +Complex(0,1)*Sqrt(3)*Sqrt(-3*Power(a0,4) + 8*Power(a0,3)*aMax - \ +24*a0*aMax*jMax*v0 - 6*Power(a0,2)*(Power(aMax,2) - 2*jMax*v0) + \ +12*jMax*(2*aMax*jMax*(p0 - pf) + Power(aMax,2)*v0 - jMax*Power(v0,2))) + \ +aMax*Sqrt(9*Power(aMax,2) - Complex(0,6)*Sqrt(3)*Sqrt(-3*Power(a0,4) + \ +8*Power(a0,3)*aMax - 24*a0*aMax*jMax*v0 - 6*Power(a0,2)*(Power(aMax,2) - \ +2*jMax*v0) + 12*jMax*(2*aMax*jMax*(p0 - pf) + Power(aMax,2)*v0 - \ +jMax*Power(v0,2)))))/(6.*aMax*jMax)\"\>"], "Output", + CellChangeTimes->{{3.8153253736696043`*^9, 3.815325439393042*^9}, { + 3.8153262392180433`*^9, 3.8153262503643093`*^9}, {3.815326524378707*^9, + 3.8153265273660927`*^9}}, + CellLabel-> + "Out[245]=",ExpressionUUID->"af6ab366-a1be-4d9c-a40a-95551857bbd1"] +}, Open ]], + +Cell["\<\ +For Case 8 and v0 == 0 AND a0 == 0 AND vf==0. Redo 3rd-root as one.\ +\>", "Text", + CellChangeTimes->{{3.8146051660859423`*^9, 3.8146051676141644`*^9}, { + 3.8147687750458*^9, 3.814768780413946*^9}, {3.814768843942274*^9, + 3.8147688443024693`*^9}, {3.814769106344132*^9, 3.8147691264322968`*^9}, { + 3.815374392258692*^9, + 3.815374394154854*^9}},ExpressionUUID->"9c0ba946-2fb4-4a4b-a305-\ +4d0102c9636e"], + +Cell[BoxData[{ + RowBox[{ + RowBox[{"a1", "=", + RowBox[{"0", "+", + RowBox[{"t1", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "1", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"a3", "=", + RowBox[{"a1", "+", + RowBox[{"t3", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "3", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"a5", "=", + RowBox[{"a3", "+", + RowBox[{"t5", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "5", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"a7", "=", + RowBox[{"a5", "+", + RowBox[{"t7", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "7", "]"}], "]"}]}]}]}], ";"}], + "\[IndentingNewLine]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"v1", "=", + RowBox[{"0", "+", + RowBox[{"t1", " ", "0"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t1", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "1", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"v3", "=", + RowBox[{"v1", "+", + RowBox[{"t3", " ", "a1"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t3", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "3", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"v5", "=", + RowBox[{"v3", "+", + RowBox[{"t5", " ", "a3"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t5", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "5", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"v7", "=", + RowBox[{"v5", "+", + RowBox[{"t7", " ", "a5"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t7", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "7", "]"}], "]"}]}]}]}], ";"}], + "\[IndentingNewLine]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"p1", "=", + RowBox[{"p0", "+", + RowBox[{"t1", " ", "0"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t1", "2"], " ", "0"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t1", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "1", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"p3", "=", + RowBox[{"p1", "+", + RowBox[{"t3", " ", "v1"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t3", "2"], " ", "a1"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t3", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "3", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"p5", "=", + RowBox[{"p3", "+", + RowBox[{"t5", " ", "v3"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t5", "2"], " ", "a3"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t5", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "5", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"p7", "=", + RowBox[{"p5", "+", + RowBox[{"t7", " ", "v5"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t7", "2"], " ", "a5"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t7", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "7", "]"}], "]"}]}]}]}], ";"}]}], "Input", + CellChangeTimes->{{3.812427566658496*^9, 3.812427632907652*^9}, { + 3.8146051288228292`*^9, 3.8146051320782537`*^9}, {3.814605833195565*^9, + 3.8146058467073*^9}, 3.814606100135058*^9, {3.814606461947022*^9, + 3.81460646488223*^9}, {3.814768818295343*^9, 3.814768841182714*^9}}, + CellLabel-> + "In[2447]:=",ExpressionUUID->"01d94644-43f4-4ebf-b9dd-650c0bcc93aa"], + +Cell[BoxData[ + RowBox[{ + RowBox[{"resultT2", "=", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "0"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}]}], "}"}], ",", + RowBox[{"{", + RowBox[{"t1", ",", "t3", ",", "t5", ",", "t7"}], "}"}]}], "]"}]}], + ";"}]], "Input", + CellChangeTimes->{{3.812427642111352*^9, 3.812427665374312*^9}, { + 3.814605154673225*^9, 3.814605156526219*^9}, {3.814605231304027*^9, + 3.8146052323028183`*^9}, 3.814605884924234*^9, {3.8146059229329042`*^9, + 3.814605932484119*^9}, 3.814768793110735*^9, {3.8151616232829103`*^9, + 3.815161667622699*^9}}, + CellLabel-> + "In[2464]:=",ExpressionUUID->"ccac5833-2cc2-4703-8af2-4673d2c0a437"], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{ + RowBox[{"resultT2", "/.", + RowBox[{"{", + RowBox[{ + RowBox[{"p0", "\[Rule]", "0"}], ",", + RowBox[{"pf", "\[Rule]", + RowBox[{"-", "1"}]}], ",", + RowBox[{"vf", "\[Rule]", "0"}], ",", + RowBox[{"jMax", "\[Rule]", + RowBox[{"-", "1"}]}]}], "}"}]}], "//", "N"}]], "Input", + CellChangeTimes->{{3.814768806959013*^9, 3.814768831870268*^9}, { + 3.814768864975182*^9, 3.814768898647298*^9}, {3.815161660352097*^9, + 3.815161661764017*^9}}, + CellLabel-> + "In[2465]:=",ExpressionUUID->"61a3a1a2-df88-4692-9d53-69048ae8b464"], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"t1", "\[Rule]", + RowBox[{ + RowBox[{"-", "0.39685026299205`"}], "-", + RowBox[{"0.6873648184993013`", " ", "\[ImaginaryI]"}]}]}], ",", + RowBox[{"t3", "\[Rule]", + RowBox[{ + RowBox[{"-", "0.39685026299205`"}], "-", + RowBox[{"0.6873648184993013`", " ", "\[ImaginaryI]"}]}]}], ",", + RowBox[{"t5", "\[Rule]", + RowBox[{ + RowBox[{"-", "0.39685026299205`"}], "-", + RowBox[{"0.6873648184993013`", " ", "\[ImaginaryI]"}]}]}], ",", + RowBox[{"t7", "\[Rule]", + RowBox[{ + RowBox[{"-", "0.39685026299205`"}], "-", + RowBox[{"0.6873648184993013`", " ", "\[ImaginaryI]"}]}]}]}], "}"}], + ",", + RowBox[{"{", + RowBox[{ + RowBox[{"t1", "\[Rule]", "0.7937005259840998`"}], ",", + RowBox[{"t3", "\[Rule]", "0.7937005259840998`"}], ",", + RowBox[{"t5", "\[Rule]", "0.7937005259840998`"}], ",", + RowBox[{"t7", "\[Rule]", "0.7937005259840998`"}]}], "}"}], ",", + RowBox[{"{", + RowBox[{ + RowBox[{"t1", "\[Rule]", + RowBox[{ + RowBox[{"-", "0.39685026299204973`"}], "+", + RowBox[{"0.6873648184993014`", " ", "\[ImaginaryI]"}]}]}], ",", + RowBox[{"t3", "\[Rule]", + RowBox[{ + RowBox[{"-", "0.39685026299204973`"}], "+", + RowBox[{"0.6873648184993014`", " ", "\[ImaginaryI]"}]}]}], ",", + RowBox[{"t5", "\[Rule]", + RowBox[{ + RowBox[{"-", "0.39685026299204973`"}], "+", + RowBox[{"0.6873648184993014`", " ", "\[ImaginaryI]"}]}]}], ",", + RowBox[{"t7", "\[Rule]", + RowBox[{ + RowBox[{"-", "0.39685026299204973`"}], "+", + RowBox[{"0.6873648184993014`", " ", "\[ImaginaryI]"}]}]}]}], "}"}]}], + "}"}]], "Output", + CellChangeTimes->{{3.8147688087061443`*^9, 3.814768898888846*^9}, + 3.814769136417777*^9, {3.8151616575983*^9, 3.815161669182846*^9}}, + CellLabel-> + "Out[2465]=",ExpressionUUID->"01b5369a-1faf-4b6b-b03a-60da9f7755b3"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{"resultT2", "[", + RowBox[{"[", + RowBox[{"3", ",", "1", ",", "2"}], "]"}], "]"}], "]"}], ",", "CForm"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.81460588971658*^9, 3.814605962540819*^9}, { + 3.81460605847858*^9, 3.814606074005746*^9}, {3.814606177015484*^9, + 3.814606222791452*^9}, {3.8146065293789263`*^9, 3.814606530642305*^9}, { + 3.8146071339764347`*^9, 3.814607135984301*^9}}, + CellLabel-> + "In[147]:=",ExpressionUUID->"cb873fd7-3018-44f7-9abe-77d6cc7ffa45"], + +Cell[BoxData["\<\"(Power(-1,0.6666666666666666)*Power(-p0 + \ +pf,0.3333333333333333))/(Power(2,0.3333333333333333)*Power(jMax,0.\ +3333333333333333))\"\>"], "Output", + CellChangeTimes->{3.814769137905984*^9}, + CellLabel-> + "Out[147]=",ExpressionUUID->"bcf5a353-db32-45fd-9ee6-ab29cf578f4a"] +}, Open ]], + +Cell["For Case 8 only v0==0 AND vf==0, Solution 2", "Text", + CellChangeTimes->{{3.815374381178678*^9, 3.815374396834651*^9}, { + 3.8153744554192953`*^9, + 3.815374457475183*^9}},ExpressionUUID->"f3928d4d-4e0e-400f-97cb-\ +f9a8d134e403"], + +Cell[BoxData[{ + RowBox[{ + RowBox[{"a1", "=", + RowBox[{"0", "+", + RowBox[{"t1", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "1", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"a3", "=", + RowBox[{"a1", "+", + RowBox[{"t3", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "3", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"a5", "=", + RowBox[{"a3", "+", + RowBox[{"t5", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "5", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"a7", "=", + RowBox[{"a5", "+", + RowBox[{"t7", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "7", "]"}], "]"}]}]}]}], ";"}], + "\[IndentingNewLine]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"v1", "=", + RowBox[{"v0", "+", + RowBox[{"t1", " ", "0"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t1", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "1", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"v3", "=", + RowBox[{"v1", "+", + RowBox[{"t3", " ", "a1"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t3", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "3", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"v5", "=", + RowBox[{"v3", "+", + RowBox[{"t5", " ", "a3"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t5", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "5", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"v7", "=", + RowBox[{"v5", "+", + RowBox[{"t7", " ", "a5"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t7", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "7", "]"}], "]"}]}]}]}], ";"}], + "\[IndentingNewLine]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"p1", "=", + RowBox[{"p0", "+", + RowBox[{"t1", " ", "v0"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t1", "2"], " ", "0"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t1", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "1", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"p3", "=", + RowBox[{"p1", "+", + RowBox[{"t3", " ", "v1"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t3", "2"], " ", "a1"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t3", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "3", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"p5", "=", + RowBox[{"p3", "+", + RowBox[{"t5", " ", "v3"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t5", "2"], " ", "a3"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t5", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "5", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"p7", "=", + RowBox[{"p5", "+", + RowBox[{"t7", " ", "v5"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t7", "2"], " ", "a5"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t7", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "7", "]"}], "]"}]}]}]}], ";"}]}], "Input", + CellChangeTimes->{{3.8153744072031813`*^9, 3.815374412275528*^9}, { + 3.815395227409012*^9, 3.815395228152782*^9}, {3.815740017337164*^9, + 3.815740018984975*^9}, {3.8158906446207933`*^9, 3.815890660900103*^9}, { + 3.815890897119012*^9, 3.815890900318233*^9}, 3.815891789164054*^9}, + CellLabel->"In[54]:=",ExpressionUUID->"e3dd8e3d-e0d1-4281-9358-2ac240171bc7"], + +Cell[BoxData[ + RowBox[{ + RowBox[{"resultT2", "=", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "0"}], ",", + RowBox[{"p7", "\[Equal]", "p0"}], ",", + RowBox[{"a3", "\[Equal]", "0"}]}], "}"}], ",", + RowBox[{"{", + RowBox[{"t1", ",", "t3", ",", "t5", ",", "t7"}], "}"}]}], "]"}]}], + ";"}]], "Input", + CellChangeTimes->{{3.8157400434255323`*^9, 3.815740064202321*^9}, { + 3.815889863621352*^9, 3.8158898763327427`*^9}, {3.815890613796266*^9, + 3.815890613971834*^9}, {3.815890902318907*^9, 3.815890902382373*^9}, { + 3.81589180373967*^9, 3.815891835043449*^9}, {3.815892027317246*^9, + 3.815892027644731*^9}}, + CellLabel->"In[81]:=",ExpressionUUID->"0f9d0752-03b0-4070-9d39-4699458a4a2b"], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{"resultT2adapted", " ", "=", " ", + RowBox[{"{", + RowBox[{ + RowBox[{"t1", "\[Rule]", + RowBox[{ + FractionBox[ + SqrtBox[ + RowBox[{ + RowBox[{"-", + FractionBox["v0", "jMax"]}], "-", + FractionBox[ + RowBox[{ + SqrtBox["5"], " ", "v0"}], "jMax"]}]], + SqrtBox["2"]], "+", "\[Epsilon]1"}]}], ",", + RowBox[{"t3", "\[Rule]", + RowBox[{ + RowBox[{ + SqrtBox[ + RowBox[{ + FractionBox["1", "2"], " ", + RowBox[{"(", + RowBox[{"1", "+", + SqrtBox["5"]}], ")"}]}]], " ", + SqrtBox[ + RowBox[{"-", + FractionBox["v0", "jMax"]}]]}], "+", "\[Epsilon]2"}]}], ",", + RowBox[{"t5", "\[Rule]", + FractionBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "2"}], " ", + SqrtBox[ + RowBox[{"2", " ", + RowBox[{"(", + RowBox[{"1", "+", + SqrtBox["5"]}], ")"}]}]], " ", "v0", " ", + SqrtBox[ + RowBox[{"-", + FractionBox["v0", "jMax"]}]]}], "-", + RowBox[{ + SqrtBox["2"], " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"1", "+", + SqrtBox["5"]}], ")"}], + RowBox[{"3", "/", "2"}]], " ", "jMax", " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"-", + FractionBox["v0", "jMax"]}], ")"}], + RowBox[{"3", "/", "2"}]]}]}], + RowBox[{"4", " ", "v0"}]]}], ",", + RowBox[{"t7", "\[Rule]", + RowBox[{ + FractionBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "2"}], " ", + SqrtBox[ + RowBox[{"2", " ", + RowBox[{"(", + RowBox[{"1", "+", + SqrtBox["5"]}], ")"}]}]], " ", "v0", " ", + SqrtBox[ + RowBox[{"-", + FractionBox["v0", "jMax"]}]]}], "-", + RowBox[{ + SqrtBox["2"], " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"1", "+", + SqrtBox["5"]}], ")"}], + RowBox[{"3", "/", "2"}]], " ", "jMax", " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"-", + FractionBox["v0", "jMax"]}], ")"}], + RowBox[{"3", "/", "2"}]]}]}], + RowBox[{"4", " ", "v0"}]], "+", "\[Epsilon]3"}]}]}], "}"}]}]], "Input",\ + + CellChangeTimes->{{3.815892085165761*^9, 3.8158921140373*^9}, { + 3.8158947504258842`*^9, 3.815894774281107*^9}}, + CellLabel-> + "In[347]:=",ExpressionUUID->"efd78a19-7576-461b-92ad-f8a6b029f2bf"], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{ + RowBox[{"t1", "\[Rule]", + RowBox[{ + FractionBox[ + SqrtBox[ + RowBox[{ + RowBox[{"-", + FractionBox["v0", "jMax"]}], "-", + FractionBox[ + RowBox[{ + SqrtBox["5"], " ", "v0"}], "jMax"]}]], + SqrtBox["2"]], "+", "\[Epsilon]1"}]}], ",", + RowBox[{"t3", "\[Rule]", + RowBox[{ + RowBox[{ + SqrtBox[ + RowBox[{ + FractionBox["1", "2"], " ", + RowBox[{"(", + RowBox[{"1", "+", + SqrtBox["5"]}], ")"}]}]], " ", + SqrtBox[ + RowBox[{"-", + FractionBox["v0", "jMax"]}]]}], "+", "\[Epsilon]2"}]}], ",", + RowBox[{"t5", "\[Rule]", + FractionBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "2"}], " ", + SqrtBox[ + RowBox[{"2", " ", + RowBox[{"(", + RowBox[{"1", "+", + SqrtBox["5"]}], ")"}]}]], " ", "v0", " ", + SqrtBox[ + RowBox[{"-", + FractionBox["v0", "jMax"]}]]}], "-", + RowBox[{ + SqrtBox["2"], " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"1", "+", + SqrtBox["5"]}], ")"}], + RowBox[{"3", "/", "2"}]], " ", "jMax", " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"-", + FractionBox["v0", "jMax"]}], ")"}], + RowBox[{"3", "/", "2"}]]}]}], + RowBox[{"4", " ", "v0"}]]}], ",", + RowBox[{"t7", "\[Rule]", + RowBox[{ + FractionBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "2"}], " ", + SqrtBox[ + RowBox[{"2", " ", + RowBox[{"(", + RowBox[{"1", "+", + SqrtBox["5"]}], ")"}]}]], " ", "v0", " ", + SqrtBox[ + RowBox[{"-", + FractionBox["v0", "jMax"]}]]}], "-", + RowBox[{ + SqrtBox["2"], " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"1", "+", + SqrtBox["5"]}], ")"}], + RowBox[{"3", "/", "2"}]], " ", "jMax", " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"-", + FractionBox["v0", "jMax"]}], ")"}], + RowBox[{"3", "/", "2"}]]}]}], + RowBox[{"4", " ", "v0"}]], "+", "\[Epsilon]3"}]}]}], "}"}]], "Output", + CellChangeTimes->{ + 3.815892114492947*^9, {3.815894761961067*^9, 3.815894775057385*^9}}, + CellLabel-> + "Out[347]=",ExpressionUUID->"9418e426-c046-4fe6-a082-f164061801ff"] +}, Open ]], + +Cell[BoxData[ + RowBox[{"Simplify", "[", + RowBox[{"(", + RowBox[{"p7", "/.", "resultT2adapted"}], ")"}], "]"}]], "Input", + CellChangeTimes->{{3.815892060701552*^9, 3.815892072796747*^9}, + 3.815892118319405*^9, {3.815892157150528*^9, + 3.815892160661354*^9}},ExpressionUUID->"9105b557-b172-46e2-b7d1-\ +beface9f3e18"], + +Cell[BoxData[ + RowBox[{"Simplify", "[", + RowBox[{"(", + RowBox[{"v7", "/.", "resultT2adapted"}], ")"}], "]"}]], "Input", + CellChangeTimes->{{3.815892139069319*^9, + 3.815892159989311*^9}},ExpressionUUID->"391446f1-0939-4759-b03d-\ +76f62902beed"], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{"Simplify", "[", + RowBox[{"(", + RowBox[{"a7", "/.", "resultT2adapted"}], ")"}], "]"}]], "Input", + CellChangeTimes->{{3.815892144845414*^9, + 3.8158921595572023`*^9}},ExpressionUUID->"e86cb307-7d12-4f90-a085-\ +600124212b0a"], + +Cell[BoxData[ + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + "\[Epsilon]1", "-", "\[Epsilon]2", "-", "\[Epsilon]3", "+", + "\[Epsilon]4"}], ")"}]}]], "Output", + CellChangeTimes->{{3.815892056389915*^9, 3.815892073442011*^9}, { + 3.81589211950119*^9, 3.815892145326913*^9}}, + CellLabel->"Out[91]=",ExpressionUUID->"a780a68b-6b33-43dc-b94f-5ece8d7b0e06"] +}, Open ]], + +Cell[BoxData[ + RowBox[{ + RowBox[{"resultEps", "=", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{"p7", "/.", "resultT2adapted"}], ")"}], "\[Equal]", "pf"}], + ",", + RowBox[{ + RowBox[{"(", + RowBox[{"v7", "/.", "resultT2adapted"}], ")"}], "\[Equal]", "0"}], + ",", + RowBox[{ + RowBox[{"(", + RowBox[{"a7", "/.", "resultT2adapted"}], ")"}], "\[Equal]", "0"}]}], + "}"}], ",", + RowBox[{"{", + RowBox[{"\[Epsilon]1", ",", "\[Epsilon]2", ",", "\[Epsilon]3"}], + "}"}]}], "]"}]}], ";"}]], "Input", + CellChangeTimes->{{3.815892148470088*^9, 3.815892222357902*^9}, { + 3.8158922630798693`*^9, 3.815892265310199*^9}, {3.8158922987671957`*^9, + 3.8158923109985733`*^9}, 3.815894039189942*^9, {3.8158947647138844`*^9, + 3.815894765096632*^9}}, + CellLabel-> + "In[348]:=",ExpressionUUID->"dae8256b-9c13-46a7-b508-0f10b1105bf5"], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{ + RowBox[{ + RowBox[{"resultEps", "[", + RowBox[{"[", + RowBox[{"4", ",", "2", ",", "2"}], "]"}], "]"}], "/.", + RowBox[{"{", + RowBox[{"\[Epsilon]3", "\[Rule]", "0"}], "}"}]}], "/.", + "tmpData"}]], "Input", + CellChangeTimes->{{3.815894043309059*^9, 3.8158940735332813`*^9}, { + 3.815894420055643*^9, 3.815894420110786*^9}, {3.8158944641760178`*^9, + 3.815894464287013*^9}, {3.815894724297152*^9, 3.815894732920471*^9}}, + CellLabel-> + "In[350]:=",ExpressionUUID->"e47326ee-0a23-43f2-9dae-3b16fc92e7fc"], + +Cell[BoxData[ + RowBox[{ + RowBox[{"-", "4.472149502277034`*^-6"}], "+", + RowBox[{"1.3877787807814457`*^-15", " ", "\[ImaginaryI]"}]}]], "Output", + CellChangeTimes->{{3.815894044861169*^9, 3.815894073899242*^9}, { + 3.8158944182832737`*^9, 3.815894420443242*^9}, 3.8158944646008387`*^9, { + 3.8158946438833323`*^9, 3.8158946457260923`*^9}, {3.815894724715122*^9, + 3.815894733365576*^9}, {3.815894781917111*^9, 3.8158947831118298`*^9}}, + CellLabel-> + "Out[350]=",ExpressionUUID->"e06aeefa-c9d8-4b6f-998f-ceb064dd2a1b"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"reepsh1", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + FractionBox[ + RowBox[{"432", " ", + SuperscriptBox["p0", "2"]}], + SuperscriptBox["jMax", "2"]], "-", + FractionBox[ + RowBox[{"864", " ", "p0", " ", "pf"}], + SuperscriptBox["jMax", "2"]], "+", + FractionBox[ + RowBox[{"432", " ", + SuperscriptBox["pf", "2"]}], + SuperscriptBox["jMax", "2"]], "+", + FractionBox[ + RowBox[{"416", " ", + SuperscriptBox["v0", "3"]}], + SuperscriptBox["jMax", "3"]]}], ")"}], "\[Rule]", "h1"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"reepsh2", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"h1", "+", + SqrtBox[ + RowBox[{ + SuperscriptBox["h1", "2"], "-", + FractionBox[ + RowBox[{"256", " ", + SuperscriptBox["v0", "6"]}], + SuperscriptBox["jMax", "6"]]}]]}], ")"}], + RowBox[{"1", "/", "3"}]], "\[Rule]", "h2"}], ",", + RowBox[{ + FractionBox["1", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"h1", "+", + SqrtBox[ + RowBox[{ + SuperscriptBox["h1", "2"], "-", + FractionBox[ + RowBox[{"256", " ", + SuperscriptBox["v0", "6"]}], + SuperscriptBox["jMax", "6"]]}]]}], ")"}], + RowBox[{"1", "/", "3"}]]], "\[Rule]", + FractionBox["1", "h2"]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"reepsh3", "=", + RowBox[{"{", " ", + RowBox[{ + SqrtBox[ + RowBox[{"-", + FractionBox["v0", "jMax"]}]], "\[Rule]", "h3"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"reepsh4", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + SqrtBox[ + RowBox[{"(", + RowBox[{"1", "+", + SqrtBox["5"]}], ")"}]], " ", "\[Rule]", "h4"}], ",", + RowBox[{ + SqrtBox[ + RowBox[{"2", " ", + RowBox[{"(", + RowBox[{"1", "+", + SqrtBox["5"]}], ")"}]}]], "\[Rule]", + RowBox[{ + SqrtBox["2"], "h4"}]}], ",", " ", + RowBox[{ + SqrtBox[ + RowBox[{"10", " ", + RowBox[{"(", + RowBox[{"1", "+", + SqrtBox["5"]}], ")"}]}]], "\[Rule]", + RowBox[{ + SqrtBox["10"], "h4"}]}], ",", + RowBox[{ + SqrtBox[ + RowBox[{ + FractionBox["1", "2"], " ", + RowBox[{"(", + RowBox[{"1", "+", + SqrtBox["5"]}], ")"}]}]], "\[Rule]", + FractionBox["h4", + SqrtBox["2"]]}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{"2", "+", + RowBox[{"2", " ", + SqrtBox["5"]}]}], ")"}], "\[Rule]", + RowBox[{"2", + SuperscriptBox["h4", "2"]}]}], ",", + RowBox[{ + RowBox[{"2", " ", + RowBox[{"(", + RowBox[{"1", "+", + SqrtBox["5"]}], ")"}]}], "\[Rule]", + RowBox[{"2", " ", + SuperscriptBox["h4", "2"]}]}], ",", + RowBox[{ + RowBox[{"3", " ", + RowBox[{"(", + RowBox[{"1", "+", + SqrtBox["5"]}], ")"}]}], "\[Rule]", + RowBox[{"3", + SuperscriptBox["h4", "2"]}]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"reepsh5", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + FractionBox[ + RowBox[{"2", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "16"}], "-", + RowBox[{"12", " ", + SqrtBox["5"]}]}], ")"}], " ", "v0"}], "jMax"], "+", + FractionBox[ + RowBox[{"2", " ", + SuperscriptBox["h4", "6"], " ", "v0"}], "jMax"]}], ")"}], "\[Rule]", + "h5"}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"reepsh6", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{"4", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"8", " ", "p0"}], "-", + RowBox[{"8", " ", "pf"}], "-", + RowBox[{"10", " ", + SqrtBox["2"], " ", "h3", " ", "h4", " ", "v0"}], "-", + RowBox[{"2", " ", + SqrtBox["10"], " ", "h3", " ", "h4", " ", "v0"}]}], ")"}]}], + "jMax"]}], "\[Rule]", "h6"}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"reepsh7", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{ + FractionBox["h2", + RowBox[{"3", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]]}]], "-", + FractionBox[ + RowBox[{"8", " ", "v0"}], + RowBox[{"3", " ", "jMax"}]], "+", + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["v0", "2"]}], + RowBox[{"3", " ", "h2", " ", + SuperscriptBox["jMax", "2"]}]]}], "\[Rule]", "h7"}], ",", + RowBox[{ + RowBox[{ + RowBox[{"-", + FractionBox["h2", + RowBox[{"3", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]]}]]}], "+", + FractionBox[ + RowBox[{"8", " ", "v0"}], + RowBox[{"3", " ", "jMax"}]], "-", + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["v0", "2"]}], + RowBox[{"3", " ", "h2", " ", + SuperscriptBox["jMax", "2"]}]]}], "\[Rule]", + RowBox[{"-", "h7"}]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"reepsh8", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{"h3", " ", + SuperscriptBox["h4", "3"]}], + RowBox[{"2", " ", + SqrtBox["2"]}]]}], "+", + FractionBox[ + SqrtBox["h7"], "2"], "+", + RowBox[{ + FractionBox["1", "2"], " ", + SqrtBox[ + RowBox[{ + FractionBox[ + RowBox[{ + RowBox[{ + SqrtBox["2"], " ", "h3", " ", + SuperscriptBox["h4", "3"], " ", "h5"}], "+", "h6"}], + RowBox[{"4", " ", + SqrtBox["h7"]}]], "-", "h7", "-", + FractionBox[ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "16"}], "-", + RowBox[{"12", " ", + SqrtBox["5"]}]}], ")"}], " ", "v0"}], "jMax"], "-", + FractionBox[ + RowBox[{"3", " ", + RowBox[{"(", + RowBox[{"1", "+", + SqrtBox["5"]}], ")"}], " ", + SuperscriptBox["h4", "4"], " ", "v0"}], + RowBox[{"2", " ", "jMax"}]]}]]}]}], ")"}], "\[Rule]", "h8"}], + "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"resultEps", "[", + RowBox[{"[", + RowBox[{"4", ",", "1", ",", "2"}], "]"}], "]"}], "/.", + RowBox[{"{", + RowBox[{"\[Epsilon]3", "\[Rule]", "0"}], "}"}]}], "//.", + "reepsh1"}], "//.", "reepsh2"}], "//.", "reepsh3"}], "//.", + "reepsh4"}], "//.", "reepsh5"}], "//.", "reepsh6"}], "//.", "reepsh7"}], + "//.", "reepsh8"}]}], "Input", + CellChangeTimes->{{3.8158925113686743`*^9, 3.815892524847982*^9}, { + 3.815892565897148*^9, 3.815892635016626*^9}, {3.815892681113862*^9, + 3.8158927120106573`*^9}, {3.815892760978209*^9, 3.815892771145616*^9}, { + 3.815893086300995*^9, 3.815893088436727*^9}, {3.8158932327654676`*^9, + 3.815893343797133*^9}, {3.815894026086035*^9, 3.815894028557722*^9}, { + 3.8158946954968147`*^9, 3.815894695648624*^9}, {3.81589938725739*^9, + 3.8158993873841343`*^9}, {3.815899478752494*^9, 3.815899510527417*^9}, + 3.815899687567356*^9, {3.815900112482595*^9, 3.81590045580095*^9}}, + CellLabel-> + "In[612]:=",ExpressionUUID->"1aa963a1-ace0-47ca-b2e8-3de5ccddfd8b"], + +Cell[BoxData[ + RowBox[{ + FractionBox["1", "8"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"12", " ", "h8"}], "+", + RowBox[{"12", " ", + SqrtBox["5"], " ", "h8"}], "-", + FractionBox[ + RowBox[{"3", " ", + SqrtBox["2"], " ", "h3", " ", "h4", " ", + SuperscriptBox["h8", "2"], " ", "jMax"}], "v0"], "-", + FractionBox[ + RowBox[{"3", " ", + SqrtBox["10"], " ", "h3", " ", "h4", " ", + SuperscriptBox["h8", "2"], " ", "jMax"}], "v0"], "-", + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["h8", "3"], " ", "jMax"}], "v0"], "-", + FractionBox[ + RowBox[{"16", " ", "p0"}], "v0"], "+", + FractionBox[ + RowBox[{"16", " ", "pf"}], "v0"]}], ")"}]}]], "Output", + CellChangeTimes->{{3.815900116406501*^9, 3.815900179720722*^9}, { + 3.815900212774221*^9, 3.815900287852487*^9}, 3.815900324037355*^9, { + 3.815900357400731*^9, 3.8159004188979483`*^9}, {3.815900449211611*^9, + 3.8159004561092997`*^9}, 3.815900520874489*^9}, + CellLabel-> + "Out[620]=",ExpressionUUID->"8dd47181-8e6e-40f3-840a-ca92193b2777"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{ + RowBox[{ + RowBox[{"resultEps", "[", + RowBox[{"[", + RowBox[{"4", ",", "2", ",", "2"}], "]"}], "]"}], "/.", + RowBox[{"{", + RowBox[{"\[Epsilon]3", "\[Rule]", "0"}], "}"}]}], "/.", + "tmpData"}]], "Input", + CellChangeTimes->{{3.815900943299778*^9, 3.815900947019116*^9}}, + CellLabel-> + "In[654]:=",ExpressionUUID->"df0815ab-ee6e-496f-97eb-115430cbd729"], + +Cell[BoxData[ + RowBox[{ + RowBox[{"-", "4.472149502277034`*^-6"}], "+", + RowBox[{"1.3877787807814457`*^-15", " ", "\[ImaginaryI]"}]}]], "Output", + CellChangeTimes->{ + 3.815899640621793*^9, {3.815900943694831*^9, 3.8159009473096323`*^9}}, + CellLabel-> + "Out[654]=",ExpressionUUID->"05459621-ea5b-483e-9bab-31ada7245bcd"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"reepsh2", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}], "//.", + RowBox[{"{", + RowBox[{"h7", "\[Rule]", + RowBox[{"reepsh7", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h6", "\[Rule]", + RowBox[{"reepsh6", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h5", "\[Rule]", + RowBox[{"reepsh5", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h4", "\[Rule]", + RowBox[{"reepsh4", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h3", "\[Rule]", + RowBox[{"reepsh3", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h2", "\[Rule]", + RowBox[{"reepsh2", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h1", "\[Rule]", + RowBox[{"reepsh1", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "/.", + "tmpData"}]], "Input", + CellChangeTimes->{{3.8158941229059*^9, 3.815894164805746*^9}, { + 3.8158942775913563`*^9, 3.815894285998371*^9}, {3.8158943315435963`*^9, + 3.815894331638589*^9}, {3.815894369351699*^9, 3.8158944105669813`*^9}, { + 3.8158945627624187`*^9, 3.815894632688039*^9}, {3.815899647792715*^9, + 3.815899674279833*^9}, {3.815900926149395*^9, 3.81590097029932*^9}}, + CellLabel-> + "In[658]:=",ExpressionUUID->"53fa214f-d4c0-4ef2-88df-6c9125558a0e"], + +Cell[BoxData[ + RowBox[{"0.33759482785799033`", "\[VeryThinSpace]", "+", + RowBox[{"0.5847313942225081`", " ", "\[ImaginaryI]"}]}]], "Output", + CellChangeTimes->{{3.815894147827465*^9, 3.815894165039542*^9}, + 3.815894202855706*^9, {3.815894278017037*^9, 3.815894286255794*^9}, { + 3.815894331943665*^9, 3.815894410922311*^9}, {3.815894566892922*^9, + 3.815894633120081*^9}, 3.81589955775795*^9, {3.815899593458764*^9, + 3.815899609899981*^9}, {3.8158996484716167`*^9, 3.815899674769442*^9}, { + 3.815900928626371*^9, 3.8159009705782433`*^9}}, + CellLabel-> + "Out[658]=",ExpressionUUID->"df3a3d30-fd26-4b6f-a465-ea2b7d58e36c"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData["tmpData"], "Input", + CellLabel-> + "In[304]:=",ExpressionUUID->"46778d8f-685d-48dd-a5a9-6d761be7f0bf"], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{ + RowBox[{"p0", "\[Rule]", "0"}], ",", + RowBox[{"v0", "\[Rule]", "1"}], ",", + RowBox[{"a0", "\[Rule]", "0"}], ",", + RowBox[{"pf", "\[Rule]", "0.00001`"}], ",", + RowBox[{"vf", "\[Rule]", "0"}], ",", + RowBox[{"vMax", "\[Rule]", + RowBox[{"-", "5"}]}], ",", + RowBox[{"aMax", "\[Rule]", + RowBox[{"-", "5"}]}], ",", + RowBox[{"jMax", "\[Rule]", + RowBox[{"-", "1"}]}]}], "}"}]], "Output", + CellChangeTimes->{3.815894355705596*^9}, + CellLabel-> + "Out[304]=",ExpressionUUID->"c1552803-093b-4ab9-9649-d9dc79af7e57"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"tmp", "=", + RowBox[{"reepsh8", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", "tmp", "]"}], ",", "CForm"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.8158933745573807`*^9, 3.815893442412093*^9}, { + 3.8158942154306183`*^9, 3.8158942155819073`*^9}, {3.81590053571367*^9, + 3.815900578945135*^9}}, + CellLabel-> + "In[639]:=",ExpressionUUID->"474381ce-6028-4454-b840-5a5643c6fcce"], + +Cell[BoxData["\<\"(-(Sqrt(2)*h3*Power(h4,3)) + 2*Sqrt(h7) + \ +Sqrt((Sqrt(2)*h3*Power(h4,3)*h5 + h6)/Sqrt(h7) - 4*h7 + (16*(4 + \ +3*Sqrt(5))*v0)/jMax - (6*(1 + Sqrt(5))*Power(h4,4)*v0)/jMax))/4.\"\>"], \ +"Output", + CellChangeTimes->{{3.8158933755904503`*^9, 3.815893442735331*^9}, + 3.815894215876996*^9, {3.815900530416111*^9, 3.815900579347949*^9}}, + CellLabel-> + "Out[640]=",ExpressionUUID->"40a01ef1-7c61-42c3-b1e4-70d2edfe492b"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{ + RowBox[{"reepsh1", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}], "/.", "tmpData"}]], "Input", + CellChangeTimes->{3.815894225294779*^9}, + CellLabel-> + "In[297]:=",ExpressionUUID->"7ddc8285-0ee6-4f4c-96a4-eca74fc86b7d"], + +Cell[BoxData[ + RowBox[{"-", "415.9999999568`"}]], "Output", + CellChangeTimes->{3.815894225999387*^9}, + CellLabel-> + "Out[297]=",ExpressionUUID->"db03dd97-17bc-4036-ba73-3c0d6137fd95"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"tmp", "=", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"resultEps", "[", + RowBox[{"[", + RowBox[{"4", ",", "3", ",", "2"}], "]"}], "]"}], "/.", + RowBox[{"{", + RowBox[{"\[Epsilon]3", "\[Rule]", "0"}], "}"}]}], "//.", + "reepsh1"}], "//.", "reepsh2"}], "//.", "reepsh3"}], "//.", + "reepsh4"}], "//.", "reepsh5"}], "//.", "reepsh6"}], "//.", + "reepsh7"}], "//.", "reepsh8"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", "tmp", "]"}], ",", "CForm"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.8158933643094397`*^9, 3.815893370597733*^9}, { + 3.815893445820291*^9, 3.815893486412212*^9}, {3.81589972008689*^9, + 3.815899721822372*^9}, 3.815899950303381*^9, {3.81590059001025*^9, + 3.815900609953608*^9}}, + CellLabel-> + "In[648]:=",ExpressionUUID->"6c4723ac-7cf5-426c-a3d2-98c88254c5ef"], + +Cell[BoxData["\<\"(3*Sqrt(2)*(1 + Sqrt(5))*h3*h4*Power(h8,2)*jMax + \ +4*Power(h8,3)*jMax + 16*(p0 - pf) - 4*h8*(v0 + 3*Sqrt(5)*v0))/(8.*v0)\"\>"], \ +"Output", + CellChangeTimes->{{3.815893447844387*^9, 3.815893486720228*^9}, { + 3.8158946502098417`*^9, 3.815894651231022*^9}, 3.815899724584425*^9, + 3.81589995066393*^9, {3.8159005926111097`*^9, 3.815900610276226*^9}}, + CellLabel-> + "Out[649]=",ExpressionUUID->"748b4442-c6b5-4e58-9383-0c87c8e79669"] +}, Open ]], + +Cell["For a0 == 0 and vf == 0", "Text", + CellChangeTimes->{{3.815740592190386*^9, + 3.815740595894169*^9}},ExpressionUUID->"07e75525-b632-484e-9ec9-\ +284d76c627c3"], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"reh8ah1", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"jMax", " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"p0", "-", "pf"}], ")"}], "2"]}], "-", + SuperscriptBox["v0", "3"]}], "\[Rule]", "h1"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"jMax", " ", + SuperscriptBox["p0", "2"]}], "-", + RowBox[{"2", " ", "jMax", " ", "p0", " ", "pf"}], "+", + RowBox[{"jMax", " ", + SuperscriptBox["pf", "2"]}], "-", + SuperscriptBox["v0", "3"]}], ")"}], "\[Rule]", "h1"}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"reh8ah2", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{"p0", "-", "pf"}], ")"}], "\[Rule]", "h2"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + SuperscriptBox["jMax", "2"], " ", "p0"}], "-", + RowBox[{ + SuperscriptBox["jMax", "2"], " ", "pf"}]}], ")"}], "\[Rule]", + RowBox[{ + SuperscriptBox["jMax", "2"], "h2"}]}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"jMax", " ", "p0", " ", "v0"}], "-", + RowBox[{"jMax", " ", "pf", " ", "v0"}]}], ")"}], "\[Rule]", + RowBox[{"jMax", " ", "h2", " ", "v0"}]}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"reh8ah3", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"2", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"54", " ", "h1", " ", + SuperscriptBox["h2", "2"], " ", "jMax"}], "-", + RowBox[{"36", " ", "h1", " ", + SuperscriptBox["v0", "3"]}], "+", + RowBox[{"180", " ", + SuperscriptBox["h2", "2"], " ", "jMax", " ", + SuperscriptBox["v0", "3"]}], "+", + SuperscriptBox["v0", "6"]}], ")"}]}], "\[Rule]", "h3"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"108", " ", "h1", " ", + SuperscriptBox["h2", "2"], " ", + SuperscriptBox["jMax", "4"]}], "-", + RowBox[{"72", " ", "h1", " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["v0", "3"]}], "+", + RowBox[{"360", " ", + SuperscriptBox["h2", "2"], " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["v0", "3"]}], "+", + RowBox[{"2", " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["v0", "6"]}]}], ")"}], "\[Rule]", "h3"}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"reh8ah4", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"-", + SuperscriptBox["jMax", "2"]}], " ", "v0", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"12", " ", "jMax", " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"p0", "-", "pf"}], ")"}], "2"]}], "+", + RowBox[{"11", " ", + SuperscriptBox["v0", "3"]}]}], ")"}]}], "\[Rule]", "h4"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "12"}], " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["p0", "2"], " ", "v0"}], "+", + RowBox[{"24", " ", + SuperscriptBox["jMax", "3"], " ", "p0", " ", "pf", " ", "v0"}], "-", + + RowBox[{"12", " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["pf", "2"], " ", "v0"}], "-", + RowBox[{"11", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["v0", "4"]}]}], ")"}], "\[Rule]", "h4"}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"reh8ah5", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"h3", "+", + SqrtBox[ + RowBox[{ + SuperscriptBox["h3", "2"], "-", + RowBox[{"4", " ", + SuperscriptBox["h4", "3"]}]}]]}], ")"}], + RowBox[{"1", "/", "3"}]], "\[Rule]", "h5"}], ",", + RowBox[{ + FractionBox["1", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"h3", "+", + SqrtBox[ + RowBox[{ + SuperscriptBox["h3", "2"], "-", + RowBox[{"4", " ", + SuperscriptBox["h4", "3"]}]}]]}], ")"}], + RowBox[{"1", "/", "3"}]]], "\[Rule]", + FractionBox["1", "h5"]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"reh8ah6", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{ + FractionBox[ + RowBox[{ + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h4"}], + RowBox[{"3", " ", "h5", " ", + SuperscriptBox["jMax", "2"], " ", "v0"}]], "+", + FractionBox["h5", + RowBox[{"3", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "2"], " ", "v0"}]]}], "\[Rule]", "h6"}], ",", + + RowBox[{ + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{ + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h4"}], + RowBox[{"3", " ", "h5", " ", + SuperscriptBox["jMax", "2"], " ", "v0"}]]}], "-", + FractionBox["h5", + RowBox[{"3", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "2"], " ", "v0"}]]}], "\[Rule]", + RowBox[{"-", "h6"}]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"reh8ah7", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{ + FractionBox[ + SuperscriptBox["h2", "2"], + SuperscriptBox["v0", "2"]], "-", + FractionBox[ + RowBox[{"2", " ", "v0"}], + RowBox[{"3", " ", "jMax"}]]}], "\[Rule]", "h7"}], ",", + RowBox[{ + RowBox[{ + FractionBox[ + RowBox[{"2", + SuperscriptBox["h2", "2"]}], + SuperscriptBox["v0", "2"]], "-", + FractionBox[ + RowBox[{"4", " ", "v0"}], + RowBox[{"3", " ", "jMax"}]]}], "\[Rule]", + RowBox[{"2", "h7"}]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"reh8ah8", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{"24", " ", "h2"}], "jMax"]}], "-", + FractionBox[ + RowBox[{"8", " ", + SuperscriptBox["h2", "3"]}], + SuperscriptBox["v0", "3"]]}], "\[Rule]", "h8"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"reh8ah9", "=", + RowBox[{"{", + RowBox[{ + SqrtBox[ + RowBox[{ + RowBox[{"-", "h6"}], "+", + RowBox[{"2", " ", "h7"}], "-", + FractionBox["h8", + RowBox[{"4", " ", + SqrtBox[ + RowBox[{"h6", "+", "h7"}]]}]]}]], "\[Rule]", "h9"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"reh8ah10", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", + FractionBox[ + SqrtBox[ + RowBox[{"h6", "+", "h7"}]], "2"]}], "+", + FractionBox["h9", "2"], "-", + FractionBox["h2", + RowBox[{"2", " ", "v0"}]]}], ")"}], "\[Rule]", "h10"}], "}"}]}], + ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"resultT2", "[", + RowBox[{"[", + RowBox[{"2", ",", "2", ",", "2"}], "]"}], "]"}], "//.", + "reh8ah1"}], "//.", "reh8ah2"}], "//.", "reh8ah3"}], "//.", + "reh8ah4"}], "//.", "reh8ah5"}], "//.", "reh8ah6"}], "//.", + "reh8ah7"}], "//.", "reh8ah8"}], "//.", "reh8ah9"}], "//.", + "reh8ah10"}]}], "Input", + CellChangeTimes->{{3.815740048138009*^9, 3.81574007083314*^9}, { + 3.815740117258108*^9, 3.815740401341085*^9}, {3.8157404418863497`*^9, + 3.8157405329579277`*^9}, {3.8157405806713743`*^9, 3.8157405807423143`*^9}, { + 3.815740703352571*^9, 3.8157407196398773`*^9}, {3.815889977006731*^9, + 3.8158899874541903`*^9}, {3.8158904706990833`*^9, 3.815890478019665*^9}, { + 3.815891008976488*^9, 3.815891027183694*^9}, {3.815891093017729*^9, + 3.815891094391883*^9}}, + CellLabel-> + "In[536]:=",ExpressionUUID->"5b2013be-ef77-489e-a566-587ef9da2842"], + +Cell[BoxData[ + RowBox[{ + RowBox[{"-", + FractionBox[ + SqrtBox[ + RowBox[{"h6", "+", "h7"}]], "2"]}], "+", + FractionBox["h9", "2"], "-", + FractionBox["p0", + RowBox[{"2", " ", "v0"}]], "+", + FractionBox["pf", + RowBox[{"2", " ", "v0"}]]}]], "Output", + CellChangeTimes->{{3.81574004986978*^9, 3.81574007106947*^9}, { + 3.815740151661414*^9, 3.8157401686379223`*^9}, {3.8157402233440228`*^9, + 3.815740322298725*^9}, {3.815740357618094*^9, 3.815740401724324*^9}, { + 3.815740442797439*^9, 3.815740471433003*^9}, {3.8157405046326437`*^9, + 3.8157405331980886`*^9}, {3.8157405810240803`*^9, + 3.8157405992000933`*^9}, {3.815740704328773*^9, 3.815740720188511*^9}, { + 3.815889958857633*^9, 3.815889987715514*^9}, 3.81589008088474*^9, + 3.8158904741709023`*^9, 3.8158910280506773`*^9, 3.8158910948465977`*^9}, + CellLabel-> + "Out[546]=",ExpressionUUID->"8de094b5-79d7-4607-8633-f89759650341"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{ + RowBox[{"resultT2", "[", + RowBox[{"[", "2", "]"}], "]"}], "/.", "tmpData"}]], "Input", + CellChangeTimes->{{3.815740667215075*^9, 3.815740673480682*^9}, { + 3.815890481491317*^9, 3.8158904933946037`*^9}}, + CellLabel-> + "In[445]:=",ExpressionUUID->"e8dc4be2-4166-475b-8d01-a9e7775232a3"], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{ + RowBox[{"t1", "\[Rule]", "1.272046026774502`"}], ",", + RowBox[{"t3", "\[Rule]", "1.2720460267745022`"}], ",", + RowBox[{"t5", "\[Rule]", "0.7862534229622212`"}], ",", + RowBox[{"t7", "\[Rule]", "0.7862534229622212`"}]}], "}"}]], "Output", + CellChangeTimes->{{3.815740669195676*^9, 3.815740673931033*^9}, + 3.81589007845704*^9, {3.815890479629612*^9, 3.8158905142997627`*^9}}, + CellLabel-> + "Out[445]=",ExpressionUUID->"b5b56605-9b4f-4d31-90d6-7a70179d8c8f"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{"Simplify", "[", + RowBox[{"(", + RowBox[{ + RowBox[{"jMax", " ", + SuperscriptBox["p0", "2"]}], "-", + RowBox[{"2", " ", "jMax", " ", "p0", " ", "pf"}], "+", + RowBox[{"jMax", " ", + SuperscriptBox["pf", "2"]}], "-", + SuperscriptBox["v0", "3"]}], ")"}], "]"}]], "Input", + CellChangeTimes->{{3.815890998031307*^9, 3.8158910172900267`*^9}, + 3.815891088362282*^9}, + CellLabel-> + "In[535]:=",ExpressionUUID->"99e31264-2035-48af-a9d9-0603ada29dda"], + +Cell[BoxData[ + RowBox[{ + RowBox[{"jMax", " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"p0", "-", "pf"}], ")"}], "2"]}], "-", + SuperscriptBox["v0", "3"]}]], "Output", + CellChangeTimes->{{3.815891004979615*^9, 3.815891017872753*^9}, + 3.8158910888265343`*^9}, + CellLabel-> + "Out[535]=",ExpressionUUID->"be660591-a124-4cf1-bb43-7d4986584014"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{ + RowBox[{"InputForm", "[", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"reh8ah7", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}], "//.", + RowBox[{"{", + RowBox[{"h9", "\[Rule]", + RowBox[{"reh8ah9", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h8", "\[Rule]", + RowBox[{"reh8ah8", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h7", "\[Rule]", + RowBox[{"reh8ah7", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h6", "\[Rule]", + RowBox[{"reh8ah6", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h5", "\[Rule]", + RowBox[{"reh8ah5", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h4", "\[Rule]", + RowBox[{"reh8ah4", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h3", "\[Rule]", + RowBox[{"reh8ah3", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h1", "\[Rule]", + RowBox[{"reh8ah1", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{"h2", "\[Rule]", + RowBox[{"reh8ah2", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "}"}]}], "/.", "tmpData"}], + "]"}], "//", "N"}]], "Input", + CellChangeTimes->{{3.815890532067903*^9, 3.8158905912993193`*^9}, { + 3.8158909481512423`*^9, 3.815890957502623*^9}}, + CellLabel-> + "In[521]:=",ExpressionUUID->"60f08c8d-f5a1-4387-96c3-66353bb727c2"], + +Cell["0.6666666666666666", "Output", + CellChangeTimes->{{3.815890565234685*^9, 3.815890591528501*^9}, { + 3.815890946732379*^9, 3.8158909577621202`*^9}}, + CellLabel-> + "Out[521]//InputForm=",ExpressionUUID->"b4382b7a-d5f6-4e82-9c17-\ +d816728b38f0"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"tmp", "=", + RowBox[{"reh8ah10", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", "tmp", "]"}], ",", "CForm"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.8157407332638474`*^9, 3.815740746368952*^9}, { + 3.8157408079130697`*^9, 3.81574088346525*^9}, {3.815890263873439*^9, + 3.81589031726505*^9}}, + CellLabel-> + "In[424]:=",ExpressionUUID->"d0cd6df5-eeac-4db9-9d40-6949ae4d86ab"], + +Cell[BoxData["\<\"-(h2 + Sqrt(h6 + h7)*v0 - h9*v0)/(2.*v0)\"\>"], "Output", + CellChangeTimes->{{3.8157407377203207`*^9, 3.815740746720797*^9}, { + 3.8157407940901012`*^9, 3.8157408837588873`*^9}, {3.8158902642581463`*^9, + 3.81589031766897*^9}}, + CellLabel-> + "Out[425]=",ExpressionUUID->"fc152dc5-6aad-4118-982d-536bcaf2a7af"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"tmp", "=", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"resultT2", "[", + RowBox[{"[", + RowBox[{"2", ",", "3", ",", "2"}], "]"}], "]"}], "//.", + "reh8ah1"}], "//.", "reh8ah2"}], "//.", "reh8ah3"}], "//.", + "reh8ah4"}], "//.", "reh8ah5"}], "//.", "reh8ah6"}], "//.", + "reh8ah7"}], "//.", "reh8ah8"}], "//.", "reh8ah9"}], "//.", + "reh8ah10"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", "tmp", "]"}], ",", "CForm"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.815740543758737*^9, 3.815740583182542*^9}, { + 3.8157408988181753`*^9, 3.815740932129665*^9}, {3.815890000006721*^9, + 3.815890021334332*^9}, {3.815890738933872*^9, 3.815890768669112*^9}}, + CellLabel-> + "In[509]:=",ExpressionUUID->"d17f9961-8b57-4df2-ba93-88cb56742150"], + +Cell[BoxData["\<\"((-1 + Sqrt(5))*Sqrt((1 + Sqrt(5))/2.)*Sqrt(-(v0/jMax)))/2.\ +\"\>"], "Output", + CellChangeTimes->{{3.8157405590472517`*^9, 3.815740583482304*^9}, { + 3.815740899558511*^9, 3.815740932648119*^9}, {3.815890000423189*^9, + 3.815890021804027*^9}, {3.815890739437933*^9, 3.815890769023649*^9}}, + CellLabel-> + "Out[510]=",ExpressionUUID->"a1f1d087-aaab-4900-8e01-e7bc67185b96"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{"InputForm", "[", + RowBox[{ + RowBox[{"resultT2", "[", + RowBox[{"[", "2", "]"}], "]"}], "/.", + RowBox[{"{", + RowBox[{ + RowBox[{"p0", "\[Rule]", "0.313"}], ",", + RowBox[{"v0", "\[Rule]", + RowBox[{"-", "0.004"}]}], ",", + RowBox[{"a0", "\[Rule]", "0.16"}], ",", + RowBox[{"pf", "\[Rule]", + RowBox[{"-", "0.98"}]}], ",", + RowBox[{"vf", "\[Rule]", "0"}], ",", + RowBox[{"vMax", "\[Rule]", + RowBox[{"-", "7.24"}]}], ",", + RowBox[{"aMax", "\[Rule]", + RowBox[{"-", "9.85"}]}], ",", + RowBox[{"jMax", "\[Rule]", + RowBox[{"-", "2.71"}]}]}], "}"}]}], "]"}]], "Input", + CellChangeTimes->{{3.815395253313322*^9, 3.815395254841237*^9}, { + 3.81539531517771*^9, 3.815395357513712*^9}, {3.815395416122316*^9, + 3.815395430201867*^9}}, + CellLabel->"In[43]:=",ExpressionUUID->"207953d0-1bf1-4c7a-b5e6-e81a13794d72"], + +Cell["\<\ +{t1 -> -0.30940737404978336 + 0.5383128602911265*I, + t3 -> -0.30940737404978336 + 0.5383128602911265*I, + t5 -> -0.3100008262861 + 0.5372823373256013*I, t7 -> -0.3100008262861 + \ +0.5372823373256013*I}\ +\>", "Output", + CellChangeTimes->{ + 3.815395256403336*^9, {3.815395317655093*^9, 3.815395357997344*^9}, { + 3.815395418173381*^9, 3.815395430772008*^9}, 3.815740031592053*^9}, + CellLabel-> + "Out[43]//InputForm=",ExpressionUUID->"a9923b67-9198-4459-a244-\ +188fb324204e"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"re8vh1", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + SuperscriptBox["a0", "3"], "+", + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"], " ", "p0"}], "-", + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"], " ", "pf"}]}], ")"}], "\[Rule]", "h1"}], + ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "3"]}], "+", + RowBox[{"3", " ", + SuperscriptBox["jMax", "5"], " ", "p0"}], "-", + RowBox[{"3", " ", + SuperscriptBox["jMax", "5"], " ", "pf"}]}], ")"}], "\[Rule]", + RowBox[{"h1", " ", + SuperscriptBox["jMax", "3"]}]}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8vh2", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", + SuperscriptBox["a0", "8"]}], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"192", " ", + SuperscriptBox["a0", "5"], " ", + SuperscriptBox["jMax", "6"], " ", "p0"}], "+", + RowBox[{"288", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "8"], " ", + SuperscriptBox["p0", "2"]}], "-", + RowBox[{"192", " ", + SuperscriptBox["a0", "5"], " ", + SuperscriptBox["jMax", "6"], " ", "pf"}], "-", + RowBox[{"576", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "8"], " ", "p0", " ", "pf"}], "+", + RowBox[{"288", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "8"], " ", + SuperscriptBox["pf", "2"]}]}], ")"}], "\[Rule]", "h2"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "108"}], " ", + SuperscriptBox["a0", "8"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"20736", " ", + SuperscriptBox["a0", "5"], " ", + SuperscriptBox["jMax", "6"], " ", "p0"}], "+", + RowBox[{"31104", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "8"], " ", + SuperscriptBox["p0", "2"]}], "-", + RowBox[{"20736", " ", + SuperscriptBox["a0", "5"], " ", + SuperscriptBox["jMax", "6"], " ", "pf"}], "-", + RowBox[{"62208", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "8"], " ", "p0", " ", "pf"}], "+", + RowBox[{"31104", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "8"], " ", + SuperscriptBox["pf", "2"]}]}], ")"}], "\[Rule]", + RowBox[{"108", "h2"}]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8vh3", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + SuperscriptBox["a0", "5"], " ", "jMax"}], "+", + RowBox[{"3", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "p0"}], "-", + RowBox[{"3", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "pf"}]}], ")"}], "\[Rule]", "h3"}], + "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8vh4", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"17", " ", + SuperscriptBox["a0", "6"]}], "+", + RowBox[{"48", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", "p0"}], "+", + RowBox[{"72", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["p0", "2"]}], "-", + RowBox[{"48", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", "pf"}], "-", + RowBox[{"144", " ", + SuperscriptBox["jMax", "4"], " ", "p0", " ", "pf"}], "+", + RowBox[{"72", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["pf", "2"]}]}], ")"}], "\[Rule]", "h4"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8vh5", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "2239488"}], " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["h3", "2"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"373248", " ", + SuperscriptBox["a0", "4"], " ", "h1", " ", "h3", " ", + SuperscriptBox["jMax", "5"]}], "+", + RowBox[{"11664", " ", + SuperscriptBox["a0", "12"], " ", + SuperscriptBox["jMax", "6"]}], "+", + RowBox[{"46656", " ", + SuperscriptBox["a0", "6"], " ", "h4", " ", + SuperscriptBox["jMax", "6"]}], "+", + RowBox[{"62208", " ", + SuperscriptBox["h1", "2"], " ", "h4", " ", + SuperscriptBox["jMax", "6"]}]}], ")"}], "\[Rule]", "h5"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8vh6", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"h5", "+", + SqrtBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "5038848"}], " ", + SuperscriptBox["h2", "3"]}], "+", + SuperscriptBox["h5", "2"]}]]}], ")"}], + RowBox[{"1", "/", "3"}]], "\[Rule]", "h6"}], ",", + RowBox[{ + FractionBox["1", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"h5", "+", + SqrtBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "5038848"}], " ", + SuperscriptBox["h2", "3"]}], "+", + SuperscriptBox["h5", "2"]}]]}], ")"}], + RowBox[{"1", "/", "3"}]]], "\[Rule]", + FractionBox["1", "h6"]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8vh7", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{ + FractionBox[ + RowBox[{ + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h2"}], + RowBox[{ + SuperscriptBox["a0", "2"], " ", "h6", " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox["h6", + RowBox[{"108", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "4"]}]]}], "\[Rule]", "h7"}], ",", + RowBox[{ + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{ + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h2"}], + RowBox[{ + SuperscriptBox["a0", "2"], " ", "h6", " ", + SuperscriptBox["jMax", "4"]}]]}], "-", + FractionBox["h6", + RowBox[{"108", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "4"]}]]}], "\[Rule]", + RowBox[{"-", "h7"}]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"re8vh8", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + SqrtBox[ + RowBox[{ + RowBox[{"-", "h7"}], "+", + FractionBox[ + SuperscriptBox["a0", "2"], + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"]}]], "+", + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["h1", "2"]}], + RowBox[{"9", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "2"]}]]}]], "\[Rule]", "h8"}], ",", + RowBox[{ + FractionBox["1", + SqrtBox[ + RowBox[{ + RowBox[{"-", "h7"}], "+", + FractionBox[ + SuperscriptBox["a0", "2"], + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"]}]], "+", + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["h1", "2"]}], + RowBox[{"9", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "2"]}]]}]]], "\[Rule]", + FractionBox["1", "h8"]}]}], "}"}]}], ";"}], + "\[IndentingNewLine]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"tmp", "=", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"resultT2", "[", + RowBox[{"[", + RowBox[{"2", ",", "3", ",", "2"}], "]"}], "]"}], "//.", + "re8vh1"}], "//.", "re8vh2"}], "//.", "re8vh3"}], "//.", + "re8vh4"}], "//.", "re8vh5"}], "//.", "re8vh6"}], "//.", "re8vh7"}], "//.", + "re8vh8"}]}], ";"}]}], "Input", + CellChangeTimes->{{3.815374502147936*^9, 3.8153748770057087`*^9}, { + 3.8153751133661737`*^9, 3.8153751479496403`*^9}, 3.8159872578720627`*^9}, + CellLabel-> + "In[287]:=",ExpressionUUID->"442edd29-4a2d-4635-95ae-97fa27ce8649"], + +Cell[BoxData[ + TemplateBox[{ + "Part","partd", + "\"Part specification \\!\\(\\*RowBox[{\\\"resultT2\\\", \\\"\ +\[LeftDoubleBracket]\\\", RowBox[{\\\"2\\\", \\\",\\\", \\\"3\\\", \\\",\\\", \ +\\\"2\\\"}], \\\"\[RightDoubleBracket]\\\"}]\\) is longer than depth of \ +object.\"",2,295,6,29511075026450517062,"Local"}, + "MessageTemplate"]], "Message", "MSG", + CellChangeTimes->{3.8159872586569147`*^9}, + CellLabel-> + "During evaluation of \ +In[287]:=",ExpressionUUID->"b69e3733-f114-4013-8b38-016fd82f995a"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"tmp", "=", + RowBox[{"re8vh8", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", "tmp", "]"}], ",", "CForm"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.815374985997416*^9, 3.815375047397421*^9}}, + CellLabel-> + "In[331]:=",ExpressionUUID->"0b1780ff-bbc7-430c-a357-bcc0107c94c0"], + +Cell[BoxData["\<\"Sqrt(-9*h7 + (3*Power(a0,6) + \ +4*Power(h1,2))/(Power(a0,4)*Power(jMax,2)))/3.\"\>"], "Output", + CellChangeTimes->{{3.8153749876966667`*^9, 3.815375047698279*^9}, + 3.8153751588872967`*^9}, + CellLabel-> + "Out[332]=",ExpressionUUID->"2b12deb0-7c86-47f9-8c49-21d21479df6a"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"tmp", "=", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"resultT2", "[", + RowBox[{"[", + RowBox[{"2", ",", "4", ",", "2"}], "]"}], "]"}], "//.", + "re8vh1"}], "//.", "re8vh2"}], "//.", "re8vh3"}], "//.", + "re8vh4"}], "//.", "re8vh5"}], "//.", "re8vh6"}], "//.", "re8vh7"}], "//.", + "re8vh8"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", "tmp", "]"}], ",", "CForm"}], "]"}], + ";"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.815374473923558*^9, 3.815374479843923*^9}, { + 3.8153748912624807`*^9, 3.8153749012534122`*^9}, {3.815375068942095*^9, + 3.81537509723733*^9}, {3.815375170263247*^9, 3.815375184605688*^9}, + 3.815987253351651*^9}, + CellLabel-> + "In[284]:=",ExpressionUUID->"cc12b157-8a11-4845-9ee7-3eb0c1917f58"], + +Cell[BoxData[ + TemplateBox[{ + "Part","partd", + "\"Part specification \\!\\(\\*RowBox[{\\\"resultT2\\\", \\\"\ +\[LeftDoubleBracket]\\\", RowBox[{\\\"2\\\", \\\",\\\", \\\"4\\\", \\\",\\\", \ +\\\"2\\\"}], \\\"\[RightDoubleBracket]\\\"}]\\) is longer than depth of \ +object.\"",2,284,1,29511075026450517062,"Local"}, + "MessageTemplate"]], "Message", "MSG", + CellChangeTimes->{3.815987254110853*^9}, + CellLabel-> + "During evaluation of \ +In[284]:=",ExpressionUUID->"a54ebb16-2066-4165-98a7-7399881597e0"], + +Cell[BoxData[ + TemplateBox[{ + "ReplaceRepeated","reps", + "\"\\!\\(\\*RowBox[{\\\"{\\\", \\\"re8vh1\\\", \\\"}\\\"}]\\) is neither a \ +list of replacement rules nor a valid dispatch table, and so cannot be used \ +for replacing.\"",2,284,2,29511075026450517062,"Local"}, + "MessageTemplate"]], "Message", "MSG", + CellChangeTimes->{3.815987254116644*^9}, + CellLabel-> + "During evaluation of \ +In[284]:=",ExpressionUUID->"c99ef6e9-de6f-4c0c-8883-624176ebb235"], + +Cell[BoxData[ + TemplateBox[{ + "ReplaceRepeated","reps", + "\"\\!\\(\\*RowBox[{\\\"{\\\", \\\"re8vh2\\\", \\\"}\\\"}]\\) is neither a \ +list of replacement rules nor a valid dispatch table, and so cannot be used \ +for replacing.\"",2,284,3,29511075026450517062,"Local"}, + "MessageTemplate"]], "Message", "MSG", + CellChangeTimes->{3.815987254167836*^9}, + CellLabel-> + "During evaluation of \ +In[284]:=",ExpressionUUID->"b699fd5e-6af5-452b-92d2-48923212eb27"], + +Cell[BoxData[ + TemplateBox[{ + "ReplaceRepeated","reps", + "\"\\!\\(\\*RowBox[{\\\"{\\\", \\\"re8vh3\\\", \\\"}\\\"}]\\) is neither a \ +list of replacement rules nor a valid dispatch table, and so cannot be used \ +for replacing.\"",2,284,4,29511075026450517062,"Local"}, + "MessageTemplate"]], "Message", "MSG", + CellChangeTimes->{3.815987254218402*^9}, + CellLabel-> + "During evaluation of \ +In[284]:=",ExpressionUUID->"69b6f969-e6fd-4a12-9b7f-500f7050c1cc"], + +Cell[BoxData[ + TemplateBox[{ + "General","stop", + "\"Further output of \\!\\(\\*StyleBox[RowBox[{\\\"ReplaceRepeated\\\", \\\ +\"::\\\", \\\"reps\\\"}], \\\"MessageName\\\"]\\) will be suppressed during \ +this calculation.\"",2,284,5,29511075026450517062,"Local"}, + "MessageTemplate"]], "Message", "MSG", + CellChangeTimes->{3.8159872542693863`*^9}, + CellLabel-> + "During evaluation of \ +In[284]:=",ExpressionUUID->"5c291c25-891e-402c-89c6-498a2e044584"] +}, Open ]], + +Cell["Brake Conditions", "Text", + CellChangeTimes->{{3.815301060071776*^9, + 3.815301062632262*^9}},ExpressionUUID->"f1f1d133-d9ee-48d8-ab08-\ +fdb8b843aed9"], + +Cell[BoxData[{ + RowBox[{ + RowBox[{ + RowBox[{"v", "[", "t_", "]"}], ":=", + RowBox[{"v0", "+", + RowBox[{"a0", " ", "t"}], "+", + RowBox[{ + FractionBox["1", "2"], "jMax", " ", + SuperscriptBox["t", "2"]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"a", "[", "t_", "]"}], ":=", + RowBox[{"a0", "+", + RowBox[{"jMax", " ", "t"}]}]}], ";"}]}], "Input", + CellChangeTimes->{{3.815301071602737*^9, 3.8153011217035503`*^9}, { + 3.815301154801783*^9, 3.8153011643431473`*^9}, {3.815302305333596*^9, + 3.815302308138749*^9}}, + CellLabel-> + "In[122]:=",ExpressionUUID->"e9b3b786-2ee6-4ad4-90fe-0843f9a56019"], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{ + RowBox[{"v", "[", "t", "]"}], "\[Equal]", "vMax"}], ",", "t"}], + "]"}]], "Input", + CellChangeTimes->{{3.815301471460462*^9, 3.815301490538836*^9}, { + 3.815301983086012*^9, 3.815302024549939*^9}, {3.8153022528546124`*^9, + 3.815302254242443*^9}, {3.815302298637886*^9, 3.815302320777072*^9}}, + CellLabel-> + "In[124]:=",ExpressionUUID->"635600fe-01e0-4d25-8184-067440ee5de9"], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{ + RowBox[{"{", + RowBox[{"t", "\[Rule]", + FractionBox[ + RowBox[{ + RowBox[{"-", "a0"}], "-", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}], "+", + RowBox[{"2", " ", "jMax", " ", "vMax"}]}]]}], "jMax"]}], "}"}], ",", + + RowBox[{"{", + RowBox[{"t", "\[Rule]", + FractionBox[ + RowBox[{ + RowBox[{"-", "a0"}], "+", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}], "+", + RowBox[{"2", " ", "jMax", " ", "vMax"}]}]]}], "jMax"]}], "}"}]}], + "}"}]], "Output", + CellChangeTimes->{ + 3.815301490911626*^9, {3.815301994594905*^9, 3.8153020101432133`*^9}, + 3.815302254650476*^9, {3.815302299835743*^9, 3.815302321158864*^9}, + 3.815385676784521*^9}, + CellLabel-> + "Out[124]=",ExpressionUUID->"778a3e8d-bcc9-4cbe-a256-9baed7c1507e"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{ + RowBox[{"v", "[", "t", "]"}], "/.", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{ + RowBox[{"a", "[", "t", "]"}], "\[Equal]", "0"}], ",", "t"}], + "]"}]}]], "Input", + CellChangeTimes->{{3.815301653860085*^9, 3.81530166410566*^9}, { + 3.8153022592708387`*^9, 3.815302267730206*^9}}, + CellLabel-> + "In[125]:=",ExpressionUUID->"75407e54-a918-40b0-94a0-d82634d676e5"], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{ + RowBox[{"-", + FractionBox[ + SuperscriptBox["a0", "2"], + RowBox[{"2", " ", "jMax"}]]}], "+", "v0"}], "}"}]], "Output", + CellChangeTimes->{ + 3.8153016643849382`*^9, {3.815302260992894*^9, 3.815302268018663*^9}, + 3.815302311068635*^9, 3.815385677960538*^9}, + CellLabel-> + "Out[125]=",ExpressionUUID->"a84f9442-a454-4874-ae35-b8c5c8fbc207"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"-", + FractionBox[ + SuperscriptBox[ + RowBox[{"a", "[", "t", "]"}], "2"], + RowBox[{ + RowBox[{"-", "2"}], " ", "jMax"}]]}], "+", "v0"}], "\[Equal]", + RowBox[{"-", "vMax"}]}], ",", "t"}], "]"}]], "Input", + CellChangeTimes->{{3.815302521676898*^9, 3.815302588738796*^9}, + 3.815303518987308*^9, {3.815385680582396*^9, 3.815385823183427*^9}, { + 3.8153859268729763`*^9, 3.815385991192477*^9}, {3.815386133297381*^9, + 3.8153861860585957`*^9}, {3.8153864300841503`*^9, 3.815386432043502*^9}}, + CellLabel-> + "In[169]:=",ExpressionUUID->"8efb60ef-a462-475b-8ff5-e51b2c982b76"], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{ + RowBox[{"{", + RowBox[{"t", "\[Rule]", + FractionBox[ + RowBox[{ + RowBox[{"-", "a0"}], "-", + RowBox[{ + SqrtBox["2"], " ", + SqrtBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "jMax"}], " ", "v0"}], "-", + RowBox[{"jMax", " ", "vMax"}]}]]}]}], "jMax"]}], "}"}], ",", + RowBox[{"{", + RowBox[{"t", "\[Rule]", + FractionBox[ + RowBox[{ + RowBox[{"-", "a0"}], "+", + RowBox[{ + SqrtBox["2"], " ", + SqrtBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "jMax"}], " ", "v0"}], "-", + RowBox[{"jMax", " ", "vMax"}]}]]}]}], "jMax"]}], "}"}]}], + "}"}]], "Output", + CellChangeTimes->{{3.815302543863489*^9, 3.815302548690042*^9}, + 3.815302581860752*^9, 3.8153035193545303`*^9, {3.8153856737850246`*^9, + 3.815385823879335*^9}, {3.815385927501169*^9, 3.8153859915521183`*^9}, { + 3.815386133777218*^9, 3.815386186730319*^9}, {3.815386430556628*^9, + 3.815386432429397*^9}}, + CellLabel-> + "Out[169]=",ExpressionUUID->"f3046318-00c5-4e1d-967a-6f60d1eb4324"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{ + RowBox[{"v0", "+", + RowBox[{"a0", " ", "t"}], "+", + RowBox[{ + FractionBox["1", "2"], "jMax", " ", + SuperscriptBox["t", "2"]}]}], "\[Equal]", "vMax"}], ",", "t"}], "]"}], + "//.", + RowBox[{"{", + RowBox[{ + RowBox[{"a0", "\[Rule]", "aMax"}], ",", + RowBox[{"v0", "\[Rule]", + RowBox[{"-", "0.585176"}]}], ",", + RowBox[{"vMax", "\[Rule]", "0.18"}], ",", + RowBox[{"aMax", "\[Rule]", "1.3"}], ",", + RowBox[{"jMax", "\[Rule]", "6.8"}]}], "}"}]}]], "Input", + CellChangeTimes->{{3.8153861907135763`*^9, 3.81538630616269*^9}}, + CellLabel-> + "In[167]:=",ExpressionUUID->"38121ff9-6236-4cfd-98df-aef065814608"], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{ + RowBox[{"{", + RowBox[{"t", "\[Rule]", + RowBox[{"-", "0.7026451476472091`"}]}], "}"}], ",", + RowBox[{"{", + RowBox[{"t", "\[Rule]", "0.32029220647073836`"}], "}"}]}], + "}"}]], "Output", + CellChangeTimes->{{3.815386212264332*^9, 3.815386306516597*^9}}, + CellLabel-> + "Out[167]=",ExpressionUUID->"c3269006-4fb2-4435-a3e6-883665db4f7f"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"-", + FractionBox[ + SuperscriptBox["a0", "2"], + RowBox[{ + RowBox[{"-", "2"}], " ", "jMax"}]]}], "+", "v0", "+", + RowBox[{"a0", " ", "t"}]}], "\[Equal]", "vMax"}], ",", "t"}], + "]"}]], "Input", + CellChangeTimes->{{3.815386483419574*^9, 3.815386599085203*^9}, { + 3.8153869341443157`*^9, 3.815387057583847*^9}, {3.815387110936233*^9, + 3.8153871111355352`*^9}, 3.815387215488923*^9, {3.815387246273223*^9, + 3.815387246376728*^9}, {3.8153873818509274`*^9, 3.815387386722125*^9}}, + CellLabel-> + "In[194]:=",ExpressionUUID->"210a25f2-9b17-4e4b-bc3f-6f2e7a55ac8f"], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{"{", + RowBox[{"t", "\[Rule]", + FractionBox[ + RowBox[{ + RowBox[{"-", + SuperscriptBox["a0", "2"]}], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}], "+", + RowBox[{"2", " ", "jMax", " ", "vMax"}]}], + RowBox[{"2", " ", "a0", " ", "jMax"}]]}], "}"}], "}"}]], "Output", + CellChangeTimes->{{3.815386498393416*^9, 3.815386599452407*^9}, { + 3.815386946414404*^9, 3.8153869945351954`*^9}, {3.815387026438641*^9, + 3.8153870579233007`*^9}, 3.815387112293728*^9, 3.8153872160448503`*^9, + 3.815387246688963*^9, {3.8153873822076607`*^9, 3.8153873870569553`*^9}}, + CellLabel-> + "Out[194]=",ExpressionUUID->"e39c0b7c-dbb9-40cb-82ec-435732f72361"] +}, Open ]], + +Cell["Phase Synchronization", "Text", + CellChangeTimes->{{3.8159909792098837`*^9, + 3.815990981978018*^9}},ExpressionUUID->"8b34fb16-e770-4cee-997d-\ +af6ae162774a"], + +Cell[BoxData[ + RowBox[{ + RowBox[{"resultVelFor3", "=", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"(", + RowBox[{ + "t1", "+", "t2", "+", "t3", "+", "t4", "+", "t5", "+", "t6", "+", + "t7"}], ")"}], "/.", + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}]}], ")"}], "\[Equal]", "tf"}], + ",", "vMax"}], "]"}]}], ";"}]], "Input", + CellChangeTimes->{{3.815990987482593*^9, 3.815990996218176*^9}, { + 3.815991179509677*^9, 3.815991247652124*^9}, {3.8159915274071093`*^9, + 3.8159915274703493`*^9}, {3.816000544011639*^9, 3.816000553594927*^9}, { + 3.816000591220166*^9, 3.816000599779604*^9}, {3.81600077447803*^9, + 3.81600078642868*^9}, {3.816000922574823*^9, 3.8160009293583603`*^9}, { + 3.8160010545992823`*^9, 3.816001055334835*^9}}, + CellLabel->"In[52]:=",ExpressionUUID->"7ebcc624-4790-4f4f-81fc-cff868e873d2"], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"tmp", "=", + RowBox[{"resultVelFor3", "[", + RowBox[{"[", + RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{"ToString", "[", + RowBox[{"tmp", ",", "CForm"}], "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.81600079426126*^9, 3.816000826517199*^9}, { + 3.816000933846458*^9, 3.816000938973981*^9}}, + CellLabel->"In[53]:=",ExpressionUUID->"bc26ad4d-e812-4149-af6b-c1c0eb6177e5"], + +Cell[BoxData["\<\"(-12*Power(a0,2)*jMax + 24*a0*aMax*jMax - \ +24*Power(aMax,2)*jMax + 24*aMax*Power(jMax,2)*tf + 24*Power(jMax,2)*v0 + \ +24*Power(jMax,2)*vf - Sqrt(Power(12*Power(a0,2)*jMax - 24*a0*aMax*jMax + \ +24*Power(aMax,2)*jMax - 24*aMax*Power(jMax,2)*tf - 24*Power(jMax,2)*v0 - \ +24*Power(jMax,2)*vf,2) - 96*Power(jMax,2)*(3*Power(a0,4) - 8*Power(a0,3)*aMax \ ++ 6*Power(a0,2)*Power(aMax,2) - 24*aMax*Power(jMax,2)*p0 + \ +24*aMax*Power(jMax,2)*pf - 12*Power(a0,2)*jMax*v0 + 24*a0*aMax*jMax*v0 - \ +12*Power(aMax,2)*jMax*v0 + 12*Power(jMax,2)*Power(v0,2) - \ +12*Power(aMax,2)*jMax*vf + \ +12*Power(jMax,2)*Power(vf,2))))/(48.*Power(jMax,2))\"\>"], "Output", + CellChangeTimes->{{3.816000802684245*^9, 3.816000826995872*^9}, { + 3.816000936759197*^9, 3.816000939388649*^9}, 3.816001058122096*^9}, + CellLabel->"Out[54]=",ExpressionUUID->"b5dba983-9cab-41cd-94fa-29a133fc2a00"] +}, Open ]], + +Cell[BoxData[ + RowBox[{ + RowBox[{"resultT", "=", + RowBox[{"{", "\[IndentingNewLine]", + RowBox[{ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"a1", "\[Equal]", "aMax"}], ",", + RowBox[{"a5", "\[Equal]", + RowBox[{"-", "aMax"}]}], ",", + RowBox[{"v3", "\[Equal]", "vMax"}]}], "}"}], ",", "tVars"}], "]"}], + ",", "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"a1", "\[Equal]", "aMax"}], ",", + RowBox[{"a5", "\[Equal]", + RowBox[{"-", "aMax"}]}], ",", + RowBox[{"t4", "\[Equal]", "0"}]}], "}"}], ",", "tVars"}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"a5", "\[Equal]", + RowBox[{"-", "aMax"}]}], ",", + RowBox[{"v3", "\[Equal]", "vMax"}]}], "}"}], ",", "tVars"}], "]"}], + ",", "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"a1", "\[Equal]", "aMax"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"v3", "\[Equal]", "vMax"}]}], "}"}], ",", "tVars"}], "]"}], + ",", "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"v3", "\[Equal]", "vMax"}]}], "}"}], ",", "tVars"}], "]"}], + ",", "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"a5", "\[Equal]", + RowBox[{"-", "aMax"}]}], ",", + RowBox[{"t4", "\[Equal]", "0"}]}], "}"}], ",", "tVars"}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"a1", "\[Equal]", "aMax"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"t4", "\[Equal]", "0"}]}], "}"}], ",", "tVars"}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"t4", "\[Equal]", "0"}]}], "}"}], ",", "tVars"}], "]"}]}], + "\[IndentingNewLine]", "}"}]}], ";"}]], "Input",ExpressionUUID->"1dfbc9a4-\ +9fef-4950-b9ec-46105d83f74a"] +}, +WindowSize->{1580, 1058}, +WindowMargins->{{Automatic, 439}, {-138, Automatic}}, +FrontEndVersion->"12.0 for Linux x86 (64-bit) (April 8, 2019)", +StyleDefinitions->"Default.nb" +] +(* End of Notebook Content *) + +(* Internal cache information *) +(*CellTagsOutline +CellTagsIndex->{} +*) +(*CellTagsIndex +CellTagsIndex->{} +*) +(*NotebookFileOutline +Notebook[{ +Cell[558, 20, 371, 7, 60, "Text",ExpressionUUID->"6747c71c-c66c-433d-9613-bddcf8a50059"], +Cell[932, 29, 1482, 34, 78, "Input",ExpressionUUID->"eaed5991-b6cc-4fdf-bc63-1d49408dff17"], +Cell[2417, 65, 748, 18, 55, "Input",ExpressionUUID->"582d570a-5169-47df-b546-722be9ef7658"], +Cell[3168, 85, 6416, 202, 835, "Input",ExpressionUUID->"8f6504f9-2554-4bf6-b7e0-31a28a689144"], +Cell[9587, 289, 4845, 118, 262, "Input",ExpressionUUID->"949497de-8cba-4eb9-93ab-b867d25cac1b"], +Cell[14435, 409, 1024, 17, 36, "Text",ExpressionUUID->"5d45ab23-1fee-430c-90e5-5f8b0e08bfb1"], +Cell[15462, 428, 1425, 28, 31, "Input",ExpressionUUID->"0d917997-47ce-4513-8d74-2b5287a21e54"], +Cell[CellGroupData[{ +Cell[16912, 460, 604, 14, 31, "Input",ExpressionUUID->"e30a8adc-f57d-4ea5-af7e-e23e77c045e9"], +Cell[17519, 476, 3740, 80, 121, "Output",ExpressionUUID->"aaf913f0-5415-4bca-b861-f7784c84d612"] +}, Open ]], +Cell[CellGroupData[{ +Cell[21296, 561, 810, 21, 31, "Input",ExpressionUUID->"955a5b3f-9dc7-495c-a7ca-c9e014c5911a"], +Cell[22109, 584, 373, 9, 69, "Output",ExpressionUUID->"9ae71f1f-c27a-42d4-875f-68090daded79"] +}, Open ]], +Cell[CellGroupData[{ +Cell[22519, 598, 716, 15, 55, "Input",ExpressionUUID->"ee2d0080-8083-421d-84f9-5778554cf350"], +Cell[23238, 615, 1148, 16, 35, "Output",ExpressionUUID->"91a6267d-acc2-4b80-bf23-1a8d53d5900c"] +}, Open ]], +Cell[24401, 634, 162, 3, 36, "Text",ExpressionUUID->"b48157a9-54ec-478e-9180-6dc7afbc31e8"], +Cell[CellGroupData[{ +Cell[24588, 641, 69418, 1856, 2872, "Input",ExpressionUUID->"c2da0558-3f7e-405c-ab66-8bcbea5dd387"], +Cell[94009, 2499, 1526, 36, 76, "Output",ExpressionUUID->"13a8c792-240d-48c4-af08-56e65978c662"] +}, Open ]], +Cell[CellGroupData[{ +Cell[95572, 2540, 1086, 26, 78, "Input",ExpressionUUID->"d523a624-3b93-40a2-93e6-6b66fb9d315f"], +Cell[96661, 2568, 1283, 18, 35, "Output",ExpressionUUID->"5321db0d-fb90-4f4f-abeb-c62bf1bb1720"] +}, Open ]], +Cell[CellGroupData[{ +Cell[97981, 2591, 645, 18, 31, "Input",ExpressionUUID->"75d52310-ce4b-4cce-88e2-852c0f8332fd"], +Cell[98629, 2611, 356, 9, 57, "Output",ExpressionUUID->"5df6b9e8-d4e9-4ac4-a5f5-4ec25d5911b8"] +}, Open ]], +Cell[CellGroupData[{ +Cell[99022, 2625, 1526, 46, 55, "Input",ExpressionUUID->"9a9e423d-663d-4a9b-bd16-d3038453a5dc"], +Cell[100551, 2673, 302, 5, 37, "Output",ExpressionUUID->"fb3d249f-7bb9-4dfd-8b76-b9aff446979a"] +}, Open ]], +Cell[CellGroupData[{ +Cell[100890, 2683, 1425, 44, 55, "Input",ExpressionUUID->"d368fa06-8f72-4672-954c-13891a615a2f"], +Cell[102318, 2729, 171, 3, 35, "Output",ExpressionUUID->"f6a3921b-b6f2-4b49-9a43-c81a6a92d8d1"] +}, Open ]], +Cell[CellGroupData[{ +Cell[102526, 2737, 1260, 32, 78, "Input",ExpressionUUID->"8c022a9d-f36b-4f78-b67d-a170aff14a0f"], +Cell[103789, 2771, 442, 7, 35, "Output",ExpressionUUID->"402f659c-f0f3-4a81-b1ed-fd2f58b2741c"] +}, Open ]], +Cell[CellGroupData[{ +Cell[104268, 2783, 1023, 27, 78, "Input",ExpressionUUID->"60a32fc0-d69a-4463-a61a-61ba7f976211"], +Cell[105294, 2812, 337, 5, 35, "Output",ExpressionUUID->"a303f13e-5980-4522-98f2-f738edcb2ec7"] +}, Open ]], +Cell[CellGroupData[{ +Cell[105668, 2822, 2585, 54, 124, "Input",ExpressionUUID->"fac44215-a6b1-4043-8264-95800ba8898b"], +Cell[108256, 2878, 1143, 16, 35, "Output",ExpressionUUID->"884d06da-74f6-4a15-afff-b33bc16cf337"] +}, Open ]], +Cell[109414, 2897, 214, 5, 36, "Text",ExpressionUUID->"51e771c4-f7f9-485c-92b2-f4c257aec521"], +Cell[109631, 2904, 4480, 105, 239, "Input",ExpressionUUID->"3668a80c-a752-4998-9de9-1f6e3e889e32"], +Cell[CellGroupData[{ +Cell[114136, 3013, 515, 9, 55, "Input",ExpressionUUID->"4acef3d2-b8a0-495f-aa8e-89472efd7a84"], +Cell[114654, 3024, 394, 6, 59, "Output",ExpressionUUID->"e6826988-cc45-46e3-83dc-e9521da2f200"] +}, Open ]], +Cell[115063, 3033, 271, 4, 36, "Text",ExpressionUUID->"4b4ef72e-c306-481e-95b2-18b8f25a9242"], +Cell[115337, 3039, 649, 17, 31, "Input",ExpressionUUID->"dacaf799-7636-4d00-9aab-abdd0ce66871"], +Cell[CellGroupData[{ +Cell[116011, 3060, 546, 13, 55, "Input",ExpressionUUID->"e4ffe61d-6b27-4e44-8719-5381389d90d5"], +Cell[116560, 3075, 797, 12, 82, "Output",ExpressionUUID->"af6ab366-a1be-4d9c-a40a-95551857bbd1"] +}, Open ]], +Cell[117372, 3090, 416, 8, 36, "Text",ExpressionUUID->"9c0ba946-2fb4-4a4b-a305-4d0102c9636e"], +Cell[117791, 3100, 3788, 118, 474, "Input",ExpressionUUID->"01d94644-43f4-4ebf-b9dd-650c0bcc93aa"], +Cell[121582, 3220, 830, 20, 31, "Input",ExpressionUUID->"ccac5833-2cc2-4703-8af2-4673d2c0a437"], +Cell[CellGroupData[{ +Cell[122437, 3244, 576, 15, 31, "Input",ExpressionUUID->"61a3a1a2-df88-4692-9d53-69048ae8b464"], +Cell[123016, 3261, 1991, 50, 59, "Output",ExpressionUUID->"01b5369a-1faf-4b6b-b03a-60da9f7755b3"] +}, Open ]], +Cell[CellGroupData[{ +Cell[125044, 3316, 642, 14, 55, "Input",ExpressionUUID->"cb873fd7-3018-44f7-9abe-77d6cc7ffa45"], +Cell[125689, 3332, 290, 5, 35, "Output",ExpressionUUID->"bcf5a353-db32-45fd-9ee6-ab29cf578f4a"] +}, Open ]], +Cell[125994, 3340, 236, 4, 36, "Text",ExpressionUUID->"f3928d4d-4e0e-400f-97cb-f9a8d134e403"], +Cell[126233, 3346, 3788, 117, 474, "Input",ExpressionUUID->"e3dd8e3d-e0d1-4281-9358-2ac240171bc7"], +Cell[130024, 3465, 820, 19, 31, "Input",ExpressionUUID->"0f9d0752-03b0-4070-9d39-4699458a4a2b"], +Cell[CellGroupData[{ +Cell[130869, 3488, 2531, 84, 172, "Input",ExpressionUUID->"efd78a19-7576-461b-92ad-f8a6b029f2bf"], +Cell[133403, 3574, 2382, 82, 174, "Output",ExpressionUUID->"9418e426-c046-4fe6-a082-f164061801ff"] +}, Open ]], +Cell[135800, 3659, 323, 7, 31, "Input",ExpressionUUID->"9105b557-b172-46e2-b7d1-beface9f3e18"], +Cell[136126, 3668, 250, 6, 31, "Input",ExpressionUUID->"391446f1-0939-4759-b03d-76f62902beed"], +Cell[CellGroupData[{ +Cell[136401, 3678, 252, 6, 31, "Input",ExpressionUUID->"e86cb307-7d12-4f90-a085-600124212b0a"], +Cell[136656, 3686, 362, 8, 35, "Output",ExpressionUUID->"a780a68b-6b33-43dc-b94f-5ece8d7b0e06"] +}, Open ]], +Cell[137033, 3697, 979, 27, 31, "Input",ExpressionUUID->"dae8256b-9c13-46a7-b508-0f10b1105bf5"], +Cell[CellGroupData[{ +Cell[138037, 3728, 543, 13, 31, "Input",ExpressionUUID->"e47326ee-0a23-43f2-9dae-3b16fc92e7fc"], +Cell[138583, 3743, 524, 9, 37, "Output",ExpressionUUID->"e06aeefa-c9d8-4b6f-998f-ceb064dd2a1b"] +}, Open ]], +Cell[CellGroupData[{ +Cell[139144, 3757, 7957, 253, 581, "Input",ExpressionUUID->"1aa963a1-ace0-47ca-b2e8-3de5ccddfd8b"], +Cell[147104, 4012, 1071, 28, 62, "Output",ExpressionUUID->"8dd47181-8e6e-40f3-840a-ca92193b2777"] +}, Open ]], +Cell[CellGroupData[{ +Cell[148212, 4045, 395, 11, 31, "Input",ExpressionUUID->"df0815ab-ee6e-496f-97eb-115430cbd729"], +Cell[148610, 4058, 323, 7, 37, "Output",ExpressionUUID->"05459621-ea5b-483e-9bab-31ada7245bcd"] +}, Open ]], +Cell[CellGroupData[{ +Cell[148970, 4070, 1942, 54, 55, "Input",ExpressionUUID->"53fa214f-d4c0-4ef2-88df-6c9125558a0e"], +Cell[150915, 4126, 634, 10, 35, "Output",ExpressionUUID->"df3a3d30-fd26-4b6f-a465-ea2b7d58e36c"] +}, Open ]], +Cell[CellGroupData[{ +Cell[151586, 4141, 116, 2, 31, "Input",ExpressionUUID->"46778d8f-685d-48dd-a5a9-6d761be7f0bf"], +Cell[151705, 4145, 579, 16, 35, "Output",ExpressionUUID->"c1552803-093b-4ab9-9649-d9dc79af7e57"] +}, Open ]], +Cell[CellGroupData[{ +Cell[152321, 4166, 608, 15, 78, "Input",ExpressionUUID->"474381ce-6028-4454-b840-5a5643c6fcce"], +Cell[152932, 4183, 435, 7, 35, "Output",ExpressionUUID->"40a01ef1-7c61-42c3-b1e4-70d2edfe492b"] +}, Open ]], +Cell[CellGroupData[{ +Cell[153404, 4195, 264, 7, 31, "Input",ExpressionUUID->"7ddc8285-0ee6-4f4c-96a4-eca74fc86b7d"], +Cell[153671, 4204, 184, 4, 35, "Output",ExpressionUUID->"db03dd97-17bc-4036-ba73-3c0d6137fd95"] +}, Open ]], +Cell[CellGroupData[{ +Cell[153892, 4213, 1143, 30, 78, "Input",ExpressionUUID->"6c4723ac-7cf5-426c-a3d2-98c88254c5ef"], +Cell[155038, 4245, 454, 7, 35, "Output",ExpressionUUID->"748b4442-c6b5-4e58-9383-0c87c8e79669"] +}, Open ]], +Cell[155507, 4255, 165, 3, 36, "Text",ExpressionUUID->"07e75525-b632-484e-9ec9-284d76c627c3"], +Cell[CellGroupData[{ +Cell[155697, 4262, 8368, 259, 532, "Input",ExpressionUUID->"5b2013be-ef77-489e-a566-587ef9da2842"], +Cell[164068, 4523, 916, 20, 58, "Output",ExpressionUUID->"8de094b5-79d7-4607-8633-f89759650341"] +}, Open ]], +Cell[CellGroupData[{ +Cell[165021, 4548, 315, 7, 31, "Input",ExpressionUUID->"e8dc4be2-4166-475b-8d01-a9e7775232a3"], +Cell[165339, 4557, 510, 10, 35, "Output",ExpressionUUID->"b5b56605-9b4f-4d31-90d6-7a70179d8c8f"] +}, Open ]], +Cell[CellGroupData[{ +Cell[165886, 4572, 494, 13, 39, "Input",ExpressionUUID->"99e31264-2035-48af-a9d9-0603ada29dda"], +Cell[166383, 4587, 356, 10, 37, "Output",ExpressionUUID->"be660591-a124-4cf1-bb43-7d4986584014"] +}, Open ]], +Cell[CellGroupData[{ +Cell[166776, 4602, 2320, 65, 78, "Input",ExpressionUUID->"60f08c8d-f5a1-4387-96c3-66353bb727c2"], +Cell[169099, 4669, 249, 5, 50, "Output",ExpressionUUID->"b4382b7a-d5f6-4e82-9c17-d816728b38f0"] +}, Open ]], +Cell[CellGroupData[{ +Cell[169385, 4679, 606, 15, 78, "Input",ExpressionUUID->"d0cd6df5-eeac-4db9-9d40-6949ae4d86ab"], +Cell[169994, 4696, 329, 5, 35, "Output",ExpressionUUID->"fc152dc5-6aad-4118-982d-536bcaf2a7af"] +}, Open ]], +Cell[CellGroupData[{ +Cell[170360, 4706, 1096, 29, 78, "Input",ExpressionUUID->"d17f9961-8b57-4df2-ba93-88cb56742150"], +Cell[171459, 4737, 391, 6, 35, "Output",ExpressionUUID->"a1f1d087-aaab-4900-8e01-e7bc67185b96"] +}, Open ]], +Cell[CellGroupData[{ +Cell[171887, 4748, 901, 23, 31, "Input",ExpressionUUID->"207953d0-1bf1-4c7a-b5e6-e81a13794d72"], +Cell[172791, 4773, 486, 11, 88, "Output",ExpressionUUID->"a9923b67-9198-4459-a244-188fb324204e"] +}, Open ]], +Cell[CellGroupData[{ +Cell[173314, 4789, 8794, 261, 460, "Input",ExpressionUUID->"442edd29-4a2d-4635-95ae-97fa27ce8649"], +Cell[182111, 5052, 507, 11, 23, "Message",ExpressionUUID->"b69e3733-f114-4013-8b38-016fd82f995a"] +}, Open ]], +Cell[CellGroupData[{ +Cell[182655, 5068, 504, 13, 78, "Input",ExpressionUUID->"0b1780ff-bbc7-430c-a357-bcc0107c94c0"], +Cell[183162, 5083, 292, 5, 35, "Output",ExpressionUUID->"2b12deb0-7c86-47f9-8c49-21d21479df6a"] +}, Open ]], +Cell[CellGroupData[{ +Cell[183491, 5093, 1037, 28, 78, "Input",ExpressionUUID->"cc12b157-8a11-4845-9ee7-3eb0c1917f58"], +Cell[184531, 5123, 505, 11, 23, "Message",ExpressionUUID->"a54ebb16-2066-4165-98a7-7399881597e0"], +Cell[185039, 5136, 460, 10, 23, "Message",ExpressionUUID->"c99ef6e9-de6f-4c0c-8883-624176ebb235"], +Cell[185502, 5148, 460, 10, 23, "Message",ExpressionUUID->"b699fd5e-6af5-452b-92d2-48923212eb27"], +Cell[185965, 5160, 460, 10, 23, "Message",ExpressionUUID->"69b6f969-e6fd-4a12-9b7f-500f7050c1cc"], +Cell[186428, 5172, 456, 10, 23, "Message",ExpressionUUID->"5c291c25-891e-402c-89c6-498a2e044584"] +}, Open ]], +Cell[186899, 5185, 158, 3, 36, "Text",ExpressionUUID->"f1f1d133-d9ee-48d8-ab08-fdb8b843aed9"], +Cell[187060, 5190, 648, 18, 73, "Input",ExpressionUUID->"e9b3b786-2ee6-4ad4-90fe-0843f9a56019"], +Cell[CellGroupData[{ +Cell[187733, 5212, 443, 10, 31, "Input",ExpressionUUID->"635600fe-01e0-4d25-8184-067440ee5de9"], +Cell[188179, 5224, 976, 30, 67, "Output",ExpressionUUID->"778a3e8d-bcc9-4cbe-a256-9baed7c1507e"] +}, Open ]], +Cell[CellGroupData[{ +Cell[189192, 5259, 400, 11, 31, "Input",ExpressionUUID->"75407e54-a918-40b0-94a0-d82634d676e5"], +Cell[189595, 5272, 397, 11, 61, "Output",ExpressionUUID->"a84f9442-a454-4874-ae35-b8c5c8fbc207"] +}, Open ]], +Cell[CellGroupData[{ +Cell[190029, 5288, 698, 17, 57, "Input",ExpressionUUID->"8efb60ef-a462-475b-8ff5-e51b2c982b76"], +Cell[190730, 5307, 1127, 34, 61, "Output",ExpressionUUID->"f3046318-00c5-4e1d-967a-6f60d1eb4324"] +}, Open ]], +Cell[CellGroupData[{ +Cell[191894, 5346, 731, 21, 49, "Input",ExpressionUUID->"38121ff9-6236-4cfd-98df-aef065814608"], +Cell[192628, 5369, 393, 11, 35, "Output",ExpressionUUID->"c3269006-4fb2-4435-a3e6-883665db4f7f"] +}, Open ]], +Cell[CellGroupData[{ +Cell[193058, 5385, 685, 17, 57, "Input",ExpressionUUID->"210a25f2-9b17-4e4b-bc3f-6f2e7a55ac8f"], +Cell[193746, 5404, 713, 16, 61, "Output",ExpressionUUID->"e39c0b7c-dbb9-40cb-82ec-435732f72361"] +}, Open ]], +Cell[194474, 5423, 165, 3, 36, "Text",ExpressionUUID->"8b34fb16-e770-4cee-997d-af6ae162774a"], +Cell[194642, 5428, 962, 22, 31, "Input",ExpressionUUID->"7ebcc624-4790-4f4f-81fc-cff868e873d2"], +Cell[CellGroupData[{ +Cell[195629, 5454, 529, 12, 78, "Input",ExpressionUUID->"bc26ad4d-e812-4149-af6b-c1c0eb6177e5"], +Cell[196161, 5468, 877, 12, 105, "Output",ExpressionUUID->"b5dba983-9cab-41cd-94fa-29a133fc2a00"] +}, Open ]], +Cell[197053, 5483, 4161, 105, 239, "Input",ExpressionUUID->"1dfbc9a4-9fef-4950-b9ec-46105d83f74a"] +} +] +*) + diff --git a/notebooks/ruckig-step2.nb b/notebooks/ruckig-step2.nb new file mode 100644 index 00000000..877c330e --- /dev/null +++ b/notebooks/ruckig-step2.nb @@ -0,0 +1,7963 @@ +(* Content-type: application/vnd.wolfram.mathematica *) + +(*** Wolfram Notebook File ***) +(* http://www.wolfram.com/nb *) + +(* CreatedBy='Mathematica 12.0' *) + +(*CacheID: 234*) +(* Internal cache information: +NotebookFileLineBreakTest +NotebookFileLineBreakTest +NotebookDataPosition[ 158, 7] +NotebookDataLength[ 313168, 7955] +NotebookOptionsPosition[ 302572, 7779] +NotebookOutlinePosition[ 302940, 7795] +CellTagsIndexPosition[ 302897, 7792] +WindowFrame->Normal*) + +(* Beginning of Notebook Content *) +Notebook[{ +Cell["Ruckig OTG", "title", + CellChangeTimes->{{3.817012987826033*^9, + 3.817012990167431*^9}},ExpressionUUID->"6a564cc6-a23e-4a5a-8ee9-\ +69267da34876"], + +Cell[BoxData[ + RowBox[{ + RowBox[{"toCCode", "[", + RowBox[{"result_", ",", "case_", ",", "n_", ",", "solution_"}], "]"}], ":=", + RowBox[{"Module", "[", + RowBox[{ + RowBox[{"{", "}"}], ",", "\[IndentingNewLine]", + RowBox[{"Return", "[", + RowBox[{"\"\\"", "<>", + RowBox[{"ToString", "[", + RowBox[{"n", "-", "1"}], "]"}], "<>", "\"\<] = \>\"", "<>", + RowBox[{"StringDelete", "[", + RowBox[{ + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{ + RowBox[{"Refine", "[", + RowBox[{"result", "[", + RowBox[{"[", + RowBox[{"case", ",", "solution", ",", "n", ",", "2"}], "]"}], + "]"}], "]"}], ",", + RowBox[{"{", + RowBox[{"jMax", "\[Element]", "Reals"}], "}"}]}], "]"}], ",", + "CForm"}], "]"}], ",", "\"\<\\\"\>\""}], "]"}], "<>", + "\"\<;\\n\>\""}], "]"}]}], "\[IndentingNewLine]", "]"}]}]], "Input", + CellLabel->"In[1]:=",ExpressionUUID->"bcd06c4f-cbaa-4b1b-a6b1-5c4ac4a41442"], + +Cell[BoxData[{ + RowBox[{ + RowBox[{"jerkProfileUDDU", "=", + RowBox[{"{", + RowBox[{"jMax", ",", "0", ",", + RowBox[{"-", "jMax"}], ",", "0", ",", + RowBox[{"-", "jMax"}], ",", "0", ",", "jMax"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"jerkProfileUDUD", "=", + RowBox[{"{", + RowBox[{"jMax", ",", "0", ",", + RowBox[{"-", "jMax"}], ",", "0", ",", "jMax", ",", "0", ",", + RowBox[{"-", "jMax"}]}], "}"}]}], ";"}]}], "Input", + CellChangeTimes->{{3.817180371717247*^9, 3.817180380946725*^9}}, + CellLabel-> + "In[280]:=",ExpressionUUID->"5a5138b0-8941-429f-a081-6482a01195c5"], + +Cell[BoxData[{ + RowBox[{ + RowBox[{ + RowBox[{"jerkProfile", "=", "jerkProfileUDDU"}], ";"}], + "\[IndentingNewLine]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"a1", "=", + RowBox[{"a0", "+", + RowBox[{"t1", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "1", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"a2", "=", + RowBox[{"a1", "+", + RowBox[{"t2", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "2", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"a3", "=", + RowBox[{"a2", "+", + RowBox[{"t3", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "3", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"a4", "=", + RowBox[{"a3", "+", + RowBox[{"t4", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "4", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"a5", "=", + RowBox[{"a4", "+", + RowBox[{"t5", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "5", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"a6", "=", + RowBox[{"a5", "+", + RowBox[{"t6", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "6", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"a7", "=", + RowBox[{"a6", "+", + RowBox[{"t7", " ", + RowBox[{"jerkProfile", "[", + RowBox[{"[", "7", "]"}], "]"}]}]}]}], ";"}], + "\[IndentingNewLine]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"v1", "=", + RowBox[{"v0", "+", + RowBox[{"t1", " ", "a0"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t1", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "1", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"v2", "=", + RowBox[{"v1", "+", + RowBox[{"t2", " ", "a1"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t2", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "2", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"v3", "=", + RowBox[{"v2", "+", + RowBox[{"t3", " ", "a2"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t3", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "3", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"v4", "=", + RowBox[{"v3", "+", + RowBox[{"t4", " ", "a3"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t4", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "4", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"v5", "=", + RowBox[{"v4", "+", + RowBox[{"t5", " ", "a4"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t5", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "5", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"v6", "=", + RowBox[{"v5", "+", + RowBox[{"t6", " ", "a5"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t6", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "6", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"v7", "=", + RowBox[{"v6", "+", + RowBox[{"t7", " ", "a6"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t7", "2"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "7", "]"}], "]"}]}]}]}], ";"}], + "\[IndentingNewLine]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"p1", "=", + RowBox[{"p0", "+", + RowBox[{"t1", " ", "v0"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t1", "2"], " ", "a0"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t1", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "1", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"p2", "=", + RowBox[{"p1", "+", + RowBox[{"t2", " ", "v1"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t2", "2"], " ", "a1"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t2", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "2", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"p3", "=", + RowBox[{"p2", "+", + RowBox[{"t3", " ", "v2"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t3", "2"], " ", "a2"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t3", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "3", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"p4", "=", + RowBox[{"p3", "+", + RowBox[{"t4", " ", "v3"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t4", "2"], " ", "a3"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t4", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "4", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"p5", "=", + RowBox[{"p4", "+", + RowBox[{"t5", " ", "v4"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t5", "2"], " ", "a4"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t5", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "5", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"p6", "=", + RowBox[{"p5", "+", + RowBox[{"t6", " ", "v5"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t6", "2"], " ", "a5"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t6", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "6", "]"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"p7", "=", + RowBox[{"p6", "+", + RowBox[{"t7", " ", "v6"}], "+", + RowBox[{ + FractionBox["1", "2"], + SuperscriptBox["t7", "2"], " ", "a6"}], "+", + RowBox[{ + FractionBox["1", "6"], + SuperscriptBox["t7", "3"], + RowBox[{"jerkProfile", "[", + RowBox[{"[", "7", "]"}], "]"}]}]}]}], ";"}], + "\[IndentingNewLine]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"tAll", "=", + RowBox[{ + "t1", "+", "t2", "+", "t3", "+", "t4", "+", "t5", "+", "t6", "+", "t7"}]}], + ";"}]}], "Input", + CellChangeTimes->{{3.816880379195327*^9, 3.816880390940811*^9}, + 3.817182672246656*^9, 3.8171828989328327`*^9, 3.8171829299490433`*^9, + 3.8171986249749393`*^9, {3.8172044839157457`*^9, 3.817204491762228*^9}, + 3.817206432896442*^9, 3.817267327497333*^9, 3.817273066602022*^9}, + CellLabel-> + "In[694]:=",ExpressionUUID->"9382707b-2876-460d-b0fb-ca70e05b1e9a"], + +Cell[BoxData[{ + RowBox[{ + RowBox[{"tVars", "=", + RowBox[{"{", + RowBox[{ + "t1", ",", "t2", ",", "t3", ",", "t4", ",", "t5", ",", "t6", ",", "t7"}], + "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"resultT", "=", + RowBox[{"{", "\[IndentingNewLine]", + RowBox[{ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"a1", "\[Equal]", "aMax"}], ",", + RowBox[{"a5", "\[Equal]", + RowBox[{"-", "aMax"}]}], ",", + RowBox[{"v3", "\[Equal]", "vMax"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"Join", "[", + RowBox[{"tVars", ",", + RowBox[{"{", "vMax", "}"}]}], "]"}]}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"a1", "\[Equal]", "aMax"}], ",", + RowBox[{"a5", "\[Equal]", "aMax"}], ",", + RowBox[{"v3", "\[Equal]", "vMax"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"Join", "[", + RowBox[{"tVars", ",", + RowBox[{"{", "vMax", "}"}]}], "]"}]}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"a1", "\[Equal]", "aMax"}], ",", + RowBox[{"a5", "\[Equal]", + RowBox[{"-", "aMax"}]}], ",", + RowBox[{"t4", "\[Equal]", "0"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"Join", "[", + RowBox[{"tVars", ",", + RowBox[{"{", "jMax", "}"}]}], "]"}]}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], "/.", + RowBox[{"{", + RowBox[{"a0", "\[Rule]", "0"}], "}"}]}], ")"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{"v7", "/.", + RowBox[{"{", + RowBox[{"a0", "\[Rule]", "0"}], "}"}]}], ")"}], "\[Equal]", + "vf"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{"p7", "/.", + RowBox[{"{", + RowBox[{"a0", "\[Rule]", "0"}], "}"}]}], ")"}], "\[Equal]", + "pf"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{"a3", "/.", + RowBox[{"{", + RowBox[{"a0", "\[Rule]", "0"}], "}"}]}], ")"}], "\[Equal]", + "0"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{"a1", "/.", + RowBox[{"{", + RowBox[{"a0", "\[Rule]", "0"}], "}"}]}], ")"}], "\[Equal]", + "aMax"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{"a5", "/.", + RowBox[{"{", + RowBox[{"a0", "\[Rule]", "0"}], "}"}]}], ")"}], "\[Equal]", + RowBox[{"-", "aMax"}]}], ",", + RowBox[{"t4", "\[Equal]", "0"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"Join", "[", + RowBox[{"tVars", ",", + RowBox[{"{", "jMax", "}"}]}], "]"}]}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"a5", "\[Equal]", + RowBox[{"-", "aMax"}]}], ",", + RowBox[{"v3", "\[Equal]", "vMax"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"Join", "[", + RowBox[{"tVars", ",", + RowBox[{"{", "vMax", "}"}]}], "]"}], ",", + RowBox[{"Cubics", "\[Rule]", "False"}], ",", + RowBox[{"Quartics", "\[Rule]", "False"}]}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"a5", "\[Equal]", "aMax"}], ",", + RowBox[{"v3", "\[Equal]", "vMax"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"Join", "[", + RowBox[{"tVars", ",", + RowBox[{"{", "vMax", "}"}]}], "]"}], ",", + RowBox[{"Cubics", "\[Rule]", "False"}], ",", + RowBox[{"Quartics", "\[Rule]", "False"}]}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"a1", "\[Equal]", "aMax"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"v3", "\[Equal]", "vMax"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"Join", "[", + RowBox[{"tVars", ",", + RowBox[{"{", "vMax", "}"}]}], "]"}]}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"v3", "\[Equal]", "vMax"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"Join", "[", + RowBox[{"tVars", ",", + RowBox[{"{", "vMax", "}"}]}], "]"}]}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"t4", "\[Equal]", "0"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"Join", "[", + RowBox[{"tVars", ",", + RowBox[{"{", "jMax", "}"}]}], "]"}]}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{"a7", "/.", + RowBox[{"{", + RowBox[{ + RowBox[{"a0", "\[Rule]", "0"}], ",", + RowBox[{"v0", "\[Rule]", "0"}]}], "}"}]}], ")"}], "\[Equal]", + "0"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{"v7", "/.", + RowBox[{"{", + RowBox[{ + RowBox[{"a0", "\[Rule]", "0"}], ",", + RowBox[{"v0", "\[Rule]", "0"}]}], "}"}]}], ")"}], "\[Equal]", + "0"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{"p7", "/.", + RowBox[{"{", + RowBox[{ + RowBox[{"a0", "\[Rule]", "0"}], ",", + RowBox[{"v0", "\[Rule]", "0"}]}], "}"}]}], ")"}], "\[Equal]", + "pf"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{"a3", "/.", + RowBox[{"{", + RowBox[{ + RowBox[{"a0", "\[Rule]", "0"}], ",", + RowBox[{"v0", "\[Rule]", "0"}]}], "}"}]}], ")"}], "\[Equal]", + "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"t4", "\[Equal]", "0"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"Join", "[", + RowBox[{"tVars", ",", + RowBox[{"{", "jMax", "}"}]}], "]"}]}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{"a7", "/.", + RowBox[{"{", + RowBox[{"a0", "\[Rule]", "0"}], "}"}]}], ")"}], "\[Equal]", + "0"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{"v7", "/.", + RowBox[{"{", + RowBox[{"a0", "\[Rule]", "0"}], "}"}]}], ")"}], "\[Equal]", + "0"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{"p7", "/.", + RowBox[{"{", + RowBox[{"a0", "\[Rule]", "0"}], "}"}]}], ")"}], "\[Equal]", + "pf"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{"a3", "/.", + RowBox[{"{", + RowBox[{"a0", "\[Rule]", "0"}], "}"}]}], ")"}], "\[Equal]", + "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"t4", "\[Equal]", "0"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"Join", "[", + RowBox[{"tVars", ",", + RowBox[{"{", "jMax", "}"}]}], "]"}]}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{"a7", "/.", + RowBox[{"{", + RowBox[{ + RowBox[{"a0", "\[Rule]", "0"}], ",", + RowBox[{"v0", "\[Rule]", "0"}]}], "}"}]}], ")"}], "\[Equal]", + "0"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{"v7", "/.", + RowBox[{"{", + RowBox[{ + RowBox[{"a0", "\[Rule]", "0"}], ",", + RowBox[{"v0", "\[Rule]", "0"}]}], "}"}]}], ")"}], "\[Equal]", + "vf"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{"p7", "/.", + RowBox[{"{", + RowBox[{ + RowBox[{"a0", "\[Rule]", "0"}], ",", + RowBox[{"v0", "\[Rule]", "0"}]}], "}"}]}], ")"}], "\[Equal]", + "pf"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{"a3", "/.", + RowBox[{"{", + RowBox[{ + RowBox[{"a0", "\[Rule]", "0"}], ",", + RowBox[{"v0", "\[Rule]", "0"}]}], "}"}]}], ")"}], "\[Equal]", + "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"t4", "\[Equal]", "0"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"Join", "[", + RowBox[{"tVars", ",", + RowBox[{"{", "jMax", "}"}]}], "]"}]}], "]"}]}], + "\[IndentingNewLine]", "}"}]}], ";"}]}], "Input", + CellChangeTimes->{{3.817013032049388*^9, 3.817013033283889*^9}, { + 3.817100612567739*^9, 3.8171006269154987`*^9}, {3.817113990013734*^9, + 3.817114014099329*^9}, {3.8171145630701847`*^9, 3.8171146067008333`*^9}, { + 3.817115862184207*^9, 3.817115863190937*^9}, {3.8171222855825443`*^9, + 3.8171222924439993`*^9}, {3.817122875692387*^9, 3.817122875793445*^9}, { + 3.81712438621596*^9, 3.817124425333537*^9}, {3.817125665335071*^9, + 3.817125694510701*^9}, {3.817129255005664*^9, 3.817129267494829*^9}, { + 3.8171828074231377`*^9, 3.817182809358925*^9}, {3.8171977437889433`*^9, + 3.817197745815053*^9}, {3.817204966621126*^9, 3.817204997933617*^9}, + 3.817206428698655*^9}, + CellLabel-> + "In[305]:=",ExpressionUUID->"93a49805-7b39-4e71-a5ce-78f2b77ae9c0"], + +Cell[BoxData[ + RowBox[{ + RowBox[{"tmpData", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"p0", "\[Rule]", + RowBox[{"-", "0.16"}]}], ",", + RowBox[{"v0", "\[Rule]", + RowBox[{"-", "0.61"}]}], ",", + RowBox[{"a0", "\[Rule]", + RowBox[{"-", "0.57"}]}], ",", + RowBox[{"pf", "\[Rule]", + RowBox[{"-", "0.4"}]}], ",", + RowBox[{"vf", "\[Rule]", "0.0"}], ",", + RowBox[{"af", "\[Rule]", "0.0"}], ",", + RowBox[{"vMax", "\[Rule]", "3.3"}], ",", + RowBox[{"aMax", "\[Rule]", "4.3"}], ",", + RowBox[{"jMax", "\[Rule]", "5.6"}], ",", + RowBox[{"tf", "\[Rule]", "37.703"}]}], "}"}]}], ";"}]], "Input", + CellChangeTimes->{{3.8171900078820047`*^9, 3.81719006047993*^9}, { + 3.817198568020718*^9, 3.8171985709445353`*^9}, {3.817198864542214*^9, + 3.817198867099786*^9}, {3.817199259379333*^9, 3.817199259504444*^9}, { + 3.817204634951261*^9, 3.817204644185977*^9}, {3.817204685224326*^9, + 3.817204715604228*^9}, 3.817204905314937*^9, {3.8172064641259604`*^9, + 3.81720653174646*^9}, {3.817206571221998*^9, 3.817206637654607*^9}, { + 3.817207211482386*^9, 3.817207223011895*^9}, {3.817208202452425*^9, + 3.817208206184716*^9}, {3.8172092343345623`*^9, 3.817209274976646*^9}, { + 3.817265785920109*^9, 3.817265814147944*^9}, 3.817266613758198*^9, { + 3.817266693098015*^9, 3.81726673752947*^9}, {3.8172673107601767`*^9, + 3.8172673129553413`*^9}, {3.8172673767674103`*^9, 3.817267378858644*^9}, { + 3.8172675351000957`*^9, 3.817267543836657*^9}, {3.817267602658565*^9, + 3.8172676035763187`*^9}, {3.817268960557254*^9, 3.817268980041274*^9}, { + 3.817272984611813*^9, 3.817273002276932*^9}, {3.81727459489056*^9, + 3.8172746242021008`*^9}, {3.817274675513281*^9, 3.817274680186975*^9}, + 3.8172749548051853`*^9, {3.817281170103339*^9, 3.8172811747208023`*^9}}, + CellLabel-> + "In[880]:=",ExpressionUUID->"5878fecc-824c-4d1e-9afc-06f4774e587c"], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{ + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"8", ",", "2", ",", "1"}], "]"}], "]"}], "/.", "tmpData"}], "//", + "InputForm"}]], "Input", + CellChangeTimes->{{3.817274239645443*^9, 3.817274243342292*^9}, { + 3.8172743353470373`*^9, 3.8172743561302853`*^9}, {3.817274585698576*^9, + 3.81727462801589*^9}, {3.817275431354004*^9, 3.817275432167089*^9}, { + 3.817275781547477*^9, 3.817275781618964*^9}}, + CellLabel-> + "In[787]:=",ExpressionUUID->"54246e45-b069-4bf6-aa74-c0e21c44f308"], + +Cell["t1 -> 0.14655216168017807", "Output", + CellChangeTimes->{ + 3.817274244418462*^9, {3.8172743372982473`*^9, 3.8172743565889797`*^9}, + 3.817274586988284*^9, 3.8172746284525547`*^9, 3.817274709188406*^9, + 3.8172749572197027`*^9, 3.817275402579403*^9, 3.8172754327968903`*^9, + 3.8172757819940643`*^9}, + CellLabel-> + "Out[787]//InputForm=",ExpressionUUID->"1fc1b4b4-8e2b-4c6c-a9c8-\ +9f361ba240af"] +}, Open ]], + +Cell["Case1 -> 1, Case2 -> 1, Case 8/2->2, Case 8/3->1", "Text", + CellChangeTimes->{{3.817013988142602*^9, 3.8170139903294573`*^9}, { + 3.817114182309226*^9, 3.817114185980912*^9}, {3.817114289998136*^9, + 3.817114290062354*^9}, {3.817115858428026*^9, 3.817115858499978*^9}, { + 3.817124186878913*^9, 3.817124189865059*^9}, {3.817129328273472*^9, + 3.8171293344972153`*^9}, {3.8171295373005*^9, + 3.817129537356216*^9}},ExpressionUUID->"0616ae41-3a02-473a-878f-\ +96412e2fc8c5"], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"toCCode", "[", + RowBox[{"resultT", ",", "2", ",", "7", ",", "1"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.8170130379026814`*^9, 3.817013094832712*^9}, { + 3.817013843311531*^9, 3.817013912845374*^9}, {3.817114193255891*^9, + 3.8171142470461187`*^9}, {3.8171142923532953`*^9, 3.817114292414125*^9}, { + 3.817114391963263*^9, 3.817114438903778*^9}, {3.817114623382329*^9, + 3.817114672331129*^9}, {3.8171244637630177`*^9, 3.817124520671563*^9}, { + 3.8171293394614553`*^9, 3.81712941438689*^9}, {3.817129495550914*^9, + 3.817129495619588*^9}, {3.8171295404077053`*^9, 3.8171295404497643`*^9}, { + 3.81712957584783*^9, 3.817129575892391*^9}, {3.8171977520927687`*^9, + 3.8171978081510763`*^9}}, + CellLabel->"In[44]:=",ExpressionUUID->"f08feb2e-6079-473b-b866-92670dea0a56"], + +Cell[BoxData["\<\"profile.t[6] = aMax/jMax;\\n\"\>"], "Output", + CellChangeTimes->{{3.817013038100574*^9, 3.8170130952655783`*^9}, { + 3.817013843881184*^9, 3.817013913172606*^9}, 3.817013966856229*^9, { + 3.8171141944209747`*^9, 3.817114247671588*^9}, 3.8171142928777733`*^9, { + 3.817114392320196*^9, 3.817114439306479*^9}, {3.8171146265100317`*^9, + 3.817114640599546*^9}, 3.817114672716282*^9, {3.8171244652684317`*^9, + 3.81712452112893*^9}, {3.817129341090829*^9, 3.817129414972683*^9}, + 3.8171294960028267`*^9, 3.817129540766204*^9, 3.817129576316744*^9, { + 3.817197764341394*^9, 3.817197808544726*^9}}, + CellLabel->"Out[44]=",ExpressionUUID->"3c38abf0-85fb-4a6c-bb73-13647123db5a"] +}, Open ]], + +Cell["Case 2", "Text", + CellChangeTimes->{{3.8171237132307377`*^9, + 3.817123713815785*^9}},ExpressionUUID->"0a48f25a-db59-414e-a9d8-\ +f836650cf87d"], + +Cell[BoxData[{ + RowBox[{ + RowBox[{"re2h1", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "12"}], " ", + SuperscriptBox["a0", "2"], " ", "aMax", " ", "tf"}], "+", + RowBox[{"24", " ", "a0", " ", + SuperscriptBox["aMax", "2"], " ", "tf"}], "-", + RowBox[{"24", " ", + SuperscriptBox["aMax", "3"], " ", "tf"}], "+", + RowBox[{"12", " ", + SuperscriptBox["a0", "2"], " ", "v0"}], "-", + RowBox[{"24", " ", "a0", " ", "aMax", " ", "v0"}], "-", + RowBox[{"12", " ", + SuperscriptBox["a0", "2"], " ", "vf"}], "+", + RowBox[{"24", " ", "a0", " ", "aMax", " ", "vf"}]}], ")"}], "\[Rule]", + "h1"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"12", " ", + SuperscriptBox["a0", "2"], " ", "aMax", " ", "tf"}], "-", + RowBox[{"24", " ", "a0", " ", + SuperscriptBox["aMax", "2"], " ", "tf"}], "+", + RowBox[{"24", " ", + SuperscriptBox["aMax", "3"], " ", "tf"}], "-", + RowBox[{"12", " ", + SuperscriptBox["a0", "2"], " ", "v0"}], "+", + RowBox[{"24", " ", "a0", " ", "aMax", " ", "v0"}], "+", + RowBox[{"12", " ", + SuperscriptBox["a0", "2"], " ", "vf"}], "-", + RowBox[{"24", " ", "a0", " ", "aMax", " ", "vf"}]}], ")"}], "\[Rule]", + RowBox[{"-", "h1"}]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re2h2", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "48"}], " ", "aMax", " ", "p0"}], "+", + RowBox[{"48", " ", "aMax", " ", "pf"}], "-", + RowBox[{"12", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["tf", "2"]}], "-", + RowBox[{"24", " ", "aMax", " ", "tf", " ", "v0"}], "+", + RowBox[{"12", " ", + SuperscriptBox["v0", "2"]}], "-", + RowBox[{"24", " ", "aMax", " ", "tf", " ", "vf"}], "-", + RowBox[{"24", " ", "v0", " ", "vf"}], "+", + RowBox[{"12", " ", + SuperscriptBox["vf", "2"]}]}], ")"}], "\[Rule]", "h2"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re2h3", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"3", " ", + SuperscriptBox["a0", "3"]}], "-", + RowBox[{"4", " ", + SuperscriptBox["a0", "2"], " ", "aMax"}], "-", + RowBox[{"12", " ", "a0", " ", + SuperscriptBox["aMax", "2"]}], "+", + RowBox[{"24", " ", + SuperscriptBox["aMax", "3"]}]}], ")"}], " ", "\[Rule]", "h3"}], ",", + + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"3", " ", + SuperscriptBox["a0", "4"]}], "-", + RowBox[{"4", " ", + SuperscriptBox["a0", "3"], " ", "aMax"}], "-", + RowBox[{"12", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["aMax", "2"]}], "+", + RowBox[{"24", " ", "a0", " ", + SuperscriptBox["aMax", "3"]}]}], ")"}], "\[Rule]", + RowBox[{"h3", " ", "a0"}]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re2h4", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{"h1", "-", + SqrtBox[ + RowBox[{ + SuperscriptBox["h1", "2"], "-", + RowBox[{"4", " ", "a0", " ", "h2", " ", "h3"}]}]]}], ")"}], + "\[Rule]", "h4"}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re2h5", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{"h1", "+", + SqrtBox[ + RowBox[{ + SuperscriptBox["h1", "2"], "-", + RowBox[{"4", " ", "a0", " ", "h2", " ", "h3"}]}]]}], ")"}], + "\[Rule]", "h5"}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re2h6", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{"2", " ", "aMax", " ", "h4", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "p0"}], "-", + RowBox[{"2", " ", "pf"}], "+", + RowBox[{"tf", " ", + RowBox[{"(", + RowBox[{"v0", "+", "vf"}], ")"}]}]}], ")"}]}], ")"}], "\[Rule]", + "h6"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "2"}], " ", "aMax", " ", "h4", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "p0"}], "-", + RowBox[{"2", " ", "pf"}], "+", + RowBox[{"tf", " ", + RowBox[{"(", + RowBox[{"v0", "+", "vf"}], ")"}]}]}], ")"}]}], ")"}], "\[Rule]", + RowBox[{"-", "h6"}]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re2h7", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"2", " ", "a0", " ", "aMax", " ", "h2", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"a0", " ", "tf"}], "+", + RowBox[{"2", " ", "v0"}], "-", + RowBox[{"2", " ", "vf"}]}], ")"}]}], "\[Rule]", "h7"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", "2", "]"}], "]"}], "//.", "re2h1"}], "//.", + "re2h2"}], "//.", "re2h3"}], "//.", "re2h4"}], "//.", "re2h5"}], + "]"}], "//.", "re2h3"}], "//.", "re2h6"}], "//.", "re2h7"}], + ";"}]}], "Input", + CellChangeTimes->{{3.817122451582264*^9, 3.817122468739533*^9}, { + 3.8171225065263557`*^9, 3.817122582733562*^9}, {3.8171226137688513`*^9, + 3.817122662623451*^9}, {3.817122713454211*^9, 3.81712272547886*^9}, { + 3.817122915857518*^9, 3.8171230649582157`*^9}, {3.817123096243449*^9, + 3.8171231884747677`*^9}, 3.817123222746769*^9, 3.817123783766102*^9}, + CellLabel-> + "In[269]:=",ExpressionUUID->"167a7b57-8177-4747-a9c0-9f4026ebbce4"], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{"re2h2", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}], "]"}], ",", "CForm"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.817123786620249*^9, 3.8171239076576023`*^9}}, + CellLabel-> + "In[297]:=",ExpressionUUID->"fe5cd889-d2ba-4d6c-a9e7-19ee388c29a9"], + +Cell[BoxData["\<\"-12*(Power(aMax,2)*Power(tf,2) - Power(v0 - vf,2) + \ +2*aMax*(2*p0 - 2*pf + tf*(v0 + vf)))\"\>"], "Output", + CellChangeTimes->{{3.817123794411806*^9, 3.817123907999597*^9}}, + CellLabel-> + "Out[297]=",ExpressionUUID->"80f10292-ac56-43e3-89bb-4d010f19c0d7"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"2", ",", "1", ",", "6", ",", "2"}], "]"}], "]"}], "//.", + "re2h1"}], "//.", "re2h2"}], "//.", "re2h3"}], "//.", "re2h4"}], + "//.", "re2h5"}], "]"}], "//.", "re2h3"}], "//.", "re2h6"}], "//.", + "re2h7"}], ",", "CForm"}], "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.8171238783740273`*^9, 3.817123880632866*^9}, { + 3.817123927115059*^9, 3.8171240736811237`*^9}, {3.817124139416436*^9, + 3.817124139464123*^9}, {3.8171241945171137`*^9, 3.8171242511247463`*^9}}, + CellLabel-> + "In[337]:=",ExpressionUUID->"53e5952a-4fb5-4d63-8377-5a9caddfc267"], + +Cell[BoxData["\<\"(24*Power(aMax,2)*(-h6 + 4*Power(aMax,3)*h2*tf - \ +Power(aMax,2)*h4*Power(tf,2) + h4*Power(v0 - vf,2)) - 6*a0*aMax*(-h6 + \ +16*Power(aMax,3)*h2*tf - Power(aMax,2)*(h4*Power(tf,2) + 20*h2*(v0 - vf)) + \ +h4*Power(v0 - vf,2)) + 3*Power(a0,2)*(-h6 + 24*Power(aMax,3)*h2*tf - \ +Power(aMax,2)*(h4*Power(tf,2) + 28*h2*(v0 - vf)) + h4*Power(v0 - vf,2)) + \ +3*Power(a0,4)*h2*(3*aMax*tf - v0 + vf) - 4*Power(a0,3)*aMax*h2*(7*aMax*tf - \ +5*v0 + 5*vf))/(2.*a0*aMax*h2*h3)\"\>"], "Output", + CellChangeTimes->{{3.817123950434513*^9, 3.817124074257918*^9}, + 3.817124139879283*^9, {3.8171241949256563`*^9, 3.8171242515039682`*^9}}, + CellLabel-> + "Out[337]=",ExpressionUUID->"1d340d11-56a5-4b00-8e1b-1f9344aadb3f"] +}, Open ]], + +Cell["Case 3", "Text", + CellChangeTimes->{{3.8171258084690123`*^9, + 3.817125811476948*^9}},ExpressionUUID->"417bee0a-e71c-4074-951a-\ +e0096c8c0197"], + +Cell[BoxData[{ + RowBox[{ + RowBox[{"re3h1", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"5", " ", + SuperscriptBox["a0", "2"]}], "+", + RowBox[{"4", " ", "a0", " ", "aMax"}], "+", + SuperscriptBox["aMax", "2"], "-", + RowBox[{"2", " ", "aMax", " ", "jMax", " ", "tf"}], "+", + RowBox[{"2", " ", "jMax", " ", "v0"}], "-", + RowBox[{"2", " ", "jMax", " ", "vf"}]}], ")"}], "\[Rule]", "h1"}], + ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"5", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"]}], "+", + RowBox[{"4", " ", "a0", " ", "aMax", " ", + SuperscriptBox["jMax", "2"]}], "+", + RowBox[{ + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "2"]}], "-", + RowBox[{"2", " ", "aMax", " ", + SuperscriptBox["jMax", "3"], " ", "tf"}], "+", + RowBox[{"2", " ", + SuperscriptBox["jMax", "3"], " ", "v0"}], "-", + RowBox[{"2", " ", + SuperscriptBox["jMax", "3"], " ", "vf"}]}], ")"}], "\[Rule]", + RowBox[{"h1", " ", + SuperscriptBox["jMax", "2"]}]}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re3h2", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "a0"}], "+", "aMax"}], ")"}], "\[Rule]", "h2"}], + ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "a0", " ", + SuperscriptBox["jMax", "3"]}], "+", + RowBox[{"aMax", " ", + SuperscriptBox["jMax", "3"]}]}], ")"}], "\[Rule]", + RowBox[{"h2", " ", + SuperscriptBox["jMax", "3"]}]}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re3h3", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", + SuperscriptBox["a0", "3"]}], "-", + RowBox[{ + SuperscriptBox["a0", "2"], " ", "aMax"}], "-", + RowBox[{"a0", " ", + SuperscriptBox["aMax", "2"]}], "+", + RowBox[{"2", " ", "a0", " ", "aMax", " ", "jMax", " ", "tf"}], "-", + RowBox[{"2", " ", "a0", " ", "jMax", " ", "v0"}], "+", + RowBox[{"2", " ", "a0", " ", "jMax", " ", "vf"}]}], ")"}], "\[Rule]", + "h3"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + SuperscriptBox["a0", "3"], " ", "jMax"}], "+", + RowBox[{ + SuperscriptBox["a0", "2"], " ", "aMax", " ", "jMax"}], "+", + RowBox[{"a0", " ", + SuperscriptBox["aMax", "2"], " ", "jMax"}], "-", + RowBox[{"2", " ", "a0", " ", "aMax", " ", + SuperscriptBox["jMax", "2"], " ", "tf"}], "+", + RowBox[{"2", " ", "a0", " ", + SuperscriptBox["jMax", "2"], " ", "v0"}], "-", + RowBox[{"2", " ", "a0", " ", + SuperscriptBox["jMax", "2"], " ", "vf"}]}], ")"}], "\[Rule]", + RowBox[{"h3", " ", "jMax"}]}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re3h4", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"4", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"8", " ", + SuperscriptBox["a0", "3"], " ", "aMax", " ", + SuperscriptBox["jMax", "4"]}], "-", + RowBox[{"4", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "4"]}], "-", + RowBox[{"4", " ", "a0", " ", + SuperscriptBox["aMax", "3"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{ + SuperscriptBox["aMax", "4"], " ", + SuperscriptBox["jMax", "4"]}], "-", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "p0"}], "+", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "pf"}], "+", + RowBox[{"16", " ", + SuperscriptBox["a0", "2"], " ", "aMax", " ", + SuperscriptBox["jMax", "5"], " ", "tf"}], "+", + RowBox[{"8", " ", "a0", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "tf"}], "-", + RowBox[{"4", " ", + SuperscriptBox["aMax", "3"], " ", + SuperscriptBox["jMax", "5"], " ", "tf"}], "+", + RowBox[{"4", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["tf", "2"]}], "-", + RowBox[{"16", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "-", + RowBox[{"8", " ", "a0", " ", "aMax", " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "+", + RowBox[{"16", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "-", + RowBox[{"32", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "tf", " ", "v0"}], "+", + RowBox[{"16", " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"16", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "vf"}], "+", + RowBox[{"8", " ", "a0", " ", "aMax", " ", + SuperscriptBox["jMax", "5"], " ", "vf"}], "-", + RowBox[{"16", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "vf"}], "+", + RowBox[{"8", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "tf", " ", "vf"}], "-", + RowBox[{"32", " ", + SuperscriptBox["jMax", "6"], " ", "v0", " ", "vf"}], "+", + RowBox[{"16", " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], "\[Rule]", "h4"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re3h5", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"3", " ", + SuperscriptBox["a0", "4"]}], "+", + RowBox[{"4", " ", + SuperscriptBox["a0", "3"], " ", "aMax"}], "+", + RowBox[{"6", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["aMax", "2"]}], "-", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "2"], " ", "p0"}], "+", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "2"], " ", "pf"}], "-", + RowBox[{"12", " ", + SuperscriptBox["a0", "2"], " ", "aMax", " ", "jMax", " ", "tf"}], "+", + RowBox[{"12", " ", + SuperscriptBox["a0", "2"], " ", "jMax", " ", "v0"}], "+", + RowBox[{"12", " ", + SuperscriptBox["aMax", "2"], " ", "jMax", " ", "v0"}], "-", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "2"], " ", "tf", " ", "v0"}], "+", + RowBox[{"12", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["v0", "2"]}], "-", + RowBox[{"12", " ", + SuperscriptBox["a0", "2"], " ", "jMax", " ", "vf"}], "-", + RowBox[{"12", " ", + SuperscriptBox["aMax", "2"], " ", "jMax", " ", "vf"}], "-", + RowBox[{"24", " ", + SuperscriptBox["jMax", "2"], " ", "v0", " ", "vf"}], "+", + RowBox[{"12", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], "\[Rule]", "h5"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re3h6", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"3456", " ", + SuperscriptBox["h1", "3"], " ", + SuperscriptBox["jMax", "6"]}], "-", + RowBox[{"62208", " ", "h1", " ", "h2", " ", "h3", " ", + SuperscriptBox["jMax", "6"]}], "+", + RowBox[{"186624", " ", + SuperscriptBox["h3", "2"], " ", + SuperscriptBox["jMax", "6"]}], "-", + RowBox[{"10368", " ", "h1", " ", "h5", " ", + SuperscriptBox["jMax", "6"]}], "+", + RowBox[{"15552", " ", + SuperscriptBox["h2", "2"], " ", "h5", " ", + SuperscriptBox["jMax", "6"]}]}], ")"}], "\[Rule]", "h6"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re3h7", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"576", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"1152", " ", + SuperscriptBox["a0", "3"], " ", "aMax", " ", + SuperscriptBox["jMax", "4"]}], "-", + RowBox[{"576", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "4"]}], "-", + RowBox[{"576", " ", "a0", " ", + SuperscriptBox["aMax", "3"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"144", " ", + SuperscriptBox["aMax", "4"], " ", + SuperscriptBox["jMax", "4"]}], "-", + RowBox[{"3456", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "p0"}], "+", + RowBox[{"3456", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "pf"}], "+", + RowBox[{"2304", " ", + SuperscriptBox["a0", "2"], " ", "aMax", " ", + SuperscriptBox["jMax", "5"], " ", "tf"}], "+", + RowBox[{"1152", " ", "a0", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "tf"}], "-", + RowBox[{"576", " ", + SuperscriptBox["aMax", "3"], " ", + SuperscriptBox["jMax", "5"], " ", "tf"}], "+", + RowBox[{"576", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["tf", "2"]}], "-", + RowBox[{"2304", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "-", + RowBox[{"1152", " ", "a0", " ", "aMax", " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "+", + RowBox[{"2304", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "-", + RowBox[{"4608", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "tf", " ", "v0"}], "+", + RowBox[{"2304", " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"2304", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "vf"}], "+", + RowBox[{"1152", " ", "a0", " ", "aMax", " ", + SuperscriptBox["jMax", "5"], " ", "vf"}], "-", + RowBox[{"2304", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "vf"}], "+", + RowBox[{"1152", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "tf", " ", "vf"}], "-", + RowBox[{"4608", " ", + SuperscriptBox["jMax", "6"], " ", "v0", " ", "vf"}], "+", + RowBox[{"2304", " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], "\[Rule]", "h7"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re3h8", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"h6", "+", + SqrtBox[ + RowBox[{ + SuperscriptBox["h6", "2"], "-", + RowBox[{"4", " ", + SuperscriptBox["h7", "3"]}]}]]}], ")"}], + RowBox[{"1", "/", "3"}]], "\[Rule]", "h8"}], ",", + RowBox[{ + FractionBox["1", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"h6", "+", + SqrtBox[ + RowBox[{ + SuperscriptBox["h6", "2"], "-", + RowBox[{"4", " ", + SuperscriptBox["h7", "3"]}]}]]}], ")"}], + RowBox[{"1", "/", "3"}]]], "\[Rule]", + FractionBox["1", "h8"]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re3h9", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + SqrtBox[ + RowBox[{ + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h4"}], + RowBox[{"h8", " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox["h8", + RowBox[{"36", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "4"]}]], "-", + FractionBox[ + RowBox[{"2", " ", "h1"}], + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"]}]], "+", + FractionBox[ + SuperscriptBox["h2", "2"], + SuperscriptBox["jMax", "2"]]}]], "\[Rule]", "h9"}], ",", + RowBox[{ + FractionBox["1", + SqrtBox[ + RowBox[{ + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h4"}], + RowBox[{"h8", " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox["h8", + RowBox[{"36", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "4"]}]], "-", + FractionBox[ + RowBox[{"2", " ", "h1"}], + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"]}]], "+", + FractionBox[ + SuperscriptBox["h2", "2"], + SuperscriptBox["jMax", "2"]]}]]], "\[Rule]", + FractionBox["1", "h9"]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re3h10", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + FractionBox[ + RowBox[{ + FractionBox[ + RowBox[{"8", " ", "h1", " ", "h2"}], + SuperscriptBox["jMax", "3"]], "-", + FractionBox[ + RowBox[{"8", " ", + SuperscriptBox["h2", "3"]}], + SuperscriptBox["jMax", "3"]], "+", + FractionBox[ + RowBox[{"16", " ", "h3"}], + SuperscriptBox["jMax", "3"]]}], + RowBox[{"4", " ", "h9"}]], "\[Rule]", "h10"}], ",", + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{ + FractionBox[ + RowBox[{"8", " ", "h1", " ", "h2"}], + SuperscriptBox["jMax", "3"]], "-", + FractionBox[ + RowBox[{"8", " ", + SuperscriptBox["h2", "3"]}], + SuperscriptBox["jMax", "3"]], "+", + FractionBox[ + RowBox[{"16", " ", "h3"}], + SuperscriptBox["jMax", "3"]]}], + RowBox[{"4", " ", "h9"}]]}], "\[Rule]", + RowBox[{"-", "h10"}]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re3h11", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h4"}], + RowBox[{"h8", " ", + SuperscriptBox["jMax", "4"]}]]}], "-", + FractionBox["h8", + RowBox[{"36", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "4"]}]], "-", + FractionBox[ + RowBox[{"4", " ", "h1"}], + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"]}]], "+", + FractionBox[ + RowBox[{"2", " ", + SuperscriptBox["h2", "2"]}], + SuperscriptBox["jMax", "2"]]}], "\[Rule]", "h11"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", "4", "]"}], "]"}], "//.", "re3h1"}], "//.", + "re3h2"}], "//.", "re3h3"}], "//.", "re3h4"}], "//.", "re3h5"}], + "//.", "re3h6"}], "//.", "re3h7"}], "//.", "re3h8"}], "//.", + "re3h9"}], "//.", "re3h10"}], "//.", "re3h11"}], "]"}], ";"}]}], "Input",\ + + CellChangeTimes->{{3.817125852128757*^9, 3.8171259766010303`*^9}, { + 3.817126011722299*^9, 3.8171260414509907`*^9}, {3.817126082716357*^9, + 3.817126084044788*^9}, {3.817126128350594*^9, 3.817126367873518*^9}, { + 3.8171264001148987`*^9, 3.8171264180761433`*^9}, {3.817126449787652*^9, + 3.817126452049596*^9}, 3.817126906641758*^9}, + CellLabel-> + "In[530]:=",ExpressionUUID->"3f1f8812-a017-42e0-b936-21036f34dc96"], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{"re3h11", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}], "]"}], ",", "CForm"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.8171269109333553`*^9, 3.817127019078951*^9}}, + CellLabel-> + "In[562]:=",ExpressionUUID->"3f328cb6-a4a3-4ace-a469-e5facf0fa91d"], + +Cell[BoxData["\<\"-((288*Power(2,0.3333333333333333)*h4)/h8 + \ +Power(2,0.6666666666666666)*h8 + 48*(2*h1 - \ +3*Power(h2,2))*Power(jMax,2))/(72.*Power(jMax,4))\"\>"], "Output", + CellChangeTimes->{{3.8171269119570208`*^9, 3.817127019440786*^9}}, + CellLabel-> + "Out[562]=",ExpressionUUID->"6bca33c2-2d90-4bf0-b923-36fcadb51ccc"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"4", ",", "3", ",", "7", ",", "2"}], "]"}], "]"}], "//.", + "re3h1"}], "//.", "re3h2"}], "//.", "re3h3"}], "//.", + "re3h4"}], "//.", "re3h5"}], "//.", "re3h6"}], "//.", "re3h7"}], "//.", + "re3h8"}], "//.", "re3h9"}], "//.", "re3h10"}], "//.", "re3h11"}], + "]"}], ",", "CForm"}], "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.817127048606803*^9, 3.817127049750863*^9}, { + 3.817127166465767*^9, 3.817127244049242*^9}, {3.817127360215321*^9, + 3.8171273884673*^9}, {3.817128064358778*^9, 3.817128088643128*^9}, { + 3.817128249432117*^9, 3.817128252564399*^9}, {3.8171283058569613`*^9, + 3.817128315307621*^9}, {3.8171284095299187`*^9, 3.817128453192231*^9}}, + CellLabel-> + "In[626]:=",ExpressionUUID->"1fececb1-454e-4c00-b1bc-a70612370596"], + +Cell[BoxData["\<\"aMax/jMax\"\>"], "Output", + CellChangeTimes->{{3.8171271491134377`*^9, 3.81712724440644*^9}, { + 3.817127360640326*^9, 3.817127389202696*^9}, {3.817128065348247*^9, + 3.817128089381688*^9}, {3.817128249921232*^9, 3.817128252940105*^9}, { + 3.817128306550253*^9, 3.8171283156480217`*^9}, {3.817128409952219*^9, + 3.8171284536128798`*^9}}, + CellLabel-> + "Out[626]=",ExpressionUUID->"5aff4def-f576-4ca5-89b7-f55e90bb6c72"] +}, Open ]], + +Cell["Case 4", "Text", + CellChangeTimes->{{3.8171363019160852`*^9, + 3.817136305403615*^9}},ExpressionUUID->"d3a768d1-c0c4-4efe-8e80-\ +ab5dbf747cd7"], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"re4h1", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "a0", " ", "aMax"}], "+", + SuperscriptBox["aMax", "2"], "-", + RowBox[{"2", " ", "aMax", " ", "jMax", " ", "tf"}], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}], "+", + RowBox[{"2", " ", "jMax", " ", "vf"}]}], ")"}], "\[Rule]", "h1"}], + ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", + SuperscriptBox["a0", "2"]}], "+", + RowBox[{"2", " ", "a0", " ", "aMax"}], "-", + SuperscriptBox["aMax", "2"], "+", + RowBox[{"2", " ", "aMax", " ", "jMax", " ", "tf"}], "+", + RowBox[{"2", " ", "jMax", " ", "v0"}], "-", + RowBox[{"2", " ", "jMax", " ", "vf"}]}], ")"}], "\[Rule]", + RowBox[{"-", "h1"}]}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"]}], "-", + RowBox[{"2", " ", "a0", " ", "aMax", " ", + SuperscriptBox["jMax", "2"]}], "+", + RowBox[{ + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "2"]}], "-", + RowBox[{"2", " ", "aMax", " ", + SuperscriptBox["jMax", "3"], " ", "tf"}], "-", + RowBox[{"2", " ", + SuperscriptBox["jMax", "3"], " ", "v0"}], "+", + RowBox[{"2", " ", + SuperscriptBox["jMax", "3"], " ", "vf"}]}], ")"}], "\[Rule]", + RowBox[{"h1", " ", + SuperscriptBox["jMax", "2"]}]}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re4h2", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"3", " ", + SuperscriptBox["a0", "4"]}], "-", + RowBox[{"8", " ", + SuperscriptBox["a0", "3"], " ", "aMax"}], "+", + RowBox[{"6", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["aMax", "2"]}], "-", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "2"], " ", "p0"}], "+", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "2"], " ", "pf"}], "-", + RowBox[{"12", " ", + SuperscriptBox["a0", "2"], " ", "jMax", " ", "v0"}], "+", + RowBox[{"24", " ", "a0", " ", "aMax", " ", "jMax", " ", "v0"}], "-", + RowBox[{"12", " ", + SuperscriptBox["aMax", "2"], " ", "jMax", " ", "v0"}], "+", + RowBox[{"12", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"12", " ", + SuperscriptBox["a0", "2"], " ", "jMax", " ", "vf"}], "-", + RowBox[{"24", " ", "a0", " ", "aMax", " ", "jMax", " ", "vf"}], "+", + RowBox[{"12", " ", + SuperscriptBox["aMax", "2"], " ", "jMax", " ", "vf"}], "-", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "2"], " ", "tf", " ", "vf"}], "-", + RowBox[{"24", " ", + SuperscriptBox["jMax", "2"], " ", "v0", " ", "vf"}], "+", + RowBox[{"12", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], "\[Rule]", "h2"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re4h3", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"144", " ", + SuperscriptBox["h1", "2"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"144", " ", "h2", " ", + SuperscriptBox["jMax", "4"]}]}], ")"}], "\[Rule]", "h3"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re4h4", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"3456", " ", + SuperscriptBox["h1", "3"], " ", + SuperscriptBox["jMax", "6"]}], "+", + RowBox[{"15552", " ", + SuperscriptBox["aMax", "2"], " ", "h2", " ", + SuperscriptBox["jMax", "6"]}], "-", + RowBox[{"10368", " ", "h1", " ", "h2", " ", + SuperscriptBox["jMax", "6"]}]}], ")"}], "\[Rule]", "h4"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re4h4d", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "3456"}], " ", + SuperscriptBox["h1", "3"], " ", + SuperscriptBox["jMax", "6"]}], "+", + RowBox[{"15552", " ", + SuperscriptBox["aMax", "2"], " ", "h2", " ", + SuperscriptBox["jMax", "6"]}], "+", + RowBox[{"10368", " ", "h1", " ", "h2", " ", + SuperscriptBox["jMax", "6"]}]}], ")"}], "\[Rule]", "h4"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re4h5", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"h4", "+", + SqrtBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "4"}], " ", + SuperscriptBox["h3", "3"]}], "+", + SuperscriptBox["h4", "2"]}]]}], ")"}], + RowBox[{"1", "/", "3"}]], "\[Rule]", "h5"}], ",", + RowBox[{ + FractionBox["1", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"h4", "+", + SqrtBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "4"}], " ", + SuperscriptBox["h3", "3"]}], "+", + SuperscriptBox["h4", "2"]}]]}], ")"}], + RowBox[{"1", "/", "3"}]]], "\[Rule]", + FractionBox["1", "h5"]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re4h6", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + SqrtBox[ + RowBox[{ + FractionBox["h3", + RowBox[{"18", " ", + SuperscriptBox["2", + RowBox[{"2", "/", "3"}]], " ", "h5", " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox["h5", + RowBox[{"36", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox[ + SuperscriptBox["aMax", "2"], + SuperscriptBox["jMax", "2"]], "-", + FractionBox[ + RowBox[{"2", " ", "h1"}], + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"]}]]}]], "\[Rule]", "h6"}], ",", + RowBox[{ + FractionBox["1", + SqrtBox[ + RowBox[{ + FractionBox["h3", + RowBox[{"18", " ", + SuperscriptBox["2", + RowBox[{"2", "/", "3"}]], " ", "h5", " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox["h5", + RowBox[{"36", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox[ + SuperscriptBox["aMax", "2"], + SuperscriptBox["jMax", "2"]], "-", + FractionBox[ + RowBox[{"2", " ", "h1"}], + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"]}]]}]]], "\[Rule]", + FractionBox["1", "h6"]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re4h6d", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + SqrtBox[ + RowBox[{ + FractionBox["h3", + RowBox[{"18", " ", + SuperscriptBox["2", + RowBox[{"2", "/", "3"}]], " ", "h5", " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox["h5", + RowBox[{"36", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox[ + SuperscriptBox["aMax", "2"], + SuperscriptBox["jMax", "2"]], "+", + FractionBox[ + RowBox[{"2", " ", "h1"}], + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"]}]]}]], "\[Rule]", "h6"}], ",", + RowBox[{ + FractionBox["1", + SqrtBox[ + RowBox[{ + FractionBox["h3", + RowBox[{"18", " ", + SuperscriptBox["2", + RowBox[{"2", "/", "3"}]], " ", "h5", " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox["h5", + RowBox[{"36", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox[ + SuperscriptBox["aMax", "2"], + SuperscriptBox["jMax", "2"]], "+", + FractionBox[ + RowBox[{"2", " ", "h1"}], + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"]}]]}]]], "\[Rule]", + FractionBox["1", "h6"]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re4h7", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + FractionBox[ + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{"8", " ", + SuperscriptBox["aMax", "3"]}], + SuperscriptBox["jMax", "3"]]}], "+", + FractionBox[ + RowBox[{"8", " ", "aMax", " ", "h1"}], + SuperscriptBox["jMax", "3"]]}], + RowBox[{"4", " ", "h6"}]], "\[Rule]", "h7"}], ",", + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{"8", " ", + SuperscriptBox["aMax", "3"]}], + SuperscriptBox["jMax", "3"]]}], "+", + FractionBox[ + RowBox[{"8", " ", "aMax", " ", "h1"}], + SuperscriptBox["jMax", "3"]]}], + RowBox[{"4", " ", "h6"}]]}], "\[Rule]", + RowBox[{"-", "h7"}]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re4h7d", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + FractionBox[ + RowBox[{ + FractionBox[ + RowBox[{"8", " ", + SuperscriptBox["aMax", "3"]}], + SuperscriptBox["jMax", "3"]], "+", + FractionBox[ + RowBox[{"8", " ", "aMax", " ", "h1"}], + SuperscriptBox["jMax", "3"]]}], + RowBox[{"4", " ", "h6"}]], "\[Rule]", "h7"}], ",", + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{ + FractionBox[ + RowBox[{"8", " ", + SuperscriptBox["aMax", "3"]}], + SuperscriptBox["jMax", "3"]], "+", + FractionBox[ + RowBox[{"8", " ", "aMax", " ", "h1"}], + SuperscriptBox["jMax", "3"]]}], + RowBox[{"4", " ", "h6"}]]}], "\[Rule]", + RowBox[{"-", "h7"}]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re4h8", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"-", + FractionBox["h3", + RowBox[{"18", " ", + SuperscriptBox["2", + RowBox[{"2", "/", "3"}]], " ", "h5", " ", + SuperscriptBox["jMax", "4"]}]]}], "-", + FractionBox["h5", + RowBox[{"36", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox[ + RowBox[{"2", " ", + SuperscriptBox["aMax", "2"]}], + SuperscriptBox["jMax", "2"]], "-", + FractionBox[ + RowBox[{"4", " ", "h1"}], + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"]}]]}], "\[Rule]", "h8"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re4h8d", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"-", + FractionBox["h3", + RowBox[{"18", " ", + SuperscriptBox["2", + RowBox[{"2", "/", "3"}]], " ", "h5", " ", + SuperscriptBox["jMax", "4"]}]]}], "-", + FractionBox["h5", + RowBox[{"36", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox[ + RowBox[{"2", " ", + SuperscriptBox["aMax", "2"]}], + SuperscriptBox["jMax", "2"]], "+", + FractionBox[ + RowBox[{"4", " ", "h1"}], + RowBox[{"3", " ", + SuperscriptBox["jMax", "2"]}]]}], "\[Rule]", "h8"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"5", ",", "3", ",", "4"}], "]"}], "]"}], "//.", "re4h1"}], + "//.", "re4h2"}], "//.", "re4h3"}], "//.", "re4h4d"}], "//.", + "re4h5"}], "//.", "re4h6d"}], "//.", "re4h7d"}], "//.", + "re4h8d"}]}], "Input", + CellChangeTimes->{{3.817136352082102*^9, 3.8171363629375677`*^9}, { + 3.817136398034297*^9, 3.8171364089066467`*^9}, {3.817136444545594*^9, + 3.8171364446061*^9}, {3.817136860261939*^9, 3.8171370439723463`*^9}, { + 3.8171795798161993`*^9, 3.817179640379369*^9}, {3.817189372211543*^9, + 3.81718954078054*^9}}, + CellLabel-> + "In[497]:=",ExpressionUUID->"974e8e10-d3f1-4e6a-a853-9fc5dad435e4"], + +Cell[BoxData[ + RowBox[{"t4", "\[Rule]", + FractionBox[ + RowBox[{ + RowBox[{"-", + SuperscriptBox["aMax", "2"]}], "+", + FractionBox[ + RowBox[{ + SuperscriptBox["a0", "2"], " ", "aMax"}], + RowBox[{"h6", " ", "jMax"}]], "-", + FractionBox[ + RowBox[{"2", " ", "a0", " ", + SuperscriptBox["aMax", "2"]}], + RowBox[{"h6", " ", "jMax"}]], "+", + FractionBox[ + RowBox[{"2", " ", + SuperscriptBox["aMax", "3"]}], + RowBox[{"h6", " ", "jMax"}]], "-", + RowBox[{"aMax", " ", "h6", " ", "jMax"}], "+", + RowBox[{"aMax", " ", + SqrtBox[ + RowBox[{"h7", "+", "h8"}]], " ", "jMax"}], "-", + RowBox[{"h6", " ", + SqrtBox[ + RowBox[{"h7", "+", "h8"}]], " ", + SuperscriptBox["jMax", "2"]}], "-", + FractionBox[ + RowBox[{"2", " ", + SuperscriptBox["aMax", "2"], " ", "tf"}], "h6"], "-", + FractionBox[ + RowBox[{"2", " ", "aMax", " ", "v0"}], "h6"], "+", + FractionBox[ + RowBox[{"2", " ", "aMax", " ", "vf"}], "h6"]}], + RowBox[{"2", " ", "aMax", " ", "jMax"}]]}]], "Output", + CellChangeTimes->{{3.817136437635976*^9, 3.817136445094068*^9}, + 3.817136684960446*^9, {3.8171369093989677`*^9, 3.817136975163661*^9}, { + 3.8171370184508266`*^9, 3.817137044312427*^9}, {3.817179593493969*^9, + 3.817179640912674*^9}, 3.8171893531385202`*^9, {3.817189387244194*^9, + 3.817189425154619*^9}, {3.817189469084544*^9, 3.8171894924226017`*^9}, { + 3.817189523722103*^9, 3.8171895413281193`*^9}}, + CellLabel-> + "Out[509]=",ExpressionUUID->"fee03818-edb7-4c7e-adf9-6057b529fee0"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{"re4h8d", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}], "]"}], ",", "CForm"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.817179658547801*^9, 3.8171796596039267`*^9}, { + 3.817179732048368*^9, 3.817179800283423*^9}, {3.817189578678035*^9, + 3.817189614885315*^9}}, + CellLabel-> + "In[518]:=",ExpressionUUID->"74f7a769-943f-439a-b0fe-982782319c14"], + +Cell[BoxData["\<\"(-2*Power(2,0.3333333333333333)*h3 + \ +h5*(-(Power(2,0.6666666666666666)*h5) + 48*(3*Power(aMax,2) + \ +2*h1)*Power(jMax,2)))/(72.*h5*Power(jMax,4))\"\>"], "Output", + CellChangeTimes->{ + 3.8171796601903057`*^9, {3.817179715531847*^9, 3.817179800800613*^9}, { + 3.817189579615213*^9, 3.8171896154044333`*^9}}, + CellLabel-> + "Out[518]=",ExpressionUUID->"9824cb0f-3f12-4424-9d36-486c355fab98"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"5", ",", "2", ",", "2", ",", "2"}], "]"}], "]"}], "//.", + "re4h1"}], "//.", "re4h2"}], "//.", "re4h3"}], "//.", "re4h4d"}], + "//.", "re4h5"}], "//.", "re4h6d"}], "//.", "re4h7d"}], "//.", + "re4h8d"}], "]"}], ",", "CForm"}], "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.8171796860227833`*^9, 3.817179691723728*^9}, { + 3.817179813713192*^9, 3.817179891437944*^9}, {3.8171896816953783`*^9, + 3.817189745053048*^9}, {3.8171898697690487`*^9, 3.817189874887108*^9}, { + 3.8171899359227667`*^9, 3.817189935966551*^9}}, + CellLabel-> + "In[542]:=",ExpressionUUID->"d68ce2f0-b649-4203-8509-b3f21c8f28cb"], + +Cell[BoxData["\<\"(Power(a0,2)*aMax + 2*Power(aMax,3) + Power(h6,2)*Sqrt(-h7 \ ++ h8)*Power(jMax,3) - 2*a0*aMax*(aMax - h6*jMax) - Power(aMax,2)*jMax*(5*h6 + \ +2*tf) + aMax*jMax*(Power(h6,2)*jMax - h6*Sqrt(-h7 + h8)*jMax + 2*h6*jMax*tf - \ +2*v0 + 2*vf))/(2.*aMax*h6*Power(jMax,2))\"\>"], "Output", + CellChangeTimes->{ + 3.81717969243594*^9, {3.817179814257433*^9, 3.817179891948389*^9}, { + 3.817189690026924*^9, 3.817189745407113*^9}, {3.817189871684204*^9, + 3.8171898753981256`*^9}, 3.8171899364308434`*^9, 3.817190169152007*^9}, + CellLabel-> + "Out[542]=",ExpressionUUID->"fe413dc7-5e2a-4520-9d33-8f49c70c7b41"] +}, Open ]], + +Cell["Case 8", "Text", + CellChangeTimes->{{3.817125801492631*^9, + 3.8171258019650087`*^9}},ExpressionUUID->"711a5ce3-235c-4dbf-9218-\ +066b4eb46c49"], + +Cell[BoxData[{ + RowBox[{ + RowBox[{"re8h1", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"8", " ", "p0"}], "-", + RowBox[{"8", " ", "pf"}], "+", + RowBox[{"a0", " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"4", " ", "tf", " ", "v0"}], "+", + RowBox[{"4", " ", "tf", " ", "vf"}]}], ")"}], "\[Rule]", "h1"}], ",", + + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"8", " ", "p0", " ", "tf"}], "-", + RowBox[{"8", " ", "pf", " ", "tf"}], "+", + RowBox[{"a0", " ", + SuperscriptBox["tf", "3"]}], "+", + RowBox[{"4", " ", + SuperscriptBox["tf", "2"], " ", "v0"}], "+", + RowBox[{"4", " ", + SuperscriptBox["tf", "2"], " ", "vf"}]}], ")"}], "\[Rule]", + RowBox[{"tf", " ", "h1"}]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h2", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "16"}], " ", "a0", " ", "p0"}], "+", + RowBox[{"16", " ", "a0", " ", "pf"}], "+", + RowBox[{ + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"8", " ", + SuperscriptBox["v0", "2"]}], "-", + RowBox[{"16", " ", "a0", " ", "tf", " ", "vf"}], "-", + RowBox[{"16", " ", "v0", " ", "vf"}], "+", + RowBox[{"8", " ", + SuperscriptBox["vf", "2"]}]}], ")"}], "\[Rule]", "h2"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h3", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"432", " ", + SuperscriptBox["h2", "3"]}], "+", + RowBox[{"3888", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["h1", "2"], " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"2592", " ", + SuperscriptBox["a0", "3"], " ", "h1", " ", "h2", " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"1296", " ", + SuperscriptBox["a0", "4"], " ", "h2", " ", + SuperscriptBox["tf", "4"]}], "-", + RowBox[{"1296", " ", + SuperscriptBox["a0", "6"], " ", + SuperscriptBox["tf", "6"]}]}], ")"}], "\[Rule]", "h3"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h4", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"36", " ", + SuperscriptBox["h2", "2"]}], "+", + RowBox[{"144", " ", + SuperscriptBox["a0", "3"], " ", "h1", " ", + SuperscriptBox["tf", "2"]}], "-", + RowBox[{"36", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["tf", "4"]}]}], ")"}], "\[Rule]", "h4"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h5", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"h3", "+", + SqrtBox[ + RowBox[{ + SuperscriptBox["h3", "2"], "-", + RowBox[{"4", " ", + SuperscriptBox["h4", "3"]}]}]]}], ")"}], + RowBox[{"1", "/", "3"}]], "\[Rule]", "h5"}], ",", + RowBox[{ + FractionBox["1", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"h3", "+", + SqrtBox[ + RowBox[{ + SuperscriptBox["h3", "2"], "-", + RowBox[{"4", " ", + SuperscriptBox["h4", "3"]}]}]]}], ")"}], + RowBox[{"1", "/", "3"}]]], "\[Rule]", + FractionBox["1", "h5"]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h6", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + SqrtBox[ + RowBox[{ + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["h1", "2"]}], + SuperscriptBox["tf", "6"]], "+", + FractionBox[ + RowBox[{"4", " ", "h2"}], + RowBox[{"3", " ", + SuperscriptBox["tf", "4"]}]], "-", + FractionBox[ + RowBox[{ + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h4"}], + RowBox[{"9", " ", "h5", " ", + SuperscriptBox["tf", "4"]}]], "-", + FractionBox["h5", + RowBox[{"9", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["tf", "4"]}]]}]], "\[Rule]", "h6"}], ",", + RowBox[{ + FractionBox["1", + SqrtBox[ + RowBox[{ + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["h1", "2"]}], + SuperscriptBox["tf", "6"]], "+", + FractionBox[ + RowBox[{"4", " ", "h2"}], + RowBox[{"3", " ", + SuperscriptBox["tf", "4"]}]], "-", + FractionBox[ + RowBox[{ + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h4"}], + RowBox[{"9", " ", "h5", " ", + SuperscriptBox["tf", "4"]}]], "-", + FractionBox["h5", + RowBox[{"9", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["tf", "4"]}]]}]]], "\[Rule]", + FractionBox["1", "h6"]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h7", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + FractionBox[ + RowBox[{"8", " ", + SuperscriptBox["h1", "2"]}], + SuperscriptBox["tf", "6"]], "+", + FractionBox[ + RowBox[{"8", " ", "h2"}], + RowBox[{"3", " ", + SuperscriptBox["tf", "4"]}]], "+", + FractionBox[ + RowBox[{ + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h4"}], + RowBox[{"9", " ", "h5", " ", + SuperscriptBox["tf", "4"]}]], "+", + FractionBox["h5", + RowBox[{"9", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["tf", "4"]}]]}], "\[Rule]", "h7"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h8", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + FractionBox[ + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{"64", " ", + SuperscriptBox["h1", "3"]}], + SuperscriptBox["tf", "9"]]}], "-", + FractionBox[ + RowBox[{"32", " ", "h1", " ", "h2"}], + SuperscriptBox["tf", "7"]], "+", + FractionBox[ + RowBox[{"32", " ", + SuperscriptBox["a0", "3"]}], + RowBox[{"3", " ", + SuperscriptBox["tf", "3"]}]]}], + RowBox[{"4", " ", "h6"}]], "\[Rule]", "h8"}], ",", + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{"64", " ", + SuperscriptBox["h1", "3"]}], + SuperscriptBox["tf", "9"]]}], "-", + FractionBox[ + RowBox[{"32", " ", "h1", " ", "h2"}], + SuperscriptBox["tf", "7"]], "+", + FractionBox[ + RowBox[{"32", " ", + SuperscriptBox["a0", "3"]}], + RowBox[{"3", " ", + SuperscriptBox["tf", "3"]}]]}], + RowBox[{"4", " ", "h6"}]]}], "\[Rule]", "h8"}]}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h9", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", + FractionBox["h6", "2"]}], "-", + FractionBox[ + SqrtBox[ + RowBox[{"h7", "+", "h8"}]], "2"], "-", + FractionBox["h1", + SuperscriptBox["tf", "3"]]}], ")"}], " ", "\[Rule]", "h9"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h10", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", + FractionBox["h6", "2"]}], "+", + FractionBox[ + SqrtBox[ + RowBox[{"h7", "+", "h8"}]], "2"], "-", + FractionBox["h1", + SuperscriptBox["tf", "3"]]}], ")"}], " ", "\[Rule]", "h10"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h11", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + FractionBox["h6", "2"], "-", + FractionBox[ + SqrtBox[ + RowBox[{"h7", "+", "h8"}]], "2"], "-", + FractionBox["h1", + SuperscriptBox["tf", "3"]]}], ")"}], " ", "\[Rule]", "h11"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re8h12", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + FractionBox["h6", "2"], "+", + FractionBox[ + SqrtBox[ + RowBox[{"h7", "+", "h8"}]], "2"], "-", + FractionBox["h1", + SuperscriptBox["tf", "3"]]}], ")"}], " ", "\[Rule]", "h12"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"3", ",", "1", ",", "1"}], "]"}], "]"}], "//.", + "re8h1"}], "//.", "re8h2"}], "//.", "re8h3"}], "//.", "re8h4"}], + "//.", "re8h5"}], "//.", "re8h6"}], "//.", "re8h7"}], "//.", + "re8h8"}], "//.", "re8h9"}], "//.", "re8h10"}], "//.", "re8h11"}], "//.", + "re8h12"}], ";"}]}], "Input", + CellChangeTimes->{{3.81710113282613*^9, 3.8171012406642303`*^9}, { + 3.817101278463286*^9, 3.817101290168898*^9}, {3.817101322920979*^9, + 3.8171013248262377`*^9}, {3.817101363101307*^9, 3.817101396231799*^9}, { + 3.817101429255208*^9, 3.817101473173008*^9}, {3.81710163118027*^9, + 3.8171017320127993`*^9}, {3.817101767123077*^9, 3.817101889960094*^9}, + 3.817128823829053*^9}, + CellLabel-> + "In[628]:=",ExpressionUUID->"85a6097a-70b5-49a4-ae56-e8dd0a51a428"], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{"re8h7", "[", + RowBox[{"[", + RowBox[{"1", ",", "1"}], "]"}], "]"}], "]"}], ",", "CForm"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.817128829075294*^9, 3.8171288487399893`*^9}}, + CellLabel-> + "In[645]:=",ExpressionUUID->"ff08bb2c-cbc7-4ff9-9446-25236262b0fb"], + +Cell[BoxData["\<\"(8*Power(h1,2))/Power(tf,6) + \ +(2*Power(2,0.3333333333333333)*h4 + 48*h2*h5 + \ +Power(2,0.6666666666666666)*Power(h5,2))/(18.*h5*Power(tf,4))\"\>"], "Output",\ + + CellChangeTimes->{{3.8171288308151493`*^9, 3.817128849068494*^9}}, + CellLabel-> + "Out[645]=",ExpressionUUID->"d79ca432-17e6-4aa4-a418-147377e63ae1"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"3", ",", "1", ",", "1", ",", "2"}], "]"}], "]"}], "//.", + "re8h1"}], "//.", "re8h2"}], "//.", "re8h3"}], "//.", + "re8h4"}], "//.", "re8h5"}], "//.", "re8h6"}], "//.", "re8h7"}], + "//.", "re8h8"}], "//.", "re8h9"}], "//.", "re8h10"}], "//.", + "re8h11"}], "//.", "re8h12"}], "]"}], ",", "CForm"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.817128865716584*^9, 3.817128874084738*^9}}, + CellLabel-> + "In[647]:=",ExpressionUUID->"88f65d51-d426-4c7d-aace-31506d46a598"], + +Cell[BoxData["\<\"(Power(aMax,2)*Power(tf,2) - Power(v0 - vf,2) + \ +2*aMax*(2*p0 - 2*pf + tf*(v0 + vf)))/(2.*Power(aMax,2)*tf)\"\>"], "Output", + CellChangeTimes->{3.817128874971857*^9}, + CellLabel-> + "Out[647]=",ExpressionUUID->"84758f21-14e0-42f6-9b83-cb23c120b6bc"] +}, Open ]], + +Cell["Other unused Profiles", "Text", + CellChangeTimes->{{3.8171006708449373`*^9, + 3.817100681093232*^9}},ExpressionUUID->"c11911ed-fd56-444f-962b-\ +8af3f3a9b05a"], + +Cell[BoxData[ + RowBox[{ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"a5", "\[Equal]", + RowBox[{"-", "aMax"}]}], ",", + RowBox[{"t4", "\[Equal]", "0"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"Join", "[", + RowBox[{"tVars", ",", + RowBox[{"{", "aMax", "}"}]}], "]"}]}], "]"}], ";"}]], "Input", + CellChangeTimes->{{3.816880690372059*^9, 3.8168807164758883`*^9}}, + CellLabel-> + "In[114]:=",ExpressionUUID->"340208a3-1996-4056-a70b-135cb5fa325f"], + +Cell[BoxData[ + RowBox[{ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"a1", "\[Equal]", "aMax"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"t4", "\[Equal]", "0"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"Join", "[", + RowBox[{"tVars", ",", + RowBox[{"{", "aMax", "}"}]}], "]"}]}], "]"}], ";"}]], "Input", + CellChangeTimes->{{3.816880641803721*^9, 3.816880653516301*^9}, { + 3.817015141587946*^9, 3.817015171574027*^9}}, + CellLabel-> + "In[186]:=",ExpressionUUID->"b9fc4b80-b964-4452-bfa0-1bacfaa6b76f"], + +Cell["Result 3", "Text", + CellChangeTimes->{{3.817011878008453*^9, + 3.817011879031726*^9}},ExpressionUUID->"99449829-c4bf-4429-bccb-\ +5da052e184d9"], + +Cell[BoxData[{ + RowBox[{ + RowBox[{"re3h1", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"5", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"]}], "+", + RowBox[{"4", " ", "a0", " ", "aMax", " ", + SuperscriptBox["jMax", "2"]}], "+", + RowBox[{ + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "2"]}], "-", + RowBox[{"2", " ", "aMax", " ", + SuperscriptBox["jMax", "3"], " ", "tf"}], "+", + RowBox[{"2", " ", + SuperscriptBox["jMax", "3"], " ", "v0"}], "-", + RowBox[{"2", " ", + SuperscriptBox["jMax", "3"], " ", "vf"}]}], ")"}], "\[Rule]", "h1"}], + "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re3h2", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "a0", " ", + SuperscriptBox["jMax", "3"]}], "+", + RowBox[{"aMax", " ", + SuperscriptBox["jMax", "3"]}]}], ")"}], "\[Rule]", "h2"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re3h3", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + SuperscriptBox["a0", "3"], " ", "jMax"}], "+", + RowBox[{ + SuperscriptBox["a0", "2"], " ", "aMax", " ", "jMax"}], "+", + RowBox[{"a0", " ", + SuperscriptBox["aMax", "2"], " ", "jMax"}], "-", + RowBox[{"2", " ", "a0", " ", "aMax", " ", + SuperscriptBox["jMax", "2"], " ", "tf"}], "+", + RowBox[{"2", " ", "a0", " ", + SuperscriptBox["jMax", "2"], " ", "v0"}], "-", + RowBox[{"2", " ", "a0", " ", + SuperscriptBox["jMax", "2"], " ", "vf"}]}], ")"}], "\[Rule]", "h3"}], + "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re3h4", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"3", " ", + SuperscriptBox["a0", "4"]}], "+", + RowBox[{"4", " ", + SuperscriptBox["a0", "3"], " ", "aMax"}], "+", + RowBox[{"6", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["aMax", "2"]}], "-", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "2"], " ", "p0"}], "+", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "2"], " ", "pf"}], "-", + RowBox[{"12", " ", + SuperscriptBox["a0", "2"], " ", "aMax", " ", "jMax", " ", "tf"}], "+", + RowBox[{"12", " ", + SuperscriptBox["a0", "2"], " ", "jMax", " ", "v0"}], "+", + RowBox[{"12", " ", + SuperscriptBox["aMax", "2"], " ", "jMax", " ", "v0"}], "-", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "2"], " ", "tf", " ", "v0"}], "+", + RowBox[{"12", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["v0", "2"]}], "-", + RowBox[{"12", " ", + SuperscriptBox["a0", "2"], " ", "jMax", " ", "vf"}], "-", + RowBox[{"12", " ", + SuperscriptBox["aMax", "2"], " ", "jMax", " ", "vf"}], "-", + RowBox[{"24", " ", + SuperscriptBox["jMax", "2"], " ", "v0", " ", "vf"}], "+", + RowBox[{"12", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], "\[Rule]", "h4"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re3h5", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"576", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"1152", " ", + SuperscriptBox["a0", "3"], " ", "aMax", " ", + SuperscriptBox["jMax", "4"]}], "-", + RowBox[{"576", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "4"]}], "-", + RowBox[{"576", " ", "a0", " ", + SuperscriptBox["aMax", "3"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"144", " ", + SuperscriptBox["aMax", "4"], " ", + SuperscriptBox["jMax", "4"]}], "-", + RowBox[{"3456", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "p0"}], "+", + RowBox[{"3456", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "pf"}], "+", + RowBox[{"2304", " ", + SuperscriptBox["a0", "2"], " ", "aMax", " ", + SuperscriptBox["jMax", "5"], " ", "tf"}], "+", + RowBox[{"1152", " ", "a0", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "tf"}], "-", + RowBox[{"576", " ", + SuperscriptBox["aMax", "3"], " ", + SuperscriptBox["jMax", "5"], " ", "tf"}], "+", + RowBox[{"576", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["tf", "2"]}], "-", + RowBox[{"2304", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "-", + RowBox[{"1152", " ", "a0", " ", "aMax", " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "+", + RowBox[{"2304", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "-", + RowBox[{"4608", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "tf", " ", "v0"}], "+", + RowBox[{"2304", " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"2304", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "vf"}], "+", + RowBox[{"1152", " ", "a0", " ", "aMax", " ", + SuperscriptBox["jMax", "5"], " ", "vf"}], "-", + RowBox[{"2304", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "vf"}], "+", + RowBox[{"1152", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "tf", " ", "vf"}], "-", + RowBox[{"4608", " ", + SuperscriptBox["jMax", "6"], " ", "v0", " ", "vf"}], "+", + RowBox[{"2304", " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], "\[Rule]", "h5"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re3h6", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"4", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"8", " ", + SuperscriptBox["a0", "3"], " ", "aMax", " ", + SuperscriptBox["jMax", "4"]}], "-", + RowBox[{"4", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "4"]}], "-", + RowBox[{"4", " ", "a0", " ", + SuperscriptBox["aMax", "3"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{ + SuperscriptBox["aMax", "4"], " ", + SuperscriptBox["jMax", "4"]}], "-", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "p0"}], "+", + RowBox[{"24", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "pf"}], "+", + RowBox[{"16", " ", + SuperscriptBox["a0", "2"], " ", "aMax", " ", + SuperscriptBox["jMax", "5"], " ", "tf"}], "+", + RowBox[{"8", " ", "a0", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "tf"}], "-", + RowBox[{"4", " ", + SuperscriptBox["aMax", "3"], " ", + SuperscriptBox["jMax", "5"], " ", "tf"}], "+", + RowBox[{"4", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["tf", "2"]}], "-", + RowBox[{"16", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "-", + RowBox[{"8", " ", "a0", " ", "aMax", " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "+", + RowBox[{"16", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "-", + RowBox[{"32", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "tf", " ", "v0"}], "+", + RowBox[{"16", " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"16", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "vf"}], "+", + RowBox[{"8", " ", "a0", " ", "aMax", " ", + SuperscriptBox["jMax", "5"], " ", "vf"}], "-", + RowBox[{"16", " ", + SuperscriptBox["aMax", "2"], " ", + SuperscriptBox["jMax", "5"], " ", "vf"}], "+", + RowBox[{"8", " ", "aMax", " ", + SuperscriptBox["jMax", "6"], " ", "tf", " ", "vf"}], "-", + RowBox[{"32", " ", + SuperscriptBox["jMax", "6"], " ", "v0", " ", "vf"}], "+", + RowBox[{"16", " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], "\[Rule]", "h6"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re3h7", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"3456", " ", + SuperscriptBox["h1", "3"]}], "-", + RowBox[{"62208", " ", "h1", " ", "h2", " ", "h3"}], "+", + RowBox[{"15552", " ", + SuperscriptBox["h2", "2"], " ", "h4"}], "+", + RowBox[{"186624", " ", + SuperscriptBox["h3", "2"], " ", + SuperscriptBox["jMax", "4"]}], "-", + RowBox[{"10368", " ", "h1", " ", "h4", " ", + SuperscriptBox["jMax", "4"]}]}], ")"}], "\[Rule]", "h7"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re3h8", "=", + RowBox[{"{", + RowBox[{ + FractionBox[ + RowBox[{ + RowBox[{"5", " ", + SuperscriptBox["a0", "2"]}], "+", + RowBox[{"4", " ", "a0", " ", "aMax"}], "+", + SuperscriptBox["aMax", "2"], "-", + RowBox[{"2", " ", "aMax", " ", "jMax", " ", "tf"}], "+", + RowBox[{"2", " ", "jMax", " ", "v0"}], "-", + RowBox[{"2", " ", "jMax", " ", "vf"}]}], + SuperscriptBox["jMax", "2"]], "\[Rule]", "h8"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"re3h9", "=", + RowBox[{"{", + RowBox[{ + RowBox[{ + SqrtBox[ + RowBox[{ + RowBox[{"-", "h8"}], "+", + FractionBox["h1", + RowBox[{"3", " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h6"}], + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"h7", "+", + SqrtBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "4"}], " ", + SuperscriptBox["h5", "3"]}], "+", + SuperscriptBox["h7", "2"]}]]}], ")"}], + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox[ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"h7", "+", + SqrtBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "4"}], " ", + SuperscriptBox["h5", "3"]}], "+", + SuperscriptBox["h7", "2"]}]]}], ")"}], + RowBox[{"1", "/", "3"}]], + RowBox[{"36", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox[ + SuperscriptBox[ + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "a0"}], "+", "aMax"}], ")"}], "2"], + SuperscriptBox["jMax", "2"]]}]], "\[Rule]", "h9"}], ",", + RowBox[{ + FractionBox["1", + SqrtBox[ + RowBox[{ + RowBox[{"-", "h8"}], "+", + FractionBox["h1", + RowBox[{"3", " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox[ + RowBox[{"4", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", "h6"}], + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"h7", "+", + SqrtBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "4"}], " ", + SuperscriptBox["h5", "3"]}], "+", + SuperscriptBox["h7", "2"]}]]}], ")"}], + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox[ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"h7", "+", + SqrtBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "4"}], " ", + SuperscriptBox["h5", "3"]}], "+", + SuperscriptBox["h7", "2"]}]]}], ")"}], + RowBox[{"1", "/", "3"}]], + RowBox[{"36", " ", + SuperscriptBox["2", + RowBox[{"1", "/", "3"}]], " ", + SuperscriptBox["jMax", "4"]}]], "+", + FractionBox[ + SuperscriptBox[ + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "a0"}], "+", "aMax"}], ")"}], "2"], + SuperscriptBox["jMax", "2"]]}]]], "\[Rule]", + FractionBox["1", "h9"]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"re3h10", "=", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", + FractionBox[ + RowBox[{"8", " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "a0"}], "+", "aMax"}], ")"}], "3"]}], + SuperscriptBox["jMax", "3"]]}], "+", + FractionBox[ + RowBox[{"8", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "a0"}], "+", "aMax"}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"5", " ", + SuperscriptBox["a0", "2"]}], "+", + RowBox[{"4", " ", "a0", " ", "aMax"}], "+", + SuperscriptBox["aMax", "2"], "-", + RowBox[{"2", " ", "aMax", " ", "jMax", " ", "tf"}], "+", + RowBox[{"2", " ", "jMax", " ", "v0"}], "-", + RowBox[{"2", " ", "jMax", " ", "vf"}]}], ")"}]}], + SuperscriptBox["jMax", "3"]], "+", + FractionBox[ + RowBox[{"16", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", + SuperscriptBox["a0", "3"]}], "-", + RowBox[{ + SuperscriptBox["a0", "2"], " ", "aMax"}], "-", + RowBox[{"a0", " ", + SuperscriptBox["aMax", "2"]}], "+", + RowBox[{"2", " ", "a0", " ", "aMax", " ", "jMax", " ", "tf"}], + "-", + RowBox[{"2", " ", "a0", " ", "jMax", " ", "v0"}], "+", + RowBox[{"2", " ", "a0", " ", "jMax", " ", "vf"}]}], ")"}]}], + SuperscriptBox["jMax", "3"]]}], ")"}], "\[Rule]", "h10"}], "}"}]}], + ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"tResult3", "//.", "re3h1"}], "//.", "re3h2"}], "//.", + "re3h3"}], "//.", "re3h4"}], "//.", "re3h5"}], "//.", "re3h6"}], "//.", + "re3h7"}], "//.", "re3h8"}], "//.", "re3h9"}], "//.", "re3h10"}], + ";"}]}], "Input", + CellChangeTimes->{{3.81701192088857*^9, 3.817011937329224*^9}, { + 3.817011976654461*^9, 3.817012061681684*^9}, {3.817012093597724*^9, + 3.8170121832022953`*^9}, {3.817012225263556*^9, 3.817012275630189*^9}, { + 3.817012317193757*^9, 3.817012390803095*^9}, 3.817016045184597*^9}, + CellLabel-> + "In[230]:=",ExpressionUUID->"b9e54b84-cf4e-4e09-ab7a-a99715a91325"], + +Cell[BoxData[ + RowBox[{ + RowBox[{"as", "=", + RowBox[{"resultT", "[", + RowBox[{"[", "6", "]"}], "]"}]}], ";"}]], "Input", + CellChangeTimes->{{3.8171006408905087`*^9, 3.8171006532394733`*^9}, { + 3.8171830602007923`*^9, 3.8171830602862663`*^9}}, + CellLabel-> + "In[339]:=",ExpressionUUID->"98d6e25b-fc2d-4463-90d0-1a15fbf23a75"], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"coeffList", "=", + RowBox[{"Simplify", "[", + RowBox[{"CoefficientList", "[", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{"as", "[", + RowBox[{"[", + RowBox[{"1", ",", "1", ",", "2", ",", "1"}], "]"}], "]"}], ")"}], + "[", "x", "]"}], ",", "x"}], "]"}], "]"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"coeffList", "[", + RowBox[{"[", "1", "]"}], "]"}], ",", "CForm"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.817015630482379*^9, 3.817015699579877*^9}, { + 3.8170158213033857`*^9, 3.817015822346319*^9}, {3.817015861091714*^9, + 3.817016022796631*^9}, {3.817016112152273*^9, 3.8170161251799593`*^9}, { + 3.817016382602413*^9, 3.817016433034585*^9}, {3.817016470737545*^9, + 3.817016475958074*^9}, {3.817016508040059*^9, 3.817016544146542*^9}, { + 3.8170412610879087`*^9, 3.8170412652154512`*^9}, {3.817183088042494*^9, + 3.817183091554728*^9}, {3.8171831470354977`*^9, 3.817183176507427*^9}}, + CellLabel-> + "In[367]:=",ExpressionUUID->"62b88e2e-78df-4751-b6b7-001704723f20"], + +Cell[BoxData["\<\"11*Power(a0,6) - 12*Power(a0,5)*jMax*tf - \ +24*Power(a0,3)*Power(jMax,2)*(p0 - pf + tf*v0) + \ +36*Power(a0,2)*Power(jMax,2)*(2*jMax*tf*(p0 - pf + tf*v0) + 3*Power(v0 - \ +vf,2)) + 72*Power(jMax,3)*(jMax*Power(p0 - pf + tf*v0,2) + Power(v0 - vf,3)) \ ++ 18*Power(a0,4)*jMax*(jMax*Power(tf,2) + 3*v0 - 3*vf)\"\>"], "Output", + CellChangeTimes->{{3.817016423162524*^9, 3.8170164334486322`*^9}, { + 3.817016471115822*^9, 3.817016476221561*^9}, {3.8170165086034603`*^9, + 3.817016544456704*^9}, {3.817041261623364*^9, 3.817041265629828*^9}, + 3.817100651260556*^9, {3.8171830689973307`*^9, 3.817183092620983*^9}, { + 3.817183138127295*^9, 3.817183176836114*^9}}, + CellLabel-> + "Out[368]=",ExpressionUUID->"b40240b0-47e7-4e6d-945b-939c5a3558fa"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{ + RowBox[{"as", "[", + RowBox[{"[", + RowBox[{"1", ",", "7", ",", "2"}], "]"}], "]"}], "//.", + RowBox[{"{", + RowBox[{ + RowBox[{"as", "[", + RowBox[{"[", + RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}], "\[Rule]", "tz"}], + "}"}]}], "]"}], ",", "CForm"}], "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.8170213875291147`*^9, 3.817021517431411*^9}, { + 3.817021610630934*^9, 3.8170216229577513`*^9}, {3.81702165397233*^9, + 3.817021654078795*^9}, 3.817021754609929*^9, {3.817022079241701*^9, + 3.817022082475205*^9}, {3.8170328148821487`*^9, 3.8170328149383917`*^9}, + 3.8170955040530987`*^9, {3.817187869203045*^9, 3.81718788043687*^9}, { + 3.817188154207644*^9, 3.8171881567337*^9}, {3.817188739822859*^9, + 3.817188774378365*^9}}, + CellLabel-> + "In[388]:=",ExpressionUUID->"158b4300-bfb7-4b5a-8159-758d681ae08d"], + +Cell[BoxData["\<\"-((18*Power(a0,7) - Power(a0,6)*jMax*(19*tf - 157*tz) + \ +6*Power(a0,4)*Power(jMax,2)*(jMax*tz*(23*Power(tf,2) - 52*tf*tz + \ +99*Power(tz,2)) + 7*(tf - 3*tz)*(v0 - vf)) + \ +6*Power(a0,5)*jMax*(5*jMax*Power(tf,2) - 22*jMax*tf*tz + 79*jMax*Power(tz,2) \ ++ 2*v0 - 2*vf) + \ +12*Power(a0,3)*Power(jMax,2)*(Power(jMax,2)*Power(tz,2)*(11*Power(tf,2) - \ +22*tf*tz + 28*Power(tz,2)) - 6*Power(v0 - vf,2) + jMax*(4*p0*(tf + 2*tz) - \ +4*pf*(tf + 2*tz) - Power(tf,2)*v0 + 26*tf*tz*v0 - 75*Power(tz,2)*v0 + \ +5*Power(tf,2)*vf - 18*tf*tz*vf + 75*Power(tz,2)*vf)) + \ +144*a0*Power(jMax,3)*(-Power(v0 - vf,3) - jMax*(v0 - vf)*(-(pf*tf) + p0*(tf - \ +3*tz) + 3*pf*tz + Power(tf,2)*v0 + 3*Power(tz,2)*v0 - 3*tf*tz*vf - \ +3*Power(tz,2)*vf) + Power(jMax,2)*tz*(p0*(Power(tf,2) - 2*tf*tz + \ +3*Power(tz,2)) - pf*(Power(tf,2) - 2*tf*tz + 3*Power(tz,2)) - \ +2*Power(tf,2)*tz*v0 + 4*tf*Power(tz,2)*v0 - 5*Power(tz,3)*v0 + Power(tf,3)*vf \ +- tf*Power(tz,2)*vf + 5*Power(tz,3)*vf)) + \ +36*Power(a0,2)*Power(jMax,3)*(Power(jMax,2)*Power(tz,3)*(Power(tf,2) - \ +2*tf*tz + 2*Power(tz,2)) + (v0 - vf)*(4*p0 - 4*pf + tf*v0 - 15*tz*v0 + \ +3*tf*vf + 15*tz*vf) + jMax*(p0*(Power(tf,2) - 2*tf*tz + 11*Power(tz,2)) - \ +pf*(Power(tf,2) - 2*tf*tz + 11*Power(tz,2)) - 8*Power(tf,2)*tz*v0 + \ +20*tf*Power(tz,2)*v0 - 36*Power(tz,3)*v0 + Power(tf,3)*vf + \ +6*Power(tf,2)*tz*vf - 9*tf*Power(tz,2)*vf + 36*Power(tz,3)*vf)) + \ +72*Power(jMax,4)*(-((tf + tz)*Power(v0 - vf,3)) + \ +Power(jMax,2)*Power(tz,2)*(Power(tf,2) - 2*tf*tz + 2*Power(tz,2))*(p0 - pf - \ +tz*v0 + tf*vf + tz*vf) + jMax*(Power(p0,2)*(tf - tz) + Power(pf,2)*(tf - tz) \ +- Power(tf,2)*tz*Power(v0,2) - Power(tz,3)*Power(v0,2) + Power(tf,3)*v0*vf + \ +3*tf*Power(tz,2)*v0*vf + 2*Power(tz,3)*v0*vf - 3*tf*Power(tz,2)*Power(vf,2) - \ +Power(tz,3)*Power(vf,2) - pf*(-2*tf*tz*v0 + 3*Power(tz,2)*(v0 - vf) + \ +Power(tf,2)*(v0 + vf)) + p0*(-2*pf*(tf - tz) - 2*tf*tz*v0 + 3*Power(tz,2)*(v0 \ +- vf) + Power(tf,2)*(v0 + vf)))))/(jMax*(-Power(a0,6) + \ +6*Power(a0,4)*jMax*(v0 - vf) - 36*Power(a0,2)*Power(jMax,2)*Power(v0 - vf,2) \ ++ 48*Power(a0,3)*Power(jMax,2)*(p0 - pf + tf*vf) - 144*a0*Power(jMax,3)*(v0 - \ +vf)*(p0 - pf + tf*vf) + 72*Power(jMax,3)*(Power(v0 - vf,3) + jMax*Power(p0 - \ +pf + tf*vf,2)))))\"\>"], "Output", + CellChangeTimes->{{3.817187878041869*^9, 3.817187880974881*^9}, { + 3.817188154728222*^9, 3.817188157069378*^9}, {3.817188740646241*^9, + 3.817188774901497*^9}}, + CellLabel-> + "Out[388]=",ExpressionUUID->"e20a6e42-4ef8-4047-8d1b-5377fe92d967"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{"CoefficientList", "[", + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{ + RowBox[{"(", + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"8", ",", "1", ",", "1", ",", "2", ",", "1"}], "]"}], "]"}], + ")"}], "[", + FractionBox["x", "jMax"], "]"}], "]"}], ",", "x"}], "]"}]], "Input", + CellChangeTimes->{{3.8172860924896593`*^9, 3.817286131639638*^9}}, + CellLabel-> + "In[1091]:=",ExpressionUUID->"31e513cf-3262-402d-bad9-4c6b077f7a18"], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"7", " ", + SuperscriptBox["a0", "6"]}], "+", + RowBox[{"24", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", "p0"}], "-", + RowBox[{"24", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", "pf"}], "+", + RowBox[{"12", " ", + SuperscriptBox["a0", "5"], " ", "jMax", " ", "tf"}], "-", + RowBox[{"18", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"54", " ", + SuperscriptBox["a0", "4"], " ", "jMax", " ", "v0"}], "+", + RowBox[{"24", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", "tf", " ", "v0"}], "+", + RowBox[{"108", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"72", " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["v0", "3"]}], "-", + RowBox[{"72", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "tf", " ", + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "v0"}]}], ")"}]}], "-", + RowBox[{"72", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "v0"}]}], ")"}], "2"]}], "-", + RowBox[{"54", " ", + SuperscriptBox["a0", "4"], " ", "jMax", " ", "vf"}], "-", + RowBox[{"216", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", "v0", " ", "vf"}], "-", + RowBox[{"216", " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["v0", "2"], " ", "vf"}], "+", + RowBox[{"108", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["vf", "2"]}], "+", + RowBox[{"216", " ", + SuperscriptBox["jMax", "3"], " ", "v0", " ", + SuperscriptBox["vf", "2"]}], "-", + RowBox[{"72", " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["vf", "3"]}]}], ",", + RowBox[{ + RowBox[{"84", " ", + SuperscriptBox["a0", "5"]}], "+", + RowBox[{"144", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", "p0"}], "-", + RowBox[{"144", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", "pf"}], "+", + RowBox[{"120", " ", + SuperscriptBox["a0", "4"], " ", "jMax", " ", "tf"}], "-", + RowBox[{"144", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"432", " ", + SuperscriptBox["a0", "3"], " ", "jMax", " ", "v0"}], "+", + RowBox[{"144", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", "tf", " ", "v0"}], "+", + RowBox[{"432", " ", "a0", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["v0", "2"]}], "-", + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", "tf", " ", + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "v0"}]}], ")"}]}], "-", + RowBox[{"432", " ", + SuperscriptBox["a0", "3"], " ", "jMax", " ", "vf"}], "-", + RowBox[{"864", " ", "a0", " ", + SuperscriptBox["jMax", "2"], " ", "v0", " ", "vf"}], "+", + RowBox[{"432", " ", "a0", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["vf", "2"]}]}], ",", + RowBox[{ + RowBox[{"366", " ", + SuperscriptBox["a0", "4"]}], "+", + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "2"], " ", "p0"}], "-", + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "2"], " ", "pf"}], "+", + RowBox[{"456", " ", + SuperscriptBox["a0", "3"], " ", "jMax", " ", "tf"}], "-", + RowBox[{"144", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{"p0", "-", "pf"}], ")"}], " ", "tf"}], "-", + RowBox[{"360", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"1080", " ", + SuperscriptBox["a0", "2"], " ", "jMax", " ", "v0"}], "+", + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "2"], " ", "tf", " ", "v0"}], "-", + RowBox[{"144", " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["tf", "2"], " ", "v0"}], "+", + RowBox[{"216", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["v0", "2"]}], "-", + RowBox[{"1080", " ", + SuperscriptBox["a0", "2"], " ", "jMax", " ", "vf"}], "-", + RowBox[{"432", " ", + SuperscriptBox["jMax", "2"], " ", "v0", " ", "vf"}], "+", + RowBox[{"216", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["vf", "2"]}]}], ",", + RowBox[{ + RowBox[{"696", " ", + SuperscriptBox["a0", "3"]}], "+", + RowBox[{"144", " ", + SuperscriptBox["jMax", "2"], " ", "p0"}], "-", + RowBox[{"144", " ", + SuperscriptBox["jMax", "2"], " ", "pf"}], "+", + RowBox[{"792", " ", + SuperscriptBox["a0", "2"], " ", "jMax", " ", "tf"}], "-", + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"864", " ", "a0", " ", "jMax", " ", "v0"}], "+", + RowBox[{"144", " ", + SuperscriptBox["jMax", "2"], " ", "tf", " ", "v0"}], "-", + RowBox[{"864", " ", "a0", " ", "jMax", " ", "vf"}]}], ",", + RowBox[{ + RowBox[{"540", " ", + SuperscriptBox["a0", "2"]}], "+", + RowBox[{"576", " ", "a0", " ", "jMax", " ", "tf"}], "-", + RowBox[{"72", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"216", " ", "jMax", " ", "v0"}], "-", + RowBox[{"216", " ", "jMax", " ", "vf"}]}], ",", + RowBox[{ + RowBox[{"144", " ", "a0"}], "+", + RowBox[{"144", " ", "jMax", " ", "tf"}]}]}], "}"}]], "Output", + CellChangeTimes->{{3.8172860887396727`*^9, 3.8172861323610563`*^9}}, + CellLabel-> + "Out[1091]=",ExpressionUUID->"927ca1f4-b1f2-46e9-b22f-370a4803207d"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"coeffList", "=", + RowBox[{"CoefficientList", "[", + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{ + RowBox[{"(", + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"8", ",", "1", ",", "1", ",", "2", ",", "1"}], "]"}], "]"}], + ")"}], "[", "x", "]"}], "]"}], ",", "x"}], "]"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", + FractionBox[ + RowBox[{"coeffList", "[", + RowBox[{"[", "1", "]"}], "]"}], + RowBox[{"coeffList", "[", + RowBox[{"[", "6", "]"}], "]"}]], "]"}], ",", "CForm"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.8172050596766443`*^9, 3.817205096430847*^9}, { + 3.817205161714704*^9, 3.817205204507474*^9}, {3.817205342632513*^9, + 3.8172053594377728`*^9}, {3.817205477811095*^9, 3.8172054922787247`*^9}, { + 3.817205580650358*^9, 3.817205580727766*^9}, {3.8172074813574257`*^9, + 3.817207487266535*^9}, {3.8172075358693542`*^9, 3.817207559498505*^9}, { + 3.817208273766034*^9, 3.8172082738579206`*^9}, {3.817277227117807*^9, + 3.81727726670625*^9}, {3.817285890550189*^9, 3.817286059089184*^9}, { + 3.8172861404333878`*^9, 3.817286157664342*^9}, {3.817286189209899*^9, + 3.81728618927864*^9}, {3.8172862221323557`*^9, 3.8172862303281937`*^9}, { + 3.817286342699954*^9, 3.81728637246471*^9}}, + CellLabel-> + "In[1122]:=",ExpressionUUID->"7bde4fb2-842b-410a-bcc1-362bed2a8caf"], + +Cell[BoxData["\<\"(7*Power(a0,6) + 12*Power(a0,5)*jMax*tf + \ +24*Power(a0,3)*Power(jMax,2)*(p0 - pf + tf*v0) - \ +36*Power(a0,2)*Power(jMax,2)*(2*jMax*tf*(p0 - pf + tf*v0) - 3*Power(v0 - \ +vf,2)) - 72*Power(jMax,3)*(jMax*Power(p0 - pf + tf*v0,2) - Power(v0 - vf,3)) \ +- 18*Power(a0,4)*jMax*(jMax*Power(tf,2) - 3*v0 + \ +3*vf))/(144.*Power(jMax,5)*(a0 + jMax*tf))\"\>"], "Output", + CellChangeTimes->{{3.81720506408953*^9, 3.817205092568501*^9}, { + 3.817205162528202*^9, 3.8172052048490553`*^9}, {3.817205343057871*^9, + 3.8172053597175207`*^9}, {3.817205478192494*^9, 3.8172054926280537`*^9}, + 3.8172055812292757`*^9, {3.817207482650532*^9, 3.817207559812228*^9}, + 3.81720827440959*^9, {3.8172772231905117`*^9, 3.8172772671682177`*^9}, + 3.817285862097818*^9, {3.8172859014469147`*^9, 3.8172859781367197`*^9}, { + 3.817286017036606*^9, 3.817286059446402*^9}, {3.817286143214819*^9, + 3.8172861580167303`*^9}, 3.817286189698825*^9, {3.817286222643917*^9, + 3.817286230665148*^9}, {3.817286344420539*^9, 3.8172863731709967`*^9}}, + CellLabel-> + "Out[1123]=",ExpressionUUID->"3dcc9912-a43b-4174-a19c-4775a4e8e819"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"8", ",", "2"}], "]"}], "]"}], "/.", "tmpData"}]], "Input", + CellChangeTimes->{{3.81728119298456*^9, 3.817281232944652*^9}}, + CellLabel-> + "In[887]:=",ExpressionUUID->"973ea747-5737-4d06-a9d9-d99114c416a1"], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{ + RowBox[{"t1", "\[Rule]", "0.4398699621977681`"}], ",", + RowBox[{"t2", "\[Rule]", "0"}], ",", + RowBox[{"t3", "\[Rule]", "0.3380842479120538`"}], ",", + RowBox[{"t4", "\[Rule]", "36.89731620636758`"}], ",", + RowBox[{"t5", "\[Rule]", "0.0138647917592348`"}], ",", + RowBox[{"t6", "\[Rule]", "0"}], ",", + RowBox[{"t7", "\[Rule]", "0.0138647917592348`"}], ",", + RowBox[{"3.3`", "\[Rule]", "0.0010764400716220931`"}]}], "}"}]], "Output", + CellChangeTimes->{{3.8172811942615633`*^9, 3.817281233391363*^9}}, + CellLabel-> + "Out[887]=",ExpressionUUID->"aff4b1ef-e052-492e-b19c-e52d78aa043d"] +}, Open ]], + +Cell[BoxData[ + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"8", ",", "2", ",", "8"}], "]"}], "]"}], "//.", + RowBox[{"{", + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"8", ",", "2", ",", "1", ",", "2"}], "]"}], "]"}], "\[Rule]", + "tz"}], "}"}]}]], "Input", + CellChangeTimes->{{3.817281244410479*^9, 3.8172812813722143`*^9}, { + 3.8172847207528133`*^9, 3.817284733541065*^9}, {3.817284788509758*^9, + 3.8172847891390543`*^9}}, + CellLabel-> + "In[974]:=",ExpressionUUID->"c0000ea9-c6f6-47f9-bc66-7c8a7a154c7c"], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{ + RowBox[{ + SuperscriptBox["a0", "2"], "+", + RowBox[{"4", " ", "a0", " ", "jMax", " ", "tz"}], "+", + RowBox[{"2", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["tz", "2"]}], "+", + RowBox[{"2", " ", "jMax", " ", "v0"}]}], "\[Equal]", "0"}], ",", "tz"}], + "]"}], "/.", "tmpData"}]], "Input", + CellChangeTimes->{{3.817286480335883*^9, 3.8172864960194073`*^9}, { + 3.817286567985794*^9, 3.817286568739387*^9}, {3.8172866516018133`*^9, + 3.8172866519263563`*^9}, {3.8172867861219587`*^9, 3.817286786947009*^9}}, + CellLabel-> + "In[1151]:=",ExpressionUUID->"5e9a3dfa-4e2c-4030-9e6a-c6b17de55888"], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{ + RowBox[{"{", + RowBox[{"tz", "\[Rule]", + RowBox[{"-", "0.2360141336196659`"}]}], "}"}], ",", + RowBox[{"{", + RowBox[{"tz", "\[Rule]", "0.4395855621910945`"}], "}"}]}], + "}"}]], "Output", + CellChangeTimes->{3.81728649643434*^9, 3.81728656902905*^9, + 3.8172866522805147`*^9, 3.817286787341216*^9}, + CellLabel-> + "Out[1151]=",ExpressionUUID->"9c1863ed-ca66-49ec-b569-563d55abc9bf"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"8", ",", "2", ",", "1", ",", "2"}], "]"}], "]"}], "/.", + "tmpData"}]], "Input", + CellChangeTimes->{{3.817286783163353*^9, 3.8172867839469624`*^9}}, + CellLabel-> + "In[1150]:=",ExpressionUUID->"546f9925-4556-44e7-a8c2-3230b1c55c46"], + +Cell[BoxData["0.4398699621977681`"], "Output", + CellChangeTimes->{3.817286784292308*^9}, + CellLabel-> + "Out[1150]=",ExpressionUUID->"12b12744-6305-4c68-84a5-82edaa46c7e0"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{"Simplify", "[", + RowBox[{"(", + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"8", ",", "2", ",", "5", ",", "2"}], "]"}], "]"}], "//.", + RowBox[{"{", + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"8", ",", "2", ",", "1", ",", "2"}], "]"}], "]"}], "\[Rule]", + "tz"}], "}"}]}], ")"}], "]"}]], "Input", + CellChangeTimes->{{3.817286730790804*^9, 3.817286770931163*^9}, { + 3.817286807198735*^9, 3.817286808624382*^9}, {3.817286890846471*^9, + 3.8172869081830378`*^9}, {3.8172869974032593`*^9, 3.817287034345417*^9}, { + 3.817287569598755*^9, 3.817287588681838*^9}}, + CellLabel-> + "In[1175]:=",ExpressionUUID->"42f07270-0ef7-4b55-8337-dcbacdfb6ce2"], + +Cell[BoxData[ + RowBox[{"-", + RowBox[{"(", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "12"}], " ", + SuperscriptBox["a0", "7"]}], "-", + RowBox[{ + SuperscriptBox["a0", "6"], " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"19", " ", "tf"}], "+", + RowBox[{"101", " ", "tz"}]}], ")"}]}], "+", + RowBox[{"6", " ", + SuperscriptBox["a0", "5"], " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"5", " ", + SuperscriptBox["tf", "2"]}], "-", + RowBox[{"22", " ", "tf", " ", "tz"}], "-", + RowBox[{"45", " ", + SuperscriptBox["tz", "2"]}]}], ")"}]}], "-", + RowBox[{"6", " ", "v0"}], "+", + RowBox[{"6", " ", "vf"}]}], ")"}]}], "+", + RowBox[{"6", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "6"}], " ", "p0"}], "+", + RowBox[{"6", " ", "pf"}], "+", + RowBox[{"23", " ", "jMax", " ", + SuperscriptBox["tf", "2"], " ", "tz"}], "-", + RowBox[{"52", " ", "jMax", " ", "tf", " ", + SuperscriptBox["tz", "2"]}], "-", + RowBox[{"41", " ", "jMax", " ", + SuperscriptBox["tz", "3"]}], "+", + RowBox[{"7", " ", "tf", " ", "v0"}], "-", + RowBox[{"11", " ", "tz", " ", "v0"}], "-", + RowBox[{"13", " ", "tf", " ", "vf"}], "+", + RowBox[{"11", " ", "tz", " ", "vf"}]}], ")"}]}], "+", + RowBox[{"12", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["tz", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"11", " ", + SuperscriptBox["tf", "2"]}], "-", + RowBox[{"22", " ", "tf", " ", "tz"}], "-", + RowBox[{"6", " ", + SuperscriptBox["tz", "2"]}]}], ")"}]}], "+", + RowBox[{"8", " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "2"]}], "+", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "4"}], " ", "pf", " ", "tf"}], "+", + RowBox[{"4", " ", "p0", " ", + RowBox[{"(", + RowBox[{"tf", "-", + RowBox[{"4", " ", "tz"}]}], ")"}]}], "+", + RowBox[{"16", " ", "pf", " ", "tz"}], "-", + RowBox[{ + SuperscriptBox["tf", "2"], " ", "v0"}], "+", + RowBox[{"26", " ", "tf", " ", "tz", " ", "v0"}], "+", + RowBox[{"25", " ", + SuperscriptBox["tz", "2"], " ", "v0"}], "+", + RowBox[{"5", " ", + SuperscriptBox["tf", "2"], " ", "vf"}], "-", + RowBox[{"42", " ", "tf", " ", "tz", " ", "vf"}], "-", + RowBox[{"25", " ", + SuperscriptBox["tz", "2"], " ", "vf"}]}], ")"}]}]}], ")"}]}], + "+", + RowBox[{"36", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + SuperscriptBox["jMax", "2"], " ", "tf", " ", + RowBox[{"(", + RowBox[{"tf", "-", + RowBox[{"2", " ", "tz"}]}], ")"}], " ", + SuperscriptBox["tz", "3"]}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{"tf", "+", + RowBox[{"19", " ", "tz"}]}], ")"}], " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "2"]}], "+", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "pf"}], " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"2", " ", "pf", " ", "tf", " ", "tz"}], "+", + RowBox[{"9", " ", "pf", " ", + SuperscriptBox["tz", "2"]}], "+", + RowBox[{"p0", " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox["tf", "2"], "-", + RowBox[{"2", " ", "tf", " ", "tz"}], "-", + RowBox[{"9", " ", + SuperscriptBox["tz", "2"]}]}], ")"}]}], "-", + RowBox[{"8", " ", + SuperscriptBox["tf", "2"], " ", "tz", " ", "v0"}], "+", + RowBox[{"20", " ", "tf", " ", + SuperscriptBox["tz", "2"], " ", "v0"}], "+", + RowBox[{"12", " ", + SuperscriptBox["tz", "3"], " ", "v0"}], "+", + RowBox[{ + SuperscriptBox["tf", "3"], " ", "vf"}], "+", + RowBox[{"6", " ", + SuperscriptBox["tf", "2"], " ", "tz", " ", "vf"}], "-", + RowBox[{"29", " ", "tf", " ", + SuperscriptBox["tz", "2"], " ", "vf"}], "-", + RowBox[{"12", " ", + SuperscriptBox["tz", "3"], " ", "vf"}]}], ")"}]}]}], ")"}]}], + "+", + RowBox[{"144", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "3"], "-", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"p0", " ", + RowBox[{"(", + RowBox[{"tf", "+", "tz"}], ")"}]}], "-", + RowBox[{"pf", " ", + RowBox[{"(", + RowBox[{"tf", "+", "tz"}], ")"}]}], "+", + RowBox[{ + SuperscriptBox["tf", "2"], " ", "v0"}], "-", + RowBox[{"5", " ", + SuperscriptBox["tz", "2"], " ", "v0"}], "+", + RowBox[{"tf", " ", "tz", " ", "vf"}], "+", + RowBox[{"5", " ", + SuperscriptBox["tz", "2"], " ", "vf"}]}], ")"}]}], "+", + RowBox[{ + SuperscriptBox["jMax", "2"], " ", "tz", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"p0", " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox["tf", "2"], "-", + RowBox[{"2", " ", "tf", " ", "tz"}], "-", + SuperscriptBox["tz", "2"]}], ")"}]}], "+", + RowBox[{"pf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"2", " ", "tf", " ", "tz"}], "+", + SuperscriptBox["tz", "2"]}], ")"}]}], "-", + RowBox[{"2", " ", + SuperscriptBox["tf", "2"], " ", "tz", " ", "v0"}], "+", + RowBox[{"4", " ", "tf", " ", + SuperscriptBox["tz", "2"], " ", "v0"}], "+", + RowBox[{ + SuperscriptBox["tz", "3"], " ", "v0"}], "+", + RowBox[{ + SuperscriptBox["tf", "3"], " ", "vf"}], "-", + RowBox[{"5", " ", "tf", " ", + SuperscriptBox["tz", "2"], " ", "vf"}], "-", + RowBox[{ + SuperscriptBox["tz", "3"], " ", "vf"}]}], ")"}]}]}], ")"}]}], + "+", + RowBox[{"72", " ", + SuperscriptBox["jMax", "4"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + SuperscriptBox["jMax", "2"], " ", "tf", " ", + RowBox[{"(", + RowBox[{"tf", "-", + RowBox[{"2", " ", "tz"}]}], ")"}], " ", + SuperscriptBox["tz", "2"], " ", + RowBox[{"(", + RowBox[{"p0", "-", "pf", "-", + RowBox[{"tz", " ", "v0"}], "+", + RowBox[{"tf", " ", "vf"}], "+", + RowBox[{"tz", " ", "vf"}]}], ")"}]}], "-", + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "p0"}], "-", + RowBox[{"2", " ", "pf"}], "+", + RowBox[{"tf", " ", "v0"}], "-", + RowBox[{"tz", " ", "v0"}], "+", + RowBox[{"tf", " ", "vf"}], "+", + RowBox[{"tz", " ", "vf"}]}], ")"}]}], "+", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + SuperscriptBox["p0", "2"], " ", + RowBox[{"(", + RowBox[{"tf", "-", "tz"}], ")"}]}], "+", + RowBox[{ + SuperscriptBox["pf", "2"], " ", + RowBox[{"(", + RowBox[{"tf", "-", "tz"}], ")"}]}], "-", + RowBox[{ + SuperscriptBox["tf", "2"], " ", "tz", " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"3", " ", + SuperscriptBox["tz", "3"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{ + SuperscriptBox["tf", "3"], " ", "v0", " ", "vf"}], "-", + RowBox[{"tf", " ", + SuperscriptBox["tz", "2"], " ", "v0", " ", "vf"}], "-", + RowBox[{"6", " ", + SuperscriptBox["tz", "3"], " ", "v0", " ", "vf"}], "+", + RowBox[{"tf", " ", + SuperscriptBox["tz", "2"], " ", + SuperscriptBox["vf", "2"]}], "+", + RowBox[{"3", " ", + SuperscriptBox["tz", "3"], " ", + SuperscriptBox["vf", "2"]}], "-", + RowBox[{"pf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "2"}], " ", "tf", " ", "tz", " ", "v0"}], "+", + RowBox[{ + SuperscriptBox["tz", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "v0"}], "+", "vf"}], ")"}]}], "+", + RowBox[{ + SuperscriptBox["tf", "2"], " ", + RowBox[{"(", + RowBox[{"v0", "+", "vf"}], ")"}]}]}], ")"}]}], "+", + RowBox[{"p0", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "2"}], " ", "pf", " ", + RowBox[{"(", + RowBox[{"tf", "-", "tz"}], ")"}]}], "-", + RowBox[{"2", " ", "tf", " ", "tz", " ", "v0"}], "+", + RowBox[{ + SuperscriptBox["tz", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "v0"}], "+", "vf"}], ")"}]}], "+", + RowBox[{ + SuperscriptBox["tf", "2"], " ", + RowBox[{"(", + RowBox[{"v0", "+", "vf"}], ")"}]}]}], ")"}]}]}], ")"}]}]}], + ")"}]}]}], ")"}], "/", + RowBox[{"(", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", + SuperscriptBox["a0", "6"]}], "+", + RowBox[{"6", " ", + SuperscriptBox["a0", "4"], " ", "jMax", " ", + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}]}], "-", + RowBox[{"36", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "2"]}], "+", + RowBox[{"48", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "vf"}]}], ")"}]}], "-", + RowBox[{"144", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], " ", + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "vf"}]}], ")"}]}], "+", + RowBox[{"72", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "3"], "+", + RowBox[{"jMax", " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "vf"}]}], ")"}], "2"]}]}], ")"}]}]}], + ")"}]}], ")"}]}], ")"}]}]], "Output", + CellChangeTimes->{{3.817286731857327*^9, 3.8172867713428392`*^9}, { + 3.817286805584571*^9, 3.817286808984108*^9}, {3.81728690153216*^9, + 3.817286909799958*^9}, {3.817287006993741*^9, 3.817287034749823*^9}, { + 3.817287571990284*^9, 3.817287589816339*^9}}, + CellLabel-> + "Out[1175]=",ExpressionUUID->"792f3906-7b60-408f-8afa-50ad83f27f0e"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{"qwer", "=", + RowBox[{"Simplify", "[", + RowBox[{"Series", "[", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"8", ",", "2", ",", "5", ",", "2"}], "]"}], "]"}], "//.", + RowBox[{"{", + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"8", ",", "2", ",", "1", ",", "2"}], "]"}], "]"}], + "\[Rule]", "tz"}], "}"}]}], ")"}], ",", + RowBox[{"{", + RowBox[{"tz", ",", + FractionBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "2"}], " ", "a0"}], "+", + RowBox[{ + SqrtBox["2"], " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}]}], + RowBox[{"2", " ", "jMax"}]], ",", "1"}], "}"}]}], "]"}], + "]"}]}]], "Input", + CellChangeTimes->{{3.817286413869176*^9, 3.817286470670142*^9}, { + 3.8172865034229107`*^9, 3.81728650469457*^9}, {3.817286541555533*^9, + 3.8172865544561443`*^9}, {3.817287057346599*^9, 3.817287105824291*^9}}, + CellLabel-> + "In[1166]:=",ExpressionUUID->"2cd0eb76-7df1-4664-970a-ff086120e648"], + +Cell[BoxData[ + InterpretationBox[ + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"7", " ", + SuperscriptBox["a0", "7"]}], "+", + RowBox[{ + SuperscriptBox["a0", "6"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"jMax", " ", "tf"}], "-", + RowBox[{"5", " ", + SqrtBox["2"], " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}]}], ")"}]}], "+", + RowBox[{"12", " ", + SuperscriptBox["a0", "5"], " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "4"}], " ", "v0"}], "+", "vf"}], ")"}]}], "+", + RowBox[{"12", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"11", " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"2", " ", + SqrtBox["2"], " ", "p0", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "-", + RowBox[{"2", " ", + SqrtBox["2"], " ", "pf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "-", + RowBox[{"9", " ", "v0", " ", "vf"}], "+", + RowBox[{"3", " ", + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", "vf"}], "+", + RowBox[{"4", " ", + SuperscriptBox["vf", "2"]}], "-", + RowBox[{"2", " ", "jMax", " ", "tf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "p0"}], "-", + RowBox[{"2", " ", "pf"}], "+", + RowBox[{"tf", " ", "vf"}]}], ")"}]}]}], ")"}]}], "-", + RowBox[{"3", " ", + SuperscriptBox["a0", "4"], " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + SqrtBox["2"], " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "10"}], " ", "v0"}], "+", + RowBox[{"3", " ", "vf"}]}], ")"}]}], "+", + RowBox[{"2", " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"5", " ", "p0"}], "-", + RowBox[{"5", " ", "pf"}], "+", + RowBox[{"tf", " ", "v0"}], "+", + RowBox[{"8", " ", "tf", " ", "vf"}]}], ")"}]}]}], ")"}]}], "-", + RowBox[{"72", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", + SuperscriptBox["v0", "3"]}], "-", + RowBox[{"3", " ", + SuperscriptBox["v0", "2"], " ", "vf"}], "-", + SuperscriptBox["vf", "3"], "+", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox["p0", "2"], "+", + SuperscriptBox["pf", "2"], "-", + RowBox[{"2", " ", "p0", " ", + RowBox[{"(", + RowBox[{"pf", "+", + RowBox[{"tf", " ", + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}]}]}], ")"}]}], "+", + RowBox[{"2", " ", "pf", " ", "tf", " ", + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}]}], "-", + RowBox[{ + SuperscriptBox["tf", "2"], " ", "v0", " ", "vf"}]}], ")"}]}], + "+", + RowBox[{"v0", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + SqrtBox["2"], " ", "p0", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "-", + RowBox[{ + SqrtBox["2"], " ", "pf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "+", + RowBox[{"vf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "+", + RowBox[{"2", " ", "vf"}]}], ")"}]}]}], ")"}]}]}], ")"}]}], "+", + RowBox[{"18", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"4", " ", + SqrtBox["2"], " ", "v0", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "v0"}], "+", "vf"}], ")"}]}], "+", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "p0", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "v0"}], "+", "vf"}], ")"}]}], "-", + RowBox[{"2", " ", "pf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "v0"}], "+", "vf"}], ")"}]}], "+", + RowBox[{"tf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"8", " ", "v0", " ", "vf"}], "+", + RowBox[{ + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", "vf"}]}], + ")"}]}]}], ")"}]}]}], ")"}]}], "-", + RowBox[{"36", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", + SqrtBox["2"]}], " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "v0"}], "+", "vf"}], ")"}]}], "+", + RowBox[{"2", " ", + SuperscriptBox["jMax", "2"], " ", + RowBox[{"(", + RowBox[{"p0", "-", "pf"}], ")"}], " ", "tf", " ", + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "vf"}]}], ")"}]}], "+", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", + SqrtBox["2"]}], " ", + SuperscriptBox["p0", "2"], " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "-", + RowBox[{ + SqrtBox["2"], " ", + SuperscriptBox["pf", "2"], " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "+", + RowBox[{"2", " ", "pf", " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox["v0", "2"], "-", + RowBox[{"3", " ", "v0", " ", "vf"}], "+", + RowBox[{"2", " ", + SuperscriptBox["vf", "2"]}]}], ")"}]}], "-", + RowBox[{"2", " ", "p0", " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox["v0", "2"], "-", + RowBox[{ + SqrtBox["2"], " ", "pf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "-", + RowBox[{"3", " ", "v0", " ", "vf"}], "+", + RowBox[{"2", " ", + SuperscriptBox["vf", "2"]}]}], ")"}]}], "+", + RowBox[{"tf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", + SuperscriptBox["v0", "3"]}], "+", + RowBox[{ + SqrtBox["2"], " ", "tf", " ", "v0", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", "vf"}], "-", + + RowBox[{"2", " ", + SuperscriptBox["vf", "3"]}]}], ")"}]}]}], ")"}]}]}], + ")"}]}]}], ")"}], "/", + RowBox[{"(", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", + SuperscriptBox["a0", "6"]}], "+", + RowBox[{"6", " ", + SuperscriptBox["a0", "4"], " ", "jMax", " ", + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}]}], "-", + RowBox[{"36", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "2"]}], "+", + RowBox[{"48", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "vf"}]}], ")"}]}], "-", + RowBox[{"144", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], " ", + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "vf"}]}], ")"}]}], "+", + RowBox[{"72", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "3"], "+", + RowBox[{"jMax", " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "vf"}]}], ")"}], "2"]}]}], ")"}]}]}], + ")"}]}], ")"}]}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{"2", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"26", " ", + SuperscriptBox["a0", "6"]}], "-", + RowBox[{"6", " ", + SuperscriptBox["a0", "5"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "2"}], " ", "jMax", " ", "tf"}], "+", + RowBox[{"3", " ", + SqrtBox["2"], " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}]}], ")"}]}], "+", + RowBox[{"3", " ", + SuperscriptBox["a0", "4"], " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"6", " ", "jMax", " ", + SuperscriptBox["tf", "2"]}], "-", + RowBox[{"48", " ", "v0"}], "-", + RowBox[{"4", " ", + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "+", + RowBox[{"27", " ", "vf"}]}], ")"}]}], "+", + RowBox[{"18", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"18", " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"3", " ", + SqrtBox["2"], " ", "p0", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "-", + RowBox[{"3", " ", + SqrtBox["2"], " ", "pf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "+", + RowBox[{"4", " ", + SqrtBox["2"], " ", "tf", " ", "v0", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "-", + RowBox[{"24", " ", "v0", " ", "vf"}], "+", + RowBox[{"3", " ", + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", "vf"}], "+", + RowBox[{"6", " ", + SuperscriptBox["vf", "2"]}], "-", + RowBox[{"jMax", " ", "tf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"4", " ", "p0"}], "-", + RowBox[{"4", " ", "pf"}], "+", + RowBox[{"4", " ", "tf", " ", "v0"}], "+", + RowBox[{"3", " ", "tf", " ", "vf"}]}], ")"}]}]}], ")"}]}], "-", + + RowBox[{"6", " ", + SuperscriptBox["a0", "3"], " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + SqrtBox["2"], " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "13"}], " ", "v0"}], "+", "vf"}], ")"}]}], "+", + RowBox[{"2", " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"8", " ", "p0"}], "-", + RowBox[{"8", " ", "pf"}], "+", + RowBox[{"tf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "v0"}], "-", + RowBox[{ + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "+", + RowBox[{"9", " ", "vf"}]}], ")"}]}]}], ")"}]}]}], ")"}]}], + "+", + RowBox[{"36", " ", "a0", " ", + SuperscriptBox["jMax", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + SqrtBox["2"], " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "3"}], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"2", " ", "v0", " ", "vf"}], "+", + SuperscriptBox["vf", "2"]}], ")"}]}], "+", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "p0", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"3", " ", "v0"}], "+", + RowBox[{ + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}]}], ")"}]}], + "-", + RowBox[{"2", " ", "pf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"3", " ", "v0"}], "+", + RowBox[{ + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}]}], ")"}]}], + "+", + RowBox[{"tf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", + SqrtBox["2"]}], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", + RowBox[{"(", + RowBox[{"v0", "-", + RowBox[{"3", " ", "vf"}]}], ")"}]}], "+", + RowBox[{"6", " ", "v0", " ", "vf"}]}], ")"}]}]}], ")"}]}]}], + ")"}]}], "-", + RowBox[{"36", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"8", " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{ + SqrtBox["2"], " ", "p0", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "-", + RowBox[{ + SqrtBox["2"], " ", "pf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "+", + RowBox[{"4", " ", + SqrtBox["2"], " ", "tf", " ", "v0", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "-", + RowBox[{"7", " ", "v0", " ", "vf"}], "+", + RowBox[{ + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", "vf"}], "-", + SuperscriptBox["vf", "2"]}], ")"}]}], "+", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox["p0", "2"], "+", + SuperscriptBox["pf", "2"], "+", + RowBox[{"pf", " ", "tf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"4", " ", "v0"}], "+", + RowBox[{ + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}]}], ")"}]}], + "-", + RowBox[{"p0", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "pf"}], "+", + RowBox[{"tf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"4", " ", "v0"}], "+", + RowBox[{ + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}]}], ")"}]}]}], + ")"}]}], "-", + RowBox[{ + SuperscriptBox["tf", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"3", " ", "v0", " ", "vf"}], "+", + RowBox[{ + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", "vf"}]}], + ")"}]}]}], ")"}]}]}], ")"}]}]}], ")"}], " ", + RowBox[{"(", + RowBox[{"tz", "-", + FractionBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "2"}], " ", "a0"}], "+", + RowBox[{ + SqrtBox["2"], " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}]}], + RowBox[{"2", " ", "jMax"}]]}], ")"}]}], ")"}], "/", + RowBox[{"(", + RowBox[{ + SuperscriptBox["a0", "6"], "+", + RowBox[{"36", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "2"]}], "+", + RowBox[{"6", " ", + SuperscriptBox["a0", "4"], " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "v0"}], "+", "vf"}], ")"}]}], "-", + RowBox[{"48", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "vf"}]}], ")"}]}], "+", + RowBox[{"144", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], " ", + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "vf"}]}], ")"}]}], "-", + RowBox[{"72", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "3"], "+", + RowBox[{"jMax", " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "vf"}]}], ")"}], "2"]}]}], ")"}]}]}], ")"}]}], + "+", + InterpretationBox[ + SuperscriptBox[ + RowBox[{"O", "[", + RowBox[{"tz", "-", + FractionBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "2"}], " ", "a0"}], "+", + RowBox[{ + SqrtBox["2"], " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}]}], + RowBox[{"2", " ", "jMax"}]]}], "]"}], "2"], + SeriesData[$CellContext`tz, + Rational[1, 2] $CellContext`jMax^(-1) ((-2) $CellContext`a0 + + 2^Rational[1, 2] ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2]), {}, 0, 2, 1], + Editable->False]}], + SeriesData[$CellContext`tz, + Rational[1, 2] $CellContext`jMax^(-1) ((-2) $CellContext`a0 + + 2^Rational[1, 2] ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2]), {$CellContext`jMax^(-1) (-$CellContext`a0^6 + + 6 $CellContext`a0^4 $CellContext`jMax ($CellContext`v0 - \ +$CellContext`vf) - + 36 $CellContext`a0^2 $CellContext`jMax^2 ($CellContext`v0 - \ +$CellContext`vf)^2 + + 48 $CellContext`a0^3 $CellContext`jMax^2 ($CellContext`p0 - \ +$CellContext`pf + $CellContext`tf $CellContext`vf) - + 144 $CellContext`a0 $CellContext`jMax^3 ($CellContext`v0 - \ +$CellContext`vf) ($CellContext`p0 - $CellContext`pf + $CellContext`tf \ +$CellContext`vf) + + 72 $CellContext`jMax^3 (($CellContext`v0 - $CellContext`vf)^3 + \ +$CellContext`jMax ($CellContext`p0 - $CellContext`pf + $CellContext`tf \ +$CellContext`vf)^2))^(-1) ( + 7 $CellContext`a0^7 + $CellContext`a0^6 ($CellContext`jMax \ +$CellContext`tf - 5 + 2^Rational[1, 2] ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2]) + + 12 $CellContext`a0^5 $CellContext`jMax ((-4) $CellContext`v0 + \ +$CellContext`vf) + + 12 $CellContext`a0^3 $CellContext`jMax^2 (11 $CellContext`v0^2 + + 2 2^Rational[1, 2] $CellContext`p0 ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] - 2 + 2^Rational[1, 2] $CellContext`pf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] - + 9 $CellContext`v0 $CellContext`vf + + 3 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] $CellContext`vf + + 4 $CellContext`vf^2 - + 2 $CellContext`jMax $CellContext`tf (2 $CellContext`p0 - + 2 $CellContext`pf + $CellContext`tf $CellContext`vf)) - + 3 $CellContext`a0^4 $CellContext`jMax ( + 2^Rational[1, 2] ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2] ((-10) $CellContext`v0 + 3 $CellContext`vf) + + 2 $CellContext`jMax (5 $CellContext`p0 - + 5 $CellContext`pf + $CellContext`tf $CellContext`v0 + + 8 $CellContext`tf $CellContext`vf)) - + 72 $CellContext`a0 $CellContext`jMax^3 (2 $CellContext`v0^3 - + 3 $CellContext`v0^2 $CellContext`vf - $CellContext`vf^3 + \ +$CellContext`jMax ($CellContext`p0^2 + $CellContext`pf^2 - + 2 $CellContext`p0 ($CellContext`pf + $CellContext`tf ($CellContext`v0 - \ +$CellContext`vf)) + + 2 $CellContext`pf $CellContext`tf ($CellContext`v0 - $CellContext`vf) - \ +$CellContext`tf^2 $CellContext`v0 $CellContext`vf) + $CellContext`v0 ( + 2^Rational[1, 2] $CellContext`p0 ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] - + 2^Rational[1, 2] $CellContext`pf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2] + $CellContext`vf ( + 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] + + 2 $CellContext`vf))) + + 18 $CellContext`a0^2 $CellContext`jMax^2 ( + 4 2^Rational[1, 2] $CellContext`v0 ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[ + 1, 2] (-$CellContext`v0 + $CellContext`vf) + $CellContext`jMax ( + 2 $CellContext`p0 (2 $CellContext`v0 + $CellContext`vf) - + 2 $CellContext`pf ( + 2 $CellContext`v0 + $CellContext`vf) + $CellContext`tf ( + 2 $CellContext`v0^2 + 8 $CellContext`v0 $CellContext`vf + + 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2] $CellContext`vf))) - + 36 $CellContext`jMax^3 (-2^ + Rational[1, 2] ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2] ($CellContext`v0 - $CellContext`vf)^2 ( + 2 $CellContext`v0 + $CellContext`vf) + + 2 $CellContext`jMax^2 ($CellContext`p0 - $CellContext`pf) \ +$CellContext`tf ($CellContext`p0 - $CellContext`pf + $CellContext`tf \ +$CellContext`vf) + $CellContext`jMax (-2^ + Rational[1, 2] $CellContext`p0^2 ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] - + 2^Rational[1, 2] $CellContext`pf^2 ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] + + 2 $CellContext`pf ($CellContext`v0^2 - + 3 $CellContext`v0 $CellContext`vf + 2 $CellContext`vf^2) - + 2 $CellContext`p0 ($CellContext`v0^2 - + 2^Rational[1, 2] $CellContext`pf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] - + 3 $CellContext`v0 $CellContext`vf + + 2 $CellContext`vf^2) + $CellContext`tf (2 $CellContext`v0^3 + + 2^Rational[1, 2] $CellContext`tf $CellContext`v0 ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2] $CellContext`vf - 2 $CellContext`vf^3)))), + 2 ($CellContext`a0^6 + + 36 $CellContext`a0^2 $CellContext`jMax^2 ($CellContext`v0 - \ +$CellContext`vf)^2 + + 6 $CellContext`a0^4 $CellContext`jMax (-$CellContext`v0 + \ +$CellContext`vf) - + 48 $CellContext`a0^3 $CellContext`jMax^2 ($CellContext`p0 - \ +$CellContext`pf + $CellContext`tf $CellContext`vf) + + 144 $CellContext`a0 $CellContext`jMax^3 ($CellContext`v0 - \ +$CellContext`vf) ($CellContext`p0 - $CellContext`pf + $CellContext`tf \ +$CellContext`vf) - + 72 $CellContext`jMax^3 (($CellContext`v0 - $CellContext`vf)^3 + \ +$CellContext`jMax ($CellContext`p0 - $CellContext`pf + $CellContext`tf \ +$CellContext`vf)^2))^(-1) (26 $CellContext`a0^6 - + 6 $CellContext`a0^5 ((-2) $CellContext`jMax $CellContext`tf + + 3 2^Rational[1, 2] ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2]) + + 3 $CellContext`a0^4 $CellContext`jMax ( + 6 $CellContext`jMax $CellContext`tf^2 - 48 $CellContext`v0 - 4 + 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] + + 27 $CellContext`vf) + + 18 $CellContext`a0^2 $CellContext`jMax^2 (18 $CellContext`v0^2 + + 3 2^Rational[1, 2] $CellContext`p0 ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] - 3 + 2^Rational[1, 2] $CellContext`pf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] + + 4 2^Rational[1, 2] $CellContext`tf $CellContext`v0 ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] - + 24 $CellContext`v0 $CellContext`vf + + 3 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] $CellContext`vf + + 6 $CellContext`vf^2 - $CellContext`jMax $CellContext`tf ( + 4 $CellContext`p0 - 4 $CellContext`pf + + 4 $CellContext`tf $CellContext`v0 + + 3 $CellContext`tf $CellContext`vf)) - + 6 $CellContext`a0^3 $CellContext`jMax ( + 2^Rational[1, 2] ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2] ((-13) $CellContext`v0 + $CellContext`vf) + + 2 $CellContext`jMax (8 $CellContext`p0 - + 8 $CellContext`pf + $CellContext`tf (2 $CellContext`v0 - + 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] + + 9 $CellContext`vf))) + + 36 $CellContext`a0 $CellContext`jMax^2 ( + 2^Rational[1, 2] ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2] ((-3) $CellContext`v0^2 + + 2 $CellContext`v0 $CellContext`vf + $CellContext`vf^2) + \ +$CellContext`jMax ( + 2 $CellContext`p0 (3 $CellContext`v0 + + 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2]) - + 2 $CellContext`pf (3 $CellContext`v0 + + 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2]) + $CellContext`tf (-2^ + Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2] ($CellContext`v0 - 3 $CellContext`vf) + + 6 $CellContext`v0 $CellContext`vf))) - + 36 $CellContext`jMax^3 (($CellContext`v0 - $CellContext`vf) ( + 8 $CellContext`v0^2 + + 2^Rational[1, 2] $CellContext`p0 ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] - + 2^Rational[1, 2] $CellContext`pf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] + + 4 2^Rational[1, 2] $CellContext`tf $CellContext`v0 ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] - + 7 $CellContext`v0 $CellContext`vf + + 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[ + 1, 2] $CellContext`vf - $CellContext`vf^2) + $CellContext`jMax \ +($CellContext`p0^2 + $CellContext`pf^2 + $CellContext`pf $CellContext`tf ( + 4 $CellContext`v0 + + 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2]) - $CellContext`p0 ( + 2 $CellContext`pf + $CellContext`tf (4 $CellContext`v0 + + 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2])) - $CellContext`tf^2 (2 $CellContext`v0^2 + + 3 $CellContext`v0 $CellContext`vf + + 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2] $CellContext`vf))))}, 0, 2, 1], + Editable->False]], "Output", + CellChangeTimes->{{3.817287072405363*^9, 3.8172871131435947`*^9}}, + CellLabel-> + "Out[1166]=",ExpressionUUID->"42f43c8d-3e50-48eb-bc53-4f756722bfea"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{"ToString", "[", + RowBox[{"qwer", ",", "CForm"}], "]"}]], "Input", + CellChangeTimes->{{3.817287166702866*^9, 3.817287190085927*^9}, { + 3.817287236704919*^9, 3.8172872374775457`*^9}}, + CellLabel-> + "In[1172]:=",ExpressionUUID->"05e2a80e-52d7-418e-a037-d9b9f1bb531c"], + +Cell[BoxData["\<\"SeriesData(tz,(-2*a0 + Sqrt(2)*Sqrt(Power(a0,2) - \ +2*jMax*v0))/(2.*jMax),List((7*Power(a0,7) + Power(a0,6)*(jMax*tf - \ +5*Sqrt(2)*Sqrt(Power(a0,2) - 2*jMax*v0)) + 12*Power(a0,5)*jMax*(-4*v0 + vf) + \ +12*Power(a0,3)*Power(jMax,2)*(11*Power(v0,2) + 2*Sqrt(2)*p0*Sqrt(Power(a0,2) \ +- 2*jMax*v0) - 2*Sqrt(2)*pf*Sqrt(Power(a0,2) - 2*jMax*v0) - 9*v0*vf + \ +3*Sqrt(2)*tf*Sqrt(Power(a0,2) - 2*jMax*v0)*vf + 4*Power(vf,2) - \ +2*jMax*tf*(2*p0 - 2*pf + tf*vf)) - \ +3*Power(a0,4)*jMax*(Sqrt(2)*Sqrt(Power(a0,2) - 2*jMax*v0)*(-10*v0 + 3*vf) + \ +2*jMax*(5*p0 - 5*pf + tf*v0 + 8*tf*vf)) - 72*a0*Power(jMax,3)*(2*Power(v0,3) \ +- 3*Power(v0,2)*vf - Power(vf,3) + jMax*(Power(p0,2) + Power(pf,2) - 2*p0*(pf \ ++ tf*(v0 - vf)) + 2*pf*tf*(v0 - vf) - Power(tf,2)*v0*vf) + \ +v0*(Sqrt(2)*p0*Sqrt(Power(a0,2) - 2*jMax*v0) - Sqrt(2)*pf*Sqrt(Power(a0,2) - \ +2*jMax*v0) + vf*(Sqrt(2)*tf*Sqrt(Power(a0,2) - 2*jMax*v0) + 2*vf))) + \ +18*Power(a0,2)*Power(jMax,2)*(4*Sqrt(2)*v0*Sqrt(Power(a0,2) - 2*jMax*v0)*(-v0 \ ++ vf) + jMax*(2*p0*(2*v0 + vf) - 2*pf*(2*v0 + vf) + tf*(2*Power(v0,2) + \ +8*v0*vf + Sqrt(2)*tf*Sqrt(Power(a0,2) - 2*jMax*v0)*vf))) - \ +36*Power(jMax,3)*(-(Sqrt(2)*Sqrt(Power(a0,2) - 2*jMax*v0)*Power(v0 - \ +vf,2)*(2*v0 + vf)) + 2*Power(jMax,2)*(p0 - pf)*tf*(p0 - pf + tf*vf) + \ +jMax*(-(Sqrt(2)*Power(p0,2)*Sqrt(Power(a0,2) - 2*jMax*v0)) - \ +Sqrt(2)*Power(pf,2)*Sqrt(Power(a0,2) - 2*jMax*v0) + 2*pf*(Power(v0,2) - \ +3*v0*vf + 2*Power(vf,2)) - 2*p0*(Power(v0,2) - Sqrt(2)*pf*Sqrt(Power(a0,2) - \ +2*jMax*v0) - 3*v0*vf + 2*Power(vf,2)) + tf*(2*Power(v0,3) + \ +Sqrt(2)*tf*v0*Sqrt(Power(a0,2) - 2*jMax*v0)*vf - \ +2*Power(vf,3)))))/(jMax*(-Power(a0,6) + 6*Power(a0,4)*jMax*(v0 - vf) - \ +36*Power(a0,2)*Power(jMax,2)*Power(v0 - vf,2) + \ +48*Power(a0,3)*Power(jMax,2)*(p0 - pf + tf*vf) - 144*a0*Power(jMax,3)*(v0 - \ +vf)*(p0 - pf + tf*vf) + 72*Power(jMax,3)*(Power(v0 - vf,3) + jMax*Power(p0 - \ +pf + tf*vf,2)))),(2*(26*Power(a0,6) - 6*Power(a0,5)*(-2*jMax*tf + \ +3*Sqrt(2)*Sqrt(Power(a0,2) - 2*jMax*v0)) + \ +3*Power(a0,4)*jMax*(6*jMax*Power(tf,2) - 48*v0 - \ +4*Sqrt(2)*tf*Sqrt(Power(a0,2) - 2*jMax*v0) + 27*vf) + \ +18*Power(a0,2)*Power(jMax,2)*(18*Power(v0,2) + 3*Sqrt(2)*p0*Sqrt(Power(a0,2) \ +- 2*jMax*v0) - 3*Sqrt(2)*pf*Sqrt(Power(a0,2) - 2*jMax*v0) + \ +4*Sqrt(2)*tf*v0*Sqrt(Power(a0,2) - 2*jMax*v0) - 24*v0*vf + \ +3*Sqrt(2)*tf*Sqrt(Power(a0,2) - 2*jMax*v0)*vf + 6*Power(vf,2) - jMax*tf*(4*p0 \ +- 4*pf + 4*tf*v0 + 3*tf*vf)) - 6*Power(a0,3)*jMax*(Sqrt(2)*Sqrt(Power(a0,2) - \ +2*jMax*v0)*(-13*v0 + vf) + 2*jMax*(8*p0 - 8*pf + tf*(2*v0 - \ +Sqrt(2)*tf*Sqrt(Power(a0,2) - 2*jMax*v0) + 9*vf))) + \ +36*a0*Power(jMax,2)*(Sqrt(2)*Sqrt(Power(a0,2) - 2*jMax*v0)*(-3*Power(v0,2) + \ +2*v0*vf + Power(vf,2)) + jMax*(2*p0*(3*v0 + Sqrt(2)*tf*Sqrt(Power(a0,2) - \ +2*jMax*v0)) - 2*pf*(3*v0 + Sqrt(2)*tf*Sqrt(Power(a0,2) - 2*jMax*v0)) + \ +tf*(-(Sqrt(2)*tf*Sqrt(Power(a0,2) - 2*jMax*v0)*(v0 - 3*vf)) + 6*v0*vf))) - \ +36*Power(jMax,3)*((v0 - vf)*(8*Power(v0,2) + Sqrt(2)*p0*Sqrt(Power(a0,2) - \ +2*jMax*v0) - Sqrt(2)*pf*Sqrt(Power(a0,2) - 2*jMax*v0) + \ +4*Sqrt(2)*tf*v0*Sqrt(Power(a0,2) - 2*jMax*v0) - 7*v0*vf + \ +Sqrt(2)*tf*Sqrt(Power(a0,2) - 2*jMax*v0)*vf - Power(vf,2)) + \ +jMax*(Power(p0,2) + Power(pf,2) + pf*tf*(4*v0 + Sqrt(2)*tf*Sqrt(Power(a0,2) - \ +2*jMax*v0)) - p0*(2*pf + tf*(4*v0 + Sqrt(2)*tf*Sqrt(Power(a0,2) - \ +2*jMax*v0))) - Power(tf,2)*(2*Power(v0,2) + 3*v0*vf + \ +Sqrt(2)*tf*Sqrt(Power(a0,2) - 2*jMax*v0)*vf)))))/(Power(a0,6) + \ +36*Power(a0,2)*Power(jMax,2)*Power(v0 - vf,2) + 6*Power(a0,4)*jMax*(-v0 + vf) \ +- 48*Power(a0,3)*Power(jMax,2)*(p0 - pf + tf*vf) + 144*a0*Power(jMax,3)*(v0 - \ +vf)*(p0 - pf + tf*vf) - 72*Power(jMax,3)*(Power(v0 - vf,3) + jMax*Power(p0 - \ +pf + tf*vf,2)))),0,2,1)\"\>"], "Output", + CellChangeTimes->{{3.8172871729399223`*^9, 3.8172871904868917`*^9}, + 3.8172872378522587`*^9}, + CellLabel-> + "Out[1172]=",ExpressionUUID->"3632a081-b586-4363-9583-6c7129578d0e"] +}, Open ]], + +Cell[BoxData["qwer"], "Input", + CellChangeTimes->{{3.8172871931195097`*^9, 3.817287193370543*^9}}, + CellLabel-> + "In[1171]:=",ExpressionUUID->"d6432a14-ddff-46ef-8f9b-62f0f6200cd0"], + +Cell[BoxData[ + InterpretationBox[ + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"7", " ", + SuperscriptBox["a0", "7"]}], "+", + RowBox[{ + SuperscriptBox["a0", "6"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"jMax", " ", "tf"}], "-", + RowBox[{"5", " ", + SqrtBox["2"], " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}]}], ")"}]}], "+", + RowBox[{"12", " ", + SuperscriptBox["a0", "5"], " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "4"}], " ", "v0"}], "+", "vf"}], ")"}]}], "+", + RowBox[{"12", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"11", " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"2", " ", + SqrtBox["2"], " ", "p0", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "-", + RowBox[{"2", " ", + SqrtBox["2"], " ", "pf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "-", + RowBox[{"9", " ", "v0", " ", "vf"}], "+", + RowBox[{"3", " ", + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", "vf"}], "+", + RowBox[{"4", " ", + SuperscriptBox["vf", "2"]}], "-", + RowBox[{"2", " ", "jMax", " ", "tf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "p0"}], "-", + RowBox[{"2", " ", "pf"}], "+", + RowBox[{"tf", " ", "vf"}]}], ")"}]}]}], ")"}]}], "-", + RowBox[{"3", " ", + SuperscriptBox["a0", "4"], " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + SqrtBox["2"], " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "10"}], " ", "v0"}], "+", + RowBox[{"3", " ", "vf"}]}], ")"}]}], "+", + RowBox[{"2", " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"5", " ", "p0"}], "-", + RowBox[{"5", " ", "pf"}], "+", + RowBox[{"tf", " ", "v0"}], "+", + RowBox[{"8", " ", "tf", " ", "vf"}]}], ")"}]}]}], ")"}]}], "-", + RowBox[{"72", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", + SuperscriptBox["v0", "3"]}], "-", + RowBox[{"3", " ", + SuperscriptBox["v0", "2"], " ", "vf"}], "-", + SuperscriptBox["vf", "3"], "+", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox["p0", "2"], "+", + SuperscriptBox["pf", "2"], "-", + RowBox[{"2", " ", "p0", " ", + RowBox[{"(", + RowBox[{"pf", "+", + RowBox[{"tf", " ", + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}]}]}], ")"}]}], "+", + RowBox[{"2", " ", "pf", " ", "tf", " ", + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}]}], "-", + RowBox[{ + SuperscriptBox["tf", "2"], " ", "v0", " ", "vf"}]}], ")"}]}], + "+", + RowBox[{"v0", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + SqrtBox["2"], " ", "p0", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "-", + RowBox[{ + SqrtBox["2"], " ", "pf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "+", + RowBox[{"vf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "+", + RowBox[{"2", " ", "vf"}]}], ")"}]}]}], ")"}]}]}], ")"}]}], "+", + RowBox[{"18", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"4", " ", + SqrtBox["2"], " ", "v0", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "v0"}], "+", "vf"}], ")"}]}], "+", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "p0", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "v0"}], "+", "vf"}], ")"}]}], "-", + RowBox[{"2", " ", "pf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "v0"}], "+", "vf"}], ")"}]}], "+", + RowBox[{"tf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"8", " ", "v0", " ", "vf"}], "+", + RowBox[{ + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", "vf"}]}], + ")"}]}]}], ")"}]}]}], ")"}]}], "-", + RowBox[{"36", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", + SqrtBox["2"]}], " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "v0"}], "+", "vf"}], ")"}]}], "+", + RowBox[{"2", " ", + SuperscriptBox["jMax", "2"], " ", + RowBox[{"(", + RowBox[{"p0", "-", "pf"}], ")"}], " ", "tf", " ", + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "vf"}]}], ")"}]}], "+", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", + SqrtBox["2"]}], " ", + SuperscriptBox["p0", "2"], " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "-", + RowBox[{ + SqrtBox["2"], " ", + SuperscriptBox["pf", "2"], " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "+", + RowBox[{"2", " ", "pf", " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox["v0", "2"], "-", + RowBox[{"3", " ", "v0", " ", "vf"}], "+", + RowBox[{"2", " ", + SuperscriptBox["vf", "2"]}]}], ")"}]}], "-", + RowBox[{"2", " ", "p0", " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox["v0", "2"], "-", + RowBox[{ + SqrtBox["2"], " ", "pf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "-", + RowBox[{"3", " ", "v0", " ", "vf"}], "+", + RowBox[{"2", " ", + SuperscriptBox["vf", "2"]}]}], ")"}]}], "+", + RowBox[{"tf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", + SuperscriptBox["v0", "3"]}], "+", + RowBox[{ + SqrtBox["2"], " ", "tf", " ", "v0", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", "vf"}], "-", + + RowBox[{"2", " ", + SuperscriptBox["vf", "3"]}]}], ")"}]}]}], ")"}]}]}], + ")"}]}]}], ")"}], "/", + RowBox[{"(", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", + SuperscriptBox["a0", "6"]}], "+", + RowBox[{"6", " ", + SuperscriptBox["a0", "4"], " ", "jMax", " ", + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}]}], "-", + RowBox[{"36", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "2"]}], "+", + RowBox[{"48", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "vf"}]}], ")"}]}], "-", + RowBox[{"144", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], " ", + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "vf"}]}], ")"}]}], "+", + RowBox[{"72", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "3"], "+", + RowBox[{"jMax", " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "vf"}]}], ")"}], "2"]}]}], ")"}]}]}], + ")"}]}], ")"}]}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{"2", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"26", " ", + SuperscriptBox["a0", "6"]}], "-", + RowBox[{"6", " ", + SuperscriptBox["a0", "5"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "2"}], " ", "jMax", " ", "tf"}], "+", + RowBox[{"3", " ", + SqrtBox["2"], " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}]}], ")"}]}], "+", + RowBox[{"3", " ", + SuperscriptBox["a0", "4"], " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"6", " ", "jMax", " ", + SuperscriptBox["tf", "2"]}], "-", + RowBox[{"48", " ", "v0"}], "-", + RowBox[{"4", " ", + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "+", + RowBox[{"27", " ", "vf"}]}], ")"}]}], "+", + RowBox[{"18", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"18", " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"3", " ", + SqrtBox["2"], " ", "p0", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "-", + RowBox[{"3", " ", + SqrtBox["2"], " ", "pf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "+", + RowBox[{"4", " ", + SqrtBox["2"], " ", "tf", " ", "v0", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "-", + RowBox[{"24", " ", "v0", " ", "vf"}], "+", + RowBox[{"3", " ", + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", "vf"}], "+", + RowBox[{"6", " ", + SuperscriptBox["vf", "2"]}], "-", + RowBox[{"jMax", " ", "tf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"4", " ", "p0"}], "-", + RowBox[{"4", " ", "pf"}], "+", + RowBox[{"4", " ", "tf", " ", "v0"}], "+", + RowBox[{"3", " ", "tf", " ", "vf"}]}], ")"}]}]}], ")"}]}], "-", + + RowBox[{"6", " ", + SuperscriptBox["a0", "3"], " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + SqrtBox["2"], " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "13"}], " ", "v0"}], "+", "vf"}], ")"}]}], "+", + RowBox[{"2", " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"8", " ", "p0"}], "-", + RowBox[{"8", " ", "pf"}], "+", + RowBox[{"tf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "v0"}], "-", + RowBox[{ + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "+", + RowBox[{"9", " ", "vf"}]}], ")"}]}]}], ")"}]}]}], ")"}]}], + "+", + RowBox[{"36", " ", "a0", " ", + SuperscriptBox["jMax", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + SqrtBox["2"], " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "3"}], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"2", " ", "v0", " ", "vf"}], "+", + SuperscriptBox["vf", "2"]}], ")"}]}], "+", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "p0", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"3", " ", "v0"}], "+", + RowBox[{ + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}]}], ")"}]}], + "-", + RowBox[{"2", " ", "pf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"3", " ", "v0"}], "+", + RowBox[{ + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}]}], ")"}]}], + "+", + RowBox[{"tf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", + SqrtBox["2"]}], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", + RowBox[{"(", + RowBox[{"v0", "-", + RowBox[{"3", " ", "vf"}]}], ")"}]}], "+", + RowBox[{"6", " ", "v0", " ", "vf"}]}], ")"}]}]}], ")"}]}]}], + ")"}]}], "-", + RowBox[{"36", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"8", " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{ + SqrtBox["2"], " ", "p0", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "-", + RowBox[{ + SqrtBox["2"], " ", "pf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "+", + RowBox[{"4", " ", + SqrtBox["2"], " ", "tf", " ", "v0", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}], "-", + RowBox[{"7", " ", "v0", " ", "vf"}], "+", + RowBox[{ + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", "vf"}], "-", + SuperscriptBox["vf", "2"]}], ")"}]}], "+", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox["p0", "2"], "+", + SuperscriptBox["pf", "2"], "+", + RowBox[{"pf", " ", "tf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"4", " ", "v0"}], "+", + RowBox[{ + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}]}], ")"}]}], + "-", + RowBox[{"p0", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "pf"}], "+", + RowBox[{"tf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"4", " ", "v0"}], "+", + RowBox[{ + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}]}], ")"}]}]}], + ")"}]}], "-", + RowBox[{ + SuperscriptBox["tf", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"3", " ", "v0", " ", "vf"}], "+", + RowBox[{ + SqrtBox["2"], " ", "tf", " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]], " ", "vf"}]}], + ")"}]}]}], ")"}]}]}], ")"}]}]}], ")"}], " ", + RowBox[{"(", + RowBox[{"tz", "-", + FractionBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "2"}], " ", "a0"}], "+", + RowBox[{ + SqrtBox["2"], " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}]}], + RowBox[{"2", " ", "jMax"}]]}], ")"}]}], ")"}], "/", + RowBox[{"(", + RowBox[{ + SuperscriptBox["a0", "6"], "+", + RowBox[{"36", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "2"]}], "+", + RowBox[{"6", " ", + SuperscriptBox["a0", "4"], " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "v0"}], "+", "vf"}], ")"}]}], "-", + RowBox[{"48", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "vf"}]}], ")"}]}], "+", + RowBox[{"144", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], " ", + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "vf"}]}], ")"}]}], "-", + RowBox[{"72", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "3"], "+", + RowBox[{"jMax", " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "vf"}]}], ")"}], "2"]}]}], ")"}]}]}], ")"}]}], + "+", + InterpretationBox[ + SuperscriptBox[ + RowBox[{"O", "[", + RowBox[{"tz", "-", + FractionBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "2"}], " ", "a0"}], "+", + RowBox[{ + SqrtBox["2"], " ", + SqrtBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "-", + RowBox[{"2", " ", "jMax", " ", "v0"}]}]]}]}], + RowBox[{"2", " ", "jMax"}]]}], "]"}], "2"], + SeriesData[$CellContext`tz, + Rational[1, 2] $CellContext`jMax^(-1) ((-2) $CellContext`a0 + + 2^Rational[1, 2] ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2]), {}, 0, 2, 1], + Editable->False]}], + SeriesData[$CellContext`tz, + Rational[1, 2] $CellContext`jMax^(-1) ((-2) $CellContext`a0 + + 2^Rational[1, 2] ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2]), {$CellContext`jMax^(-1) (-$CellContext`a0^6 + + 6 $CellContext`a0^4 $CellContext`jMax ($CellContext`v0 - \ +$CellContext`vf) - + 36 $CellContext`a0^2 $CellContext`jMax^2 ($CellContext`v0 - \ +$CellContext`vf)^2 + + 48 $CellContext`a0^3 $CellContext`jMax^2 ($CellContext`p0 - \ +$CellContext`pf + $CellContext`tf $CellContext`vf) - + 144 $CellContext`a0 $CellContext`jMax^3 ($CellContext`v0 - \ +$CellContext`vf) ($CellContext`p0 - $CellContext`pf + $CellContext`tf \ +$CellContext`vf) + + 72 $CellContext`jMax^3 (($CellContext`v0 - $CellContext`vf)^3 + \ +$CellContext`jMax ($CellContext`p0 - $CellContext`pf + $CellContext`tf \ +$CellContext`vf)^2))^(-1) ( + 7 $CellContext`a0^7 + $CellContext`a0^6 ($CellContext`jMax \ +$CellContext`tf - 5 + 2^Rational[1, 2] ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2]) + + 12 $CellContext`a0^5 $CellContext`jMax ((-4) $CellContext`v0 + \ +$CellContext`vf) + + 12 $CellContext`a0^3 $CellContext`jMax^2 (11 $CellContext`v0^2 + + 2 2^Rational[1, 2] $CellContext`p0 ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] - 2 + 2^Rational[1, 2] $CellContext`pf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] - + 9 $CellContext`v0 $CellContext`vf + + 3 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] $CellContext`vf + + 4 $CellContext`vf^2 - + 2 $CellContext`jMax $CellContext`tf (2 $CellContext`p0 - + 2 $CellContext`pf + $CellContext`tf $CellContext`vf)) - + 3 $CellContext`a0^4 $CellContext`jMax ( + 2^Rational[1, 2] ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2] ((-10) $CellContext`v0 + 3 $CellContext`vf) + + 2 $CellContext`jMax (5 $CellContext`p0 - + 5 $CellContext`pf + $CellContext`tf $CellContext`v0 + + 8 $CellContext`tf $CellContext`vf)) - + 72 $CellContext`a0 $CellContext`jMax^3 (2 $CellContext`v0^3 - + 3 $CellContext`v0^2 $CellContext`vf - $CellContext`vf^3 + \ +$CellContext`jMax ($CellContext`p0^2 + $CellContext`pf^2 - + 2 $CellContext`p0 ($CellContext`pf + $CellContext`tf ($CellContext`v0 - \ +$CellContext`vf)) + + 2 $CellContext`pf $CellContext`tf ($CellContext`v0 - $CellContext`vf) - \ +$CellContext`tf^2 $CellContext`v0 $CellContext`vf) + $CellContext`v0 ( + 2^Rational[1, 2] $CellContext`p0 ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] - + 2^Rational[1, 2] $CellContext`pf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2] + $CellContext`vf ( + 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] + + 2 $CellContext`vf))) + + 18 $CellContext`a0^2 $CellContext`jMax^2 ( + 4 2^Rational[1, 2] $CellContext`v0 ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[ + 1, 2] (-$CellContext`v0 + $CellContext`vf) + $CellContext`jMax ( + 2 $CellContext`p0 (2 $CellContext`v0 + $CellContext`vf) - + 2 $CellContext`pf ( + 2 $CellContext`v0 + $CellContext`vf) + $CellContext`tf ( + 2 $CellContext`v0^2 + 8 $CellContext`v0 $CellContext`vf + + 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2] $CellContext`vf))) - + 36 $CellContext`jMax^3 (-2^ + Rational[1, 2] ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2] ($CellContext`v0 - $CellContext`vf)^2 ( + 2 $CellContext`v0 + $CellContext`vf) + + 2 $CellContext`jMax^2 ($CellContext`p0 - $CellContext`pf) \ +$CellContext`tf ($CellContext`p0 - $CellContext`pf + $CellContext`tf \ +$CellContext`vf) + $CellContext`jMax (-2^ + Rational[1, 2] $CellContext`p0^2 ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] - + 2^Rational[1, 2] $CellContext`pf^2 ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] + + 2 $CellContext`pf ($CellContext`v0^2 - + 3 $CellContext`v0 $CellContext`vf + 2 $CellContext`vf^2) - + 2 $CellContext`p0 ($CellContext`v0^2 - + 2^Rational[1, 2] $CellContext`pf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] - + 3 $CellContext`v0 $CellContext`vf + + 2 $CellContext`vf^2) + $CellContext`tf (2 $CellContext`v0^3 + + 2^Rational[1, 2] $CellContext`tf $CellContext`v0 ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2] $CellContext`vf - 2 $CellContext`vf^3)))), + 2 ($CellContext`a0^6 + + 36 $CellContext`a0^2 $CellContext`jMax^2 ($CellContext`v0 - \ +$CellContext`vf)^2 + + 6 $CellContext`a0^4 $CellContext`jMax (-$CellContext`v0 + \ +$CellContext`vf) - + 48 $CellContext`a0^3 $CellContext`jMax^2 ($CellContext`p0 - \ +$CellContext`pf + $CellContext`tf $CellContext`vf) + + 144 $CellContext`a0 $CellContext`jMax^3 ($CellContext`v0 - \ +$CellContext`vf) ($CellContext`p0 - $CellContext`pf + $CellContext`tf \ +$CellContext`vf) - + 72 $CellContext`jMax^3 (($CellContext`v0 - $CellContext`vf)^3 + \ +$CellContext`jMax ($CellContext`p0 - $CellContext`pf + $CellContext`tf \ +$CellContext`vf)^2))^(-1) (26 $CellContext`a0^6 - + 6 $CellContext`a0^5 ((-2) $CellContext`jMax $CellContext`tf + + 3 2^Rational[1, 2] ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2]) + + 3 $CellContext`a0^4 $CellContext`jMax ( + 6 $CellContext`jMax $CellContext`tf^2 - 48 $CellContext`v0 - 4 + 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] + + 27 $CellContext`vf) + + 18 $CellContext`a0^2 $CellContext`jMax^2 (18 $CellContext`v0^2 + + 3 2^Rational[1, 2] $CellContext`p0 ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] - 3 + 2^Rational[1, 2] $CellContext`pf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] + + 4 2^Rational[1, 2] $CellContext`tf $CellContext`v0 ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] - + 24 $CellContext`v0 $CellContext`vf + + 3 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] $CellContext`vf + + 6 $CellContext`vf^2 - $CellContext`jMax $CellContext`tf ( + 4 $CellContext`p0 - 4 $CellContext`pf + + 4 $CellContext`tf $CellContext`v0 + + 3 $CellContext`tf $CellContext`vf)) - + 6 $CellContext`a0^3 $CellContext`jMax ( + 2^Rational[1, 2] ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2] ((-13) $CellContext`v0 + $CellContext`vf) + + 2 $CellContext`jMax (8 $CellContext`p0 - + 8 $CellContext`pf + $CellContext`tf (2 $CellContext`v0 - + 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] + + 9 $CellContext`vf))) + + 36 $CellContext`a0 $CellContext`jMax^2 ( + 2^Rational[1, 2] ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2] ((-3) $CellContext`v0^2 + + 2 $CellContext`v0 $CellContext`vf + $CellContext`vf^2) + \ +$CellContext`jMax ( + 2 $CellContext`p0 (3 $CellContext`v0 + + 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2]) - + 2 $CellContext`pf (3 $CellContext`v0 + + 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2]) + $CellContext`tf (-2^ + Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2] ($CellContext`v0 - 3 $CellContext`vf) + + 6 $CellContext`v0 $CellContext`vf))) - + 36 $CellContext`jMax^3 (($CellContext`v0 - $CellContext`vf) ( + 8 $CellContext`v0^2 + + 2^Rational[1, 2] $CellContext`p0 ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] - + 2^Rational[1, 2] $CellContext`pf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] + + 4 2^Rational[1, 2] $CellContext`tf $CellContext`v0 ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^Rational[1, 2] - + 7 $CellContext`v0 $CellContext`vf + + 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[ + 1, 2] $CellContext`vf - $CellContext`vf^2) + $CellContext`jMax \ +($CellContext`p0^2 + $CellContext`pf^2 + $CellContext`pf $CellContext`tf ( + 4 $CellContext`v0 + + 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2]) - $CellContext`p0 ( + 2 $CellContext`pf + $CellContext`tf (4 $CellContext`v0 + + 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2])) - $CellContext`tf^2 (2 $CellContext`v0^2 + + 3 $CellContext`v0 $CellContext`vf + + 2^Rational[1, 2] $CellContext`tf ($CellContext`a0^2 - + 2 $CellContext`jMax $CellContext`v0)^ + Rational[1, 2] $CellContext`vf))))}, 0, 2, 1], + Editable->False]], "Input", + CellChangeTimes->{{3.8172872108110723`*^9, + 3.817287220379974*^9}},ExpressionUUID->"466c0d61-adb3-4dc1-952d-\ +241af8bf9d33"], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{ + RowBox[{ + RowBox[{"qwer", "/.", "tmpData"}], "/.", + RowBox[{"{", + RowBox[{"tza", "\[Rule]", "0.4395"}], "}"}]}], "//", "N"}]], "Input", + CellChangeTimes->{{3.817286556365621*^9, 3.8172866245298433`*^9}}, + CellLabel-> + "In[1143]:=",ExpressionUUID->"0215e8fc-7402-4781-b0e4-16b977a2d5d3"], + +Cell[BoxData[ + InterpretationBox[ + RowBox[{ + RowBox[{"-", "10230.043666530042`"}], "-", + RowBox[{"35085.27465437432`", " ", + RowBox[{"(", + RowBox[{"tz", "-", "0.10879304846938777`"}], ")"}]}], "+", + RowBox[{"95781.75930983484`", " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"tz", "-", "0.10879304846938777`"}], ")"}], "2"]}], "+", + InterpretationBox[ + SuperscriptBox[ + RowBox[{"O", "[", + RowBox[{"tz", "-", "0.10879304846938777`"}], "]"}], "3"], + SeriesData[$CellContext`tz, 0.10879304846938777`, {}, 0, 3, 1], + Editable->False]}], + SeriesData[$CellContext`tz, + 0.10879304846938777`, {-10230.043666530042`, -35085.27465437432, + 95781.75930983484}, 0, 3, 1], + Editable->False]], "Output", + CellChangeTimes->{{3.817286558328019*^9, 3.817286624890675*^9}}, + CellLabel-> + "Out[1143]=",ExpressionUUID->"e95a6718-f2eb-44e6-90df-b7ac8c4207c7"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{"Simplify", "[", + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"8", ",", "2", ",", "7"}], "]"}], "]"}], "//.", + RowBox[{"{", + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"8", ",", "2", ",", "1", ",", "2"}], "]"}], "]"}], "\[Rule]", + "tz"}], "}"}]}], "]"}]], "Input", + CellChangeTimes->{{3.8172813041660423`*^9, 3.8172813165294933`*^9}, { + 3.817281389231889*^9, 3.8172814113955183`*^9}, {3.817281479911911*^9, + 3.817281488945387*^9}, {3.817281528240498*^9, 3.8172815617029333`*^9}, { + 3.817289034263383*^9, 3.817289034334139*^9}}, + CellLabel-> + "In[1176]:=",ExpressionUUID->"5464c1ac-5775-49e3-95bc-2e3e0252d6c0"], + +Cell[BoxData[ + RowBox[{"t7", "\[Rule]", + RowBox[{"-", + RowBox[{"(", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "12"}], " ", + SuperscriptBox["a0", "7"]}], "-", + RowBox[{ + SuperscriptBox["a0", "6"], " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"19", " ", "tf"}], "+", + RowBox[{"101", " ", "tz"}]}], ")"}]}], "+", + RowBox[{"6", " ", + SuperscriptBox["a0", "5"], " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"5", " ", + SuperscriptBox["tf", "2"]}], "-", + RowBox[{"22", " ", "tf", " ", "tz"}], "-", + RowBox[{"45", " ", + SuperscriptBox["tz", "2"]}]}], ")"}]}], "-", + RowBox[{"6", " ", "v0"}], "+", + RowBox[{"6", " ", "vf"}]}], ")"}]}], "+", + RowBox[{"6", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "6"}], " ", "p0"}], "+", + RowBox[{"6", " ", "pf"}], "+", + RowBox[{"23", " ", "jMax", " ", + SuperscriptBox["tf", "2"], " ", "tz"}], "-", + RowBox[{"52", " ", "jMax", " ", "tf", " ", + SuperscriptBox["tz", "2"]}], "-", + RowBox[{"41", " ", "jMax", " ", + SuperscriptBox["tz", "3"]}], "+", + RowBox[{"7", " ", "tf", " ", "v0"}], "-", + RowBox[{"11", " ", "tz", " ", "v0"}], "-", + RowBox[{"13", " ", "tf", " ", "vf"}], "+", + RowBox[{"11", " ", "tz", " ", "vf"}]}], ")"}]}], "+", + RowBox[{"12", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox["tz", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"11", " ", + SuperscriptBox["tf", "2"]}], "-", + RowBox[{"22", " ", "tf", " ", "tz"}], "-", + RowBox[{"6", " ", + SuperscriptBox["tz", "2"]}]}], ")"}]}], "+", + RowBox[{"8", " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "2"]}], "+", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "4"}], " ", "pf", " ", "tf"}], "+", + RowBox[{"4", " ", "p0", " ", + RowBox[{"(", + RowBox[{"tf", "-", + RowBox[{"4", " ", "tz"}]}], ")"}]}], "+", + RowBox[{"16", " ", "pf", " ", "tz"}], "-", + RowBox[{ + SuperscriptBox["tf", "2"], " ", "v0"}], "+", + RowBox[{"26", " ", "tf", " ", "tz", " ", "v0"}], "+", + RowBox[{"25", " ", + SuperscriptBox["tz", "2"], " ", "v0"}], "+", + RowBox[{"5", " ", + SuperscriptBox["tf", "2"], " ", "vf"}], "-", + RowBox[{"42", " ", "tf", " ", "tz", " ", "vf"}], "-", + RowBox[{"25", " ", + SuperscriptBox["tz", "2"], " ", "vf"}]}], ")"}]}]}], ")"}]}], + "+", + RowBox[{"36", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + SuperscriptBox["jMax", "2"], " ", "tf", " ", + RowBox[{"(", + RowBox[{"tf", "-", + RowBox[{"2", " ", "tz"}]}], ")"}], " ", + SuperscriptBox["tz", "3"]}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{"tf", "+", + RowBox[{"19", " ", "tz"}]}], ")"}], " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "2"]}], "+", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "pf"}], " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"2", " ", "pf", " ", "tf", " ", "tz"}], "+", + RowBox[{"9", " ", "pf", " ", + SuperscriptBox["tz", "2"]}], "+", + RowBox[{"p0", " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox["tf", "2"], "-", + RowBox[{"2", " ", "tf", " ", "tz"}], "-", + RowBox[{"9", " ", + SuperscriptBox["tz", "2"]}]}], ")"}]}], "-", + RowBox[{"8", " ", + SuperscriptBox["tf", "2"], " ", "tz", " ", "v0"}], "+", + RowBox[{"20", " ", "tf", " ", + SuperscriptBox["tz", "2"], " ", "v0"}], "+", + RowBox[{"12", " ", + SuperscriptBox["tz", "3"], " ", "v0"}], "+", + RowBox[{ + SuperscriptBox["tf", "3"], " ", "vf"}], "+", + RowBox[{"6", " ", + SuperscriptBox["tf", "2"], " ", "tz", " ", "vf"}], "-", + RowBox[{"29", " ", "tf", " ", + SuperscriptBox["tz", "2"], " ", "vf"}], "-", + RowBox[{"12", " ", + SuperscriptBox["tz", "3"], " ", "vf"}]}], ")"}]}]}], ")"}]}], + "+", + RowBox[{"144", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "3"], "-", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"p0", " ", + RowBox[{"(", + RowBox[{"tf", "+", "tz"}], ")"}]}], "-", + RowBox[{"pf", " ", + RowBox[{"(", + RowBox[{"tf", "+", "tz"}], ")"}]}], "+", + RowBox[{ + SuperscriptBox["tf", "2"], " ", "v0"}], "-", + RowBox[{"5", " ", + SuperscriptBox["tz", "2"], " ", "v0"}], "+", + RowBox[{"tf", " ", "tz", " ", "vf"}], "+", + RowBox[{"5", " ", + SuperscriptBox["tz", "2"], " ", "vf"}]}], ")"}]}], "+", + RowBox[{ + SuperscriptBox["jMax", "2"], " ", "tz", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"p0", " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox["tf", "2"], "-", + RowBox[{"2", " ", "tf", " ", "tz"}], "-", + SuperscriptBox["tz", "2"]}], ")"}]}], "+", + RowBox[{"pf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"2", " ", "tf", " ", "tz"}], "+", + SuperscriptBox["tz", "2"]}], ")"}]}], "-", + RowBox[{"2", " ", + SuperscriptBox["tf", "2"], " ", "tz", " ", "v0"}], "+", + RowBox[{"4", " ", "tf", " ", + SuperscriptBox["tz", "2"], " ", "v0"}], "+", + RowBox[{ + SuperscriptBox["tz", "3"], " ", "v0"}], "+", + RowBox[{ + SuperscriptBox["tf", "3"], " ", "vf"}], "-", + RowBox[{"5", " ", "tf", " ", + SuperscriptBox["tz", "2"], " ", "vf"}], "-", + RowBox[{ + SuperscriptBox["tz", "3"], " ", "vf"}]}], ")"}]}]}], ")"}]}], + "+", + RowBox[{"72", " ", + SuperscriptBox["jMax", "4"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + SuperscriptBox["jMax", "2"], " ", "tf", " ", + RowBox[{"(", + RowBox[{"tf", "-", + RowBox[{"2", " ", "tz"}]}], ")"}], " ", + SuperscriptBox["tz", "2"], " ", + RowBox[{"(", + RowBox[{"p0", "-", "pf", "-", + RowBox[{"tz", " ", "v0"}], "+", + RowBox[{"tf", " ", "vf"}], "+", + RowBox[{"tz", " ", "vf"}]}], ")"}]}], "-", + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "p0"}], "-", + RowBox[{"2", " ", "pf"}], "+", + RowBox[{"tf", " ", "v0"}], "-", + RowBox[{"tz", " ", "v0"}], "+", + RowBox[{"tf", " ", "vf"}], "+", + RowBox[{"tz", " ", "vf"}]}], ")"}]}], "+", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + SuperscriptBox["p0", "2"], " ", + RowBox[{"(", + RowBox[{"tf", "-", "tz"}], ")"}]}], "+", + RowBox[{ + SuperscriptBox["pf", "2"], " ", + RowBox[{"(", + RowBox[{"tf", "-", "tz"}], ")"}]}], "-", + RowBox[{ + SuperscriptBox["tf", "2"], " ", "tz", " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{"3", " ", + SuperscriptBox["tz", "3"], " ", + SuperscriptBox["v0", "2"]}], "+", + RowBox[{ + SuperscriptBox["tf", "3"], " ", "v0", " ", "vf"}], "-", + RowBox[{"tf", " ", + SuperscriptBox["tz", "2"], " ", "v0", " ", "vf"}], "-", + RowBox[{"6", " ", + SuperscriptBox["tz", "3"], " ", "v0", " ", "vf"}], "+", + RowBox[{"tf", " ", + SuperscriptBox["tz", "2"], " ", + SuperscriptBox["vf", "2"]}], "+", + RowBox[{"3", " ", + SuperscriptBox["tz", "3"], " ", + SuperscriptBox["vf", "2"]}], "-", + RowBox[{"pf", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "2"}], " ", "tf", " ", "tz", " ", "v0"}], "+", + RowBox[{ + SuperscriptBox["tz", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "v0"}], "+", "vf"}], ")"}]}], "+", + RowBox[{ + SuperscriptBox["tf", "2"], " ", + RowBox[{"(", + RowBox[{"v0", "+", "vf"}], ")"}]}]}], ")"}]}], "+", + RowBox[{"p0", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "2"}], " ", "pf", " ", + RowBox[{"(", + RowBox[{"tf", "-", "tz"}], ")"}]}], "-", + RowBox[{"2", " ", "tf", " ", "tz", " ", "v0"}], "+", + RowBox[{ + SuperscriptBox["tz", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "v0"}], "+", "vf"}], ")"}]}], "+", + RowBox[{ + SuperscriptBox["tf", "2"], " ", + RowBox[{"(", + RowBox[{"v0", "+", "vf"}], ")"}]}]}], ")"}]}]}], ")"}]}]}], + ")"}]}]}], ")"}], "/", + RowBox[{"(", + RowBox[{"jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", + SuperscriptBox["a0", "6"]}], "+", + RowBox[{"6", " ", + SuperscriptBox["a0", "4"], " ", "jMax", " ", + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}]}], "-", + RowBox[{"36", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "2"]}], "+", + RowBox[{"48", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "vf"}]}], ")"}]}], "-", + RowBox[{"144", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], " ", + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "vf"}]}], ")"}]}], "+", + RowBox[{"72", " ", + SuperscriptBox["jMax", "3"], " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"v0", "-", "vf"}], ")"}], "3"], "+", + RowBox[{"jMax", " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"p0", "-", "pf", "+", + RowBox[{"tf", " ", "vf"}]}], ")"}], "2"]}]}], ")"}]}]}], + ")"}]}], ")"}]}], ")"}]}]}]], "Output", + CellChangeTimes->{{3.817281309184107*^9, 3.8172813175899553`*^9}, { + 3.8172813902718143`*^9, 3.8172814124609747`*^9}, {3.817281480472601*^9, + 3.817281489685134*^9}, {3.8172815288145237`*^9, 3.817281562317478*^9}, + 3.817289034707954*^9}, + CellLabel-> + "Out[1176]=",ExpressionUUID->"b72c266f-a7f8-4687-9d93-b9c9367fda96"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"FullSimplify", "[", + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"8", ",", "2", ",", "8", ",", "2"}], "]"}], "]"}], "//.", + RowBox[{"{", + RowBox[{ + RowBox[{"resultT", "[", + RowBox[{"[", + RowBox[{"8", ",", "2", ",", "1", ",", "2"}], "]"}], "]"}], "\[Rule]", + "tz"}], "}"}]}], "]"}], ",", "CForm"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.817205104338703*^9, 3.817205137858006*^9}, { + 3.8172053908986597`*^9, 3.817205413877244*^9}, {3.8172075799985313`*^9, + 3.8172076070034246`*^9}, {3.817208279588471*^9, 3.817208332910727*^9}, { + 3.817208411596854*^9, 3.81720845067136*^9}, {3.817208516696246*^9, + 3.817208518364049*^9}, {3.817208842163911*^9, 3.8172088478497753`*^9}, { + 3.817208920746664*^9, 3.817208920822975*^9}, {3.817209048116349*^9, + 3.817209066344091*^9}, 3.817277896260805*^9, 3.81727792992447*^9, { + 3.817289040456444*^9, 3.817289055771402*^9}}, + CellLabel-> + "In[1183]:=",ExpressionUUID->"ef2eadde-82ba-41d3-9a0b-d30fc7d7a204"], + +Cell[BoxData["\<\"Power(a0,2)/(2.*jMax) + 2*a0*tz + jMax*Power(tz,2) + \ +v0\"\>"], "Output", + CellChangeTimes->{ + 3.817208848203587*^9, 3.817208921347019*^9, {3.817209049796928*^9, + 3.817209067184483*^9}, {3.817277886233904*^9, 3.817277902037616*^9}, { + 3.817289047046191*^9, 3.8172890561484203`*^9}}, + CellLabel-> + "Out[1183]=",ExpressionUUID->"dfe8e946-3c69-4840-8c7e-bd40f759ef5f"] +}, Open ]], + +Cell["Case 9 - a3 != 0", "Text", + CellChangeTimes->{{3.817199297723555*^9, + 3.8171993034485407`*^9}},ExpressionUUID->"5c00d19c-efbb-475f-a4a4-\ +adc1877059e7"], + +Cell[BoxData[ + RowBox[{ + RowBox[{"resultTa", "=", + RowBox[{"{", "\[IndentingNewLine]", + RowBox[{ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "aPlat"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"t7", "\[Equal]", "0"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"Join", "[", + RowBox[{"tVars", ",", + RowBox[{"{", "aPlat", "}"}]}], "]"}], ",", + RowBox[{"Cubics", "\[Rule]", "False"}], ",", + RowBox[{"Quartics", "\[Rule]", "False"}]}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", + RowBox[{"-", "aPlat"}]}], ",", + RowBox[{"t1", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"Join", "[", + RowBox[{"tVars", ",", + RowBox[{"{", "aPlat", "}"}]}], "]"}], ",", + RowBox[{"Cubics", "\[Rule]", "False"}], ",", + RowBox[{"Quartics", "\[Rule]", "False"}]}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "aPlat"}], ",", + RowBox[{"a1", "\[Equal]", "aMax"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"t7", "\[Equal]", "0"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"Join", "[", + RowBox[{"tVars", ",", + RowBox[{"{", "aPlat", "}"}]}], "]"}], ",", + RowBox[{"Cubics", "\[Rule]", "False"}], ",", + RowBox[{"Quartics", "\[Rule]", "False"}]}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "aPlat"}], ",", + RowBox[{"t1", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"a5", "\[Equal]", + RowBox[{"-", "aMax"}]}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"Join", "[", + RowBox[{"tVars", ",", + RowBox[{"{", "aPlat", "}"}]}], "]"}], ",", + RowBox[{"Cubics", "\[Rule]", "False"}], ",", + RowBox[{"Quartics", "\[Rule]", "False"}]}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "aPlat"}], ",", + RowBox[{"a1", "\[Equal]", + RowBox[{"-", "aMax"}]}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"t7", "\[Equal]", "0"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"Join", "[", + RowBox[{"tVars", ",", + RowBox[{"{", "aPlat", "}"}]}], "]"}], ",", + RowBox[{"Cubics", "\[Rule]", "False"}], ",", + RowBox[{"Quartics", "\[Rule]", "False"}]}], "]"}], ",", + "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "aPlat"}], ",", + RowBox[{"t1", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"a5", "\[Equal]", "aMax"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"Join", "[", + RowBox[{"tVars", ",", + RowBox[{"{", "aPlat", "}"}]}], "]"}], ",", + RowBox[{"Cubics", "\[Rule]", "False"}], ",", + RowBox[{"Quartics", "\[Rule]", "False"}]}], "]"}]}], + "\[IndentingNewLine]", "}"}]}], ";"}]], "Input", + CellChangeTimes->{{3.817199307345278*^9, 3.817199324696947*^9}, + 3.817200448131874*^9, {3.817202061689239*^9, 3.817202085862195*^9}, { + 3.817265456500353*^9, 3.817265494996078*^9}, {3.817265620283185*^9, + 3.817265622078382*^9}, {3.817266190182694*^9, 3.81726622245671*^9}, { + 3.8172663642517967`*^9, 3.817266364294613*^9}, {3.817266770950122*^9, + 3.817266786651701*^9}, 3.817266823427422*^9, {3.817267394227706*^9, + 3.817267397242619*^9}, {3.8172674685429163`*^9, 3.817267490207313*^9}, + 3.8172675237936296`*^9, 3.817269006850615*^9, 3.817269180494939*^9, { + 3.8172693796870193`*^9, 3.81726939540921*^9}, 3.817269489019843*^9, { + 3.817269550913919*^9, 3.817269582495365*^9}, {3.8172696597792683`*^9, + 3.817269673093995*^9}}, + CellLabel-> + "In[717]:=",ExpressionUUID->"013ba19d-162c-4e14-9e6b-43bcf125ceef"], + +Cell["\<\ +Case1 -> 1 (UDDU) / 2 (UDUD), Case2 -> 1 (UDDU) / 2 (UDUD), Case 3 -> 1 \ +(UDDU), Case 4 -> 2 (UDDU), Case 5-> 1(UDUD), Case 6-> 1 (UDUD)\ +\>", "Text", + CellChangeTimes->{{3.8172658312535543`*^9, 3.817265834325848*^9}, { + 3.817266381316019*^9, 3.817266387260919*^9}, {3.817266844193924*^9, + 3.817266844265978*^9}, {3.817267941680891*^9, 3.817267951096839*^9}, { + 3.817268271292224*^9, 3.817268280837641*^9}, {3.817269566668298*^9, + 3.8172696171423397`*^9}},ExpressionUUID->"ccf44efd-e09a-4bbb-a696-\ +b4c90f7a95eb"], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{"resultTa", "[", + RowBox[{"[", + RowBox[{"6", ",", "1", ",", "7", ",", "2"}], "]"}], "]"}], "]"}], ",", + "CForm"}], "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.817265499752473*^9, 3.817265502986458*^9}, { + 3.817265639391837*^9, 3.817265642449834*^9}, {3.81726571679879*^9, + 3.817265763955217*^9}, {3.8172658406982603`*^9, 3.8172658423822193`*^9}, { + 3.8172662344229*^9, 3.817266284843684*^9}, {3.817266331152025*^9, + 3.8172663321244926`*^9}, {3.817266412616894*^9, 3.8172664466999893`*^9}, { + 3.8172668459738197`*^9, 3.817266895760104*^9}, {3.817268767761549*^9, + 3.817268771935257*^9}, {3.8172688263122473`*^9, 3.817268880737111*^9}, { + 3.817269690126698*^9, 3.817269740905311*^9}}, + CellLabel-> + "In[689]:=",ExpressionUUID->"b4fd3303-7c30-4af8-94b1-4505577eaf40"], + +Cell[BoxData["\<\"aMax/jMax\"\>"], "Output", + CellChangeTimes->{ + 3.817265503359898*^9, {3.817265635594121*^9, 3.817265642807448*^9}, { + 3.817265717144732*^9, 3.817265764334104*^9}, {3.8172658410199757`*^9, + 3.817265843063768*^9}, {3.817266228363278*^9, 3.817266285241193*^9}, + 3.817266336850995*^9, {3.817266389245998*^9, 3.817266447095387*^9}, { + 3.817266847014901*^9, 3.817266896239656*^9}, {3.817268768162199*^9, + 3.817268772746282*^9}, {3.817268819523574*^9, 3.8172688811055727`*^9}, { + 3.817269691950478*^9, 3.817269741332467*^9}}, + CellLabel-> + "Out[689]=",ExpressionUUID->"3c247a78-5f1f-4bfe-aeb8-c0def9d99fe4"] +}, Open ]], + +Cell["Case 1: Root is t1, Case 2: Root is t3", "Text", + CellChangeTimes->{{3.8172021457068987`*^9, + 3.817202155527573*^9}},ExpressionUUID->"6e1bb727-a1dc-4c24-af7f-\ +abfa0f3b9409"], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"coeffList", "=", + RowBox[{"Simplify", "[", + RowBox[{"CoefficientList", "[", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{"resultTa", "[", + RowBox[{"[", + RowBox[{"2", ",", "2", ",", "3", ",", "2", ",", "1"}], "]"}], "]"}], + ")"}], "[", "x", "]"}], ",", "x"}], "]"}], "]"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"coeffList", "[", + RowBox[{"[", "1", "]"}], "]"}], ",", "CForm"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.817200459186548*^9, 3.817200516822897*^9}, { + 3.8172006139636374`*^9, 3.817200714738187*^9}, {3.817202163442213*^9, + 3.817202171636221*^9}, {3.81726802157551*^9, 3.817268079525145*^9}, { + 3.817268359134158*^9, 3.81726836240077*^9}}, + CellLabel-> + "In[608]:=",ExpressionUUID->"c24549d5-e55a-4ad4-a91d-4e532e8d2688"], + +Cell[BoxData["\<\"-Power(a0,6) + 6*Power(a0,5)*jMax*tf + \ +72*Power(jMax,3)*(jMax*Power(p0 - pf + tf*v0,2) + Power(v0 - vf,3)) - \ +6*Power(a0,4)*jMax*(2*jMax*Power(tf,2) - v0 + vf) + \ +24*Power(a0,3)*Power(jMax,2)*(2*p0 - 2*pf - tf*v0 + 3*tf*vf) + \ +72*a0*Power(jMax,3)*(jMax*Power(tf,2)*(p0 - pf + tf*v0) + (v0 - vf)*(-2*p0 + \ +2*pf + tf*v0 - 3*tf*vf)) + \ +18*Power(a0,2)*Power(jMax,2)*(Power(jMax,2)*Power(tf,4) - 2*Power(v0 - vf,2) \ +- 8*jMax*tf*(p0 - pf + tf*vf))\"\>"], "Output", + CellChangeTimes->{{3.817200687599572*^9, 3.817200715110696*^9}, { + 3.817202165192795*^9, 3.817202171958297*^9}, {3.8172680257100277`*^9, + 3.8172680798545218`*^9}, {3.817268359623165*^9, 3.817268362878442*^9}}, + CellLabel-> + "Out[609]=",ExpressionUUID->"8a1b58c3-1441-4fe3-bbe7-d56171dd7cae"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"Simplify", "[", + RowBox[{ + RowBox[{"resultTa", "[", + RowBox[{"[", + RowBox[{"2", ",", "2", ",", "7", ",", "2"}], "]"}], "]"}], "//.", + RowBox[{"{", + RowBox[{ + RowBox[{"resultTa", "[", + RowBox[{"[", + RowBox[{"2", ",", "2", ",", "3", ",", "2"}], "]"}], "]"}], "\[Rule]", + "t"}], "}"}]}], "]"}], ",", "CForm"}], "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{ + 3.817202615037848*^9, {3.817202703455277*^9, 3.8172028329768457`*^9}, { + 3.817268093411096*^9, 3.817268131227783*^9}}, + CellLabel-> + "In[601]:=",ExpressionUUID->"27add3ed-17eb-49e9-9b82-a98025fa047d"], + +Cell[BoxData["\<\"(Power(a0,5) - Power(a0,4)*jMax*(3*t + 4*tf) + \ +Power(a0,3)*jMax*(jMax*(3*Power(t,2) + 12*t*tf + 5*Power(tf,2)) - 2*v0 + \ +2*vf) + 3*Power(a0,2)*Power(jMax,2)*(-14*p0 + 14*pf + 2*jMax*Power(t,3) - \ +3*jMax*Power(t,2)*tf - 5*jMax*t*Power(tf,2) + 2*jMax*Power(tf,3) + 2*t*v0 + \ +2*tf*v0 - 2*t*vf - 16*tf*vf) + 6*Power(jMax,3)*(Power(jMax,2)*t*Power(t - \ +tf,2)*Power(tf,2) - 2*(v0 - vf)*(-p0 + pf + tf*v0 - 2*tf*vf) + \ +jMax*tf*(6*pf*t + 2*pf*tf - 2*p0*(3*t + tf) - 3*Power(t,2)*v0 + t*tf*v0 - \ +2*Power(tf,2)*v0 + 3*Power(t,2)*vf - 7*t*tf*vf)) - \ +6*a0*Power(jMax,2)*(Power(jMax,2)*Power(t - tf,2)*tf*(2*t + tf) - 4*Power(v0 \ +- vf,2) - jMax*(6*p0*t - 6*pf*t + 10*p0*tf - 10*pf*tf + 3*Power(t,2)*v0 - \ +2*t*tf*v0 + 3*Power(tf,2)*v0 - 3*Power(t,2)*vf + 8*t*tf*vf + \ +7*Power(tf,2)*vf)))/(jMax*(Power(a0,4) - 4*Power(a0,3)*jMax*tf + \ +6*Power(a0,2)*Power(jMax,2)*Power(tf,2) - 24*a0*Power(jMax,2)*(p0 - pf + \ +tf*vf) + 12*Power(jMax,2)*(Power(v0 - vf,2) + jMax*tf*(2*p0 - 2*pf + tf*(v0 + \ +vf)))))\"\>"], "Output", + CellChangeTimes->{ + 3.817200666650454*^9, {3.817202710271187*^9, 3.817202833401093*^9}, { + 3.817268097335195*^9, 3.817268131943392*^9}}, + CellLabel-> + "Out[601]=",ExpressionUUID->"9edd45ed-0ce4-41cc-9909-2527fddc394d"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{"as", "=", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"v3", "\[Equal]", "vMax"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"{", + RowBox[{ + "t1", ",", "t2", ",", "t3", ",", "t4", ",", "t5", ",", "t6", ",", "t7", + ",", "vMax"}], "}"}]}], "]"}]}]], "Input", + CellChangeTimes->{{3.817284933059939*^9, 3.817284955538196*^9}, { + 3.817285013083449*^9, 3.8172850169283657`*^9}, {3.81728504917097*^9, + 3.817285107274621*^9}, {3.817285174370593*^9, 3.817285186225293*^9}, { + 3.817285240095962*^9, 3.817285245840892*^9}, {3.817285281439425*^9, + 3.817285281595951*^9}, {3.8172853843079348`*^9, 3.817285423967931*^9}}, + CellLabel-> + "In[1011]:=",ExpressionUUID->"76ceed0f-1818-4f48-ae21-f8daf9cd0832"], + +Cell[BoxData[ + InterpretationBox[ + TagBox[ + FrameBox[GridBox[{ + { + ItemBox[ + TagBox[ + RowBox[{"{", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"t1", "\[Rule]", + RowBox[{"Root", "[", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"7", " ", + SuperscriptBox["a0", "6"]}], "+", + RowBox[{"24", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", "p0"}], "-", + RowBox[{"72", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["p0", "2"]}], "-", + RowBox[{"24", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", "pf"}], "+", + RowBox[{"144", " ", + SuperscriptBox["jMax", "4"], " ", "p0", " ", "pf"}], "-", + RowBox[{"72", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["pf", "2"]}], "+", + TemplateBox[{"27"}, + "OutputSizeLimit`Skeleton"], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"84", " ", + SuperscriptBox["a0", "5"], " ", "jMax"}], "+", + RowBox[{"144", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "p0"}], "-", + RowBox[{"144", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "pf"}], "+", + RowBox[{"120", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "2"], " ", "tf"}], "-", + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "p0", " ", "tf"}], "+", + + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "pf", " ", "tf"}], "-", + + RowBox[{"144", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"432", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", "v0"}], "+", + RowBox[{"144", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "tf", " ", "v0"}], "-", + + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["tf", "2"], " ", "v0"}], "+", + RowBox[{"432", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["v0", "2"]}], "-", + RowBox[{"432", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", "vf"}], "-", + RowBox[{"864", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", "v0", " ", "vf"}], "+", + + RowBox[{"432", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], " ", "#1"}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"366", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "2"]}], "+", + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "p0"}], "-", + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "pf"}], "+", + RowBox[{"456", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "3"], " ", "tf"}], "-", + RowBox[{"144", " ", + SuperscriptBox["jMax", "5"], " ", "p0", " ", "tf"}], "+", + + RowBox[{"144", " ", + SuperscriptBox["jMax", "5"], " ", "pf", " ", "tf"}], "-", + + RowBox[{"360", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"1080", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "v0"}], "+", + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "tf", " ", "v0"}], "-", + + RowBox[{"144", " ", + SuperscriptBox["jMax", "5"], " ", + SuperscriptBox["tf", "2"], " ", "v0"}], "+", + RowBox[{"216", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["v0", "2"]}], "-", + RowBox[{"1080", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "vf"}], "-", + RowBox[{"432", " ", + SuperscriptBox["jMax", "4"], " ", "v0", " ", "vf"}], "+", + + RowBox[{"216", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], " ", + SuperscriptBox["#1", "2"]}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"696", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "3"]}], "+", + RowBox[{"144", " ", + SuperscriptBox["jMax", "5"], " ", "p0"}], "-", + RowBox[{"144", " ", + SuperscriptBox["jMax", "5"], " ", "pf"}], "+", + RowBox[{"792", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "4"], " ", "tf"}], "-", + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "5"], " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"864", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "v0"}], "+", + RowBox[{"144", " ", + SuperscriptBox["jMax", "5"], " ", "tf", " ", "v0"}], "-", + + RowBox[{"864", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "vf"}]}], ")"}], " ", + SuperscriptBox["#1", "3"]}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"540", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"576", " ", "a0", " ", + SuperscriptBox["jMax", "5"], " ", "tf"}], "-", + RowBox[{"72", " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"216", " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "-", + RowBox[{"216", " ", + SuperscriptBox["jMax", "5"], " ", "vf"}]}], ")"}], " ", + SuperscriptBox["#1", "4"]}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"144", " ", "a0", " ", + SuperscriptBox["jMax", "5"]}], "+", + RowBox[{"144", " ", + SuperscriptBox["jMax", "6"], " ", "tf"}]}], ")"}], " ", + SuperscriptBox["#1", "5"]}]}], "&"}], ",", "1"}], "]"}]}], + ",", + RowBox[{"t2", "\[Rule]", "0"}], ",", + TemplateBox[{"4"}, + "OutputSizeLimit`Skeleton"], ",", + RowBox[{"t7", "\[Rule]", + TemplateBox[{"1"}, + "OutputSizeLimit`Skeleton"]}], ",", + RowBox[{"vMax", "\[Rule]", + FractionBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "+", + TemplateBox[{"2"}, + "OutputSizeLimit`Skeleton"], "+", + TemplateBox[{"1"}, + "OutputSizeLimit`Skeleton"]}], + RowBox[{"2", " ", "jMax"}]]}]}], "}"}], ",", + TemplateBox[{"3"}, + "OutputSizeLimit`Skeleton"], ",", + RowBox[{"{", + TemplateBox[{"1"}, + "OutputSizeLimit`Skeleton"], "}"}]}], "}"}], + Short[#, 5]& ], + BaseStyle->{Deployed -> False}, + StripOnInput->False]}, + {GridBox[{ + { + PaneBox[ + TagBox[ + TooltipBox[ + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource[ + "FEStrings", "sizeBriefExplanation"], StandardForm], + ImageSizeCache->{56., {2., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLText", + StripOnInput->False], + StyleBox[ + DynamicBox[ + ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeExplanation"], + StandardForm]], DynamicUpdating -> True, LineIndent -> 0, + LinebreakAdjustments -> {1., 100, 0, 0, 0}, + LineSpacing -> {1, 2}, StripOnInput -> False]], + Annotation[#, + Style[ + Dynamic[ + FEPrivate`FrontEndResource["FEStrings", "sizeExplanation"]], + DynamicUpdating -> True, LineIndent -> 0, + LinebreakAdjustments -> {1., 100, 0, 0, 0}, + LineSpacing -> {1, 2}], "Tooltip"]& ], + Alignment->Center, + BaselinePosition->Baseline, + ImageSize->{Automatic, {25, Full}}], + ButtonBox[ + PaneSelectorBox[{False-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowLess"], + StandardForm], + ImageSizeCache->{49., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControl", + StripOnInput->False], True-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowLess"], + StandardForm]], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControlActive", + StripOnInput->False]}, Dynamic[ + CurrentValue["MouseOver"]], + Alignment->Center, + FrameMargins->0, + ImageSize->{Automatic, {25, Full}}], + Appearance->None, + BaselinePosition->Baseline, + + ButtonFunction:>OutputSizeLimit`ButtonFunction[ + OutputSizeLimit`Defer, 1011, 33777537423254864718, 5/2], + Enabled->True, + Evaluator->Automatic, + Method->"Queued"], + ButtonBox[ + PaneSelectorBox[{False-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowMore"], + StandardForm], + ImageSizeCache->{55., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControl", + StripOnInput->False], True-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowMore"], + StandardForm], + ImageSizeCache->{55., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControlActive", + StripOnInput->False]}, Dynamic[ + CurrentValue["MouseOver"]], + Alignment->Center, + FrameMargins->0, + ImageSize->{Automatic, {25, Full}}], + Appearance->None, + BaselinePosition->Baseline, + + ButtonFunction:>OutputSizeLimit`ButtonFunction[ + OutputSizeLimit`Defer, 1011, 33777537423254864718, 5 2], + Enabled->True, + Evaluator->Automatic, + Method->"Queued"], + ButtonBox[ + PaneSelectorBox[{False-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowAll"], + StandardForm], + ImageSizeCache->{41., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControl", + StripOnInput->False], True-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowAll"], + StandardForm]], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControlActive", + StripOnInput->False]}, Dynamic[ + CurrentValue["MouseOver"]], + Alignment->Center, + FrameMargins->0, + ImageSize->{Automatic, {25, Full}}], + Appearance->None, + BaselinePosition->Baseline, + + ButtonFunction:>OutputSizeLimit`ButtonFunction[ + OutputSizeLimit`Defer, 1011, 33777537423254864718, Infinity], + Enabled->True, + Evaluator->Automatic, + Method->"Queued"], + ButtonBox[ + PaneSelectorBox[{False-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeChangeLimit"], + StandardForm], + ImageSizeCache->{76., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControl", + StripOnInput->False], True-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeChangeLimit"], + StandardForm]], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControlActive", + StripOnInput->False]}, Dynamic[ + CurrentValue["MouseOver"]], + Alignment->Center, + FrameMargins->0, + ImageSize->{Automatic, {25, Full}}], + Appearance->None, + BaselinePosition->Baseline, + ButtonFunction:>FrontEndExecute[{ + FrontEnd`SetOptions[ + FrontEnd`$FrontEnd, + FrontEnd`PreferencesSettings -> {"Page" -> "Advanced"}], + FrontEnd`FrontEndToken["PreferencesDialog"]}], + Evaluator->None, + Method->"Preemptive"]} + }, + AutoDelete->False, + FrameStyle->GrayLevel[0.85], + GridBoxDividers->{"Columns" -> {False, {True}}}, + GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, + GridBoxSpacings->{"Columns" -> {{2}}}]} + }, + DefaultBaseStyle->"Column", + GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, + GridBoxDividers->{"Columns" -> {{False}}, "Rows" -> {{False}}}, + GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{1.}}}, + GridBoxSpacings->{"Columns" -> { + Offset[0.27999999999999997`], { + Offset[0.5599999999999999]}, + Offset[0.27999999999999997`]}, "Rows" -> { + Offset[0.2], + Offset[1.2], { + Offset[0.4]}, + Offset[0.2]}}], + BaseStyle->"OutputSizeLimit", + FrameMargins->{{12, 12}, {0, 15}}, + FrameStyle->GrayLevel[0.85], + RoundingRadius->5, + StripOnInput->False], + Deploy, + DefaultBaseStyle->"Deploy"], + If[33777537423254864718 === $SessionID, + Out[1011], Message[ + MessageName[Syntax, "noinfoker"]]; Missing["NotAvailable"]; + Null]]], "Output", + CellChangeTimes->{{3.8172851747361193`*^9, 3.817285187167993*^9}, + 3.817285243451674*^9, {3.817285280181018*^9, 3.817285284528211*^9}, { + 3.817285384878964*^9, 3.817285426880769*^9}}, + CellLabel-> + "Out[1011]=",ExpressionUUID->"46a43cc4-d030-4bab-8cd7-2a1f9e8641fc"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{"as", "[", + RowBox[{"[", "1", "]"}], "]"}]], "Input", + CellChangeTimes->{{3.817284942996991*^9, 3.8172849430682096`*^9}, { + 3.8172850264898443`*^9, 3.817285028817122*^9}, {3.8172850638401823`*^9, + 3.817285064521875*^9}, {3.817285439320808*^9, 3.8172854912199707`*^9}}, + CellLabel-> + "In[1018]:=",ExpressionUUID->"b4557152-17d6-464a-a9f3-17efadbdba9c"], + +Cell[BoxData[ + InterpretationBox[ + TagBox[ + FrameBox[GridBox[{ + { + ItemBox[ + TagBox[ + RowBox[{"{", + RowBox[{ + RowBox[{"t1", "\[Rule]", + RowBox[{"Root", "[", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"7", " ", + SuperscriptBox["a0", "6"]}], "+", + RowBox[{"24", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", "p0"}], "-", + RowBox[{"72", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["p0", "2"]}], "-", + RowBox[{"24", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", "pf"}], "+", + RowBox[{"144", " ", + SuperscriptBox["jMax", "4"], " ", "p0", " ", "pf"}], "-", + RowBox[{"72", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["pf", "2"]}], "+", + TemplateBox[{"24"}, + "OutputSizeLimit`Skeleton"], "+", + RowBox[{"216", " ", + SuperscriptBox["jMax", "3"], " ", "v0", " ", + SuperscriptBox["vf", "2"]}], "-", + RowBox[{"72", " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["vf", "3"]}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"84", " ", + SuperscriptBox["a0", "5"], " ", "jMax"}], "+", + RowBox[{"144", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "p0"}], "-", + RowBox[{"144", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "pf"}], "+", + RowBox[{"120", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "2"], " ", "tf"}], "-", + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "p0", " ", "tf"}], "+", + + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "pf", " ", "tf"}], "-", + + RowBox[{"144", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"432", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", "v0"}], "+", + RowBox[{"144", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "tf", " ", "v0"}], "-", + + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["tf", "2"], " ", "v0"}], "+", + RowBox[{"432", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["v0", "2"]}], "-", + RowBox[{"432", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", "vf"}], "-", + RowBox[{"864", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", "v0", " ", "vf"}], "+", + + RowBox[{"432", " ", "a0", " ", + SuperscriptBox["jMax", "3"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], " ", "#1"}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"366", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "2"]}], "+", + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "p0"}], "-", + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "pf"}], "+", + RowBox[{"456", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "3"], " ", "tf"}], "-", + RowBox[{"144", " ", + SuperscriptBox["jMax", "5"], " ", "p0", " ", "tf"}], "+", + + RowBox[{"144", " ", + SuperscriptBox["jMax", "5"], " ", "pf", " ", "tf"}], "-", + + RowBox[{"360", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"1080", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "v0"}], "+", + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "tf", " ", "v0"}], "-", + + RowBox[{"144", " ", + SuperscriptBox["jMax", "5"], " ", + SuperscriptBox["tf", "2"], " ", "v0"}], "+", + RowBox[{"216", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["v0", "2"]}], "-", + RowBox[{"1080", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "vf"}], "-", + RowBox[{"432", " ", + SuperscriptBox["jMax", "4"], " ", "v0", " ", "vf"}], "+", + + RowBox[{"216", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], " ", + SuperscriptBox["#1", "2"]}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"696", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "3"]}], "+", + RowBox[{"144", " ", + SuperscriptBox["jMax", "5"], " ", "p0"}], "-", + RowBox[{"144", " ", + SuperscriptBox["jMax", "5"], " ", "pf"}], "+", + RowBox[{"792", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "4"], " ", "tf"}], "-", + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "5"], " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"864", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "v0"}], "+", + RowBox[{"144", " ", + SuperscriptBox["jMax", "5"], " ", "tf", " ", "v0"}], "-", + + RowBox[{"864", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "vf"}]}], ")"}], " ", + SuperscriptBox["#1", "3"]}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"540", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"576", " ", "a0", " ", + SuperscriptBox["jMax", "5"], " ", "tf"}], "-", + RowBox[{"72", " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"216", " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "-", + RowBox[{"216", " ", + SuperscriptBox["jMax", "5"], " ", "vf"}]}], ")"}], " ", + SuperscriptBox["#1", "4"]}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"144", " ", "a0", " ", + SuperscriptBox["jMax", "5"]}], "+", + RowBox[{"144", " ", + SuperscriptBox["jMax", "6"], " ", "tf"}]}], ")"}], " ", + SuperscriptBox["#1", "5"]}]}], "&"}], ",", "1"}], "]"}]}], + ",", + RowBox[{"t2", "\[Rule]", "0"}], ",", + TemplateBox[{"4"}, + "OutputSizeLimit`Skeleton"], ",", + RowBox[{"t7", "\[Rule]", + TemplateBox[{"1"}, + "OutputSizeLimit`Skeleton"]}], ",", + RowBox[{"vMax", "\[Rule]", + FractionBox[ + TemplateBox[{"1"}, + "OutputSizeLimit`Skeleton"], + RowBox[{"2", " ", "jMax"}]]}]}], "}"}], + Short[#, 5]& ], + BaseStyle->{Deployed -> False}, + StripOnInput->False]}, + {GridBox[{ + { + PaneBox[ + TagBox[ + TooltipBox[ + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource[ + "FEStrings", "sizeBriefExplanation"], StandardForm], + ImageSizeCache->{56., {2., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLText", + StripOnInput->False], + StyleBox[ + DynamicBox[ + ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeExplanation"], + StandardForm]], DynamicUpdating -> True, LineIndent -> 0, + LinebreakAdjustments -> {1., 100, 0, 0, 0}, + LineSpacing -> {1, 2}, StripOnInput -> False]], + Annotation[#, + Style[ + Dynamic[ + FEPrivate`FrontEndResource["FEStrings", "sizeExplanation"]], + DynamicUpdating -> True, LineIndent -> 0, + LinebreakAdjustments -> {1., 100, 0, 0, 0}, + LineSpacing -> {1, 2}], "Tooltip"]& ], + Alignment->Center, + BaselinePosition->Baseline, + ImageSize->{Automatic, {25, Full}}], + ButtonBox[ + PaneSelectorBox[{False-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowLess"], + StandardForm], + ImageSizeCache->{49., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControl", + StripOnInput->False], True-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowLess"], + StandardForm]], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControlActive", + StripOnInput->False]}, Dynamic[ + CurrentValue["MouseOver"]], + Alignment->Center, + FrameMargins->0, + ImageSize->{Automatic, {25, Full}}], + Appearance->None, + BaselinePosition->Baseline, + ButtonFunction:>OutputSizeLimit`ButtonFunction[ + OutputSizeLimit`Defer, 1018, 33777537423254864718, 5/2], + Enabled->True, + Evaluator->Automatic, + Method->"Queued"], + ButtonBox[ + PaneSelectorBox[{False-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowMore"], + StandardForm], + ImageSizeCache->{55., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControl", + StripOnInput->False], True-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowMore"], + StandardForm], + ImageSizeCache->{55., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControlActive", + StripOnInput->False]}, Dynamic[ + CurrentValue["MouseOver"]], + Alignment->Center, + FrameMargins->0, + ImageSize->{Automatic, {25, Full}}], + Appearance->None, + BaselinePosition->Baseline, + + ButtonFunction:>OutputSizeLimit`ButtonFunction[ + OutputSizeLimit`Defer, 1018, 33777537423254864718, 5 2], + Enabled->True, + Evaluator->Automatic, + Method->"Queued"], + ButtonBox[ + PaneSelectorBox[{False-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowAll"], + StandardForm], + ImageSizeCache->{41., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControl", + StripOnInput->False], True-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowAll"], + StandardForm], + ImageSizeCache->{41., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControlActive", + StripOnInput->False]}, Dynamic[ + CurrentValue["MouseOver"]], + Alignment->Center, + FrameMargins->0, + ImageSize->{Automatic, {25, Full}}], + Appearance->None, + BaselinePosition->Baseline, + + ButtonFunction:>OutputSizeLimit`ButtonFunction[ + OutputSizeLimit`Defer, 1018, 33777537423254864718, Infinity], + Enabled->True, + Evaluator->Automatic, + Method->"Queued"], + ButtonBox[ + PaneSelectorBox[{False-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeChangeLimit"], + StandardForm], + ImageSizeCache->{76., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControl", + StripOnInput->False], True-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeChangeLimit"], + StandardForm]], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControlActive", + StripOnInput->False]}, Dynamic[ + CurrentValue["MouseOver"]], + Alignment->Center, + FrameMargins->0, + ImageSize->{Automatic, {25, Full}}], + Appearance->None, + BaselinePosition->Baseline, + ButtonFunction:>FrontEndExecute[{ + FrontEnd`SetOptions[ + FrontEnd`$FrontEnd, + FrontEnd`PreferencesSettings -> {"Page" -> "Advanced"}], + FrontEnd`FrontEndToken["PreferencesDialog"]}], + Evaluator->None, + Method->"Preemptive"]} + }, + AutoDelete->False, + FrameStyle->GrayLevel[0.85], + GridBoxDividers->{"Columns" -> {False, {True}}}, + GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, + GridBoxSpacings->{"Columns" -> {{2}}}]} + }, + DefaultBaseStyle->"Column", + GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, + GridBoxDividers->{"Columns" -> {{False}}, "Rows" -> {{False}}}, + GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{1.}}}, + GridBoxSpacings->{"Columns" -> { + Offset[0.27999999999999997`], { + Offset[0.5599999999999999]}, + Offset[0.27999999999999997`]}, "Rows" -> { + Offset[0.2], + Offset[1.2], { + Offset[0.4]}, + Offset[0.2]}}], + BaseStyle->"OutputSizeLimit", + FrameMargins->{{12, 12}, {0, 15}}, + FrameStyle->GrayLevel[0.85], + RoundingRadius->5, + StripOnInput->False], + Deploy, + DefaultBaseStyle->"Deploy"], + If[33777537423254864718 === $SessionID, + Out[1018], Message[ + MessageName[Syntax, "noinfoker"]]; Missing["NotAvailable"]; + Null]]], "Output", + CellChangeTimes->{{3.8172849456917973`*^9, 3.8172849521138563`*^9}, { + 3.817285024829327*^9, 3.817285029606349*^9}, {3.8172850683326473`*^9, + 3.8172850965910263`*^9}, {3.81728544151245*^9, 3.817285444674882*^9}, { + 3.817285476653879*^9, 3.817285492082013*^9}}, + CellLabel-> + "Out[1018]=",ExpressionUUID->"c0df61e4-93ae-49db-8a65-19a2a6e672cc"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"v3", "\[Equal]", "vPlat"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"{", + RowBox[{ + "t1", ",", "t2", ",", "t3", ",", "t4", ",", "t5", ",", "t6", ",", "t7", + ",", "vPlat"}], "}"}]}], "]"}]], "Input", + CellChangeTimes->{{3.81728543625239*^9, 3.817285495283444*^9}, { + 3.817290162577376*^9, 3.8172901801075478`*^9}}, + CellLabel-> + "In[1186]:=",ExpressionUUID->"a28fc3ef-309c-4020-8e87-7ea695c7f0f2"], + +Cell[BoxData[ + InterpretationBox[ + TagBox[ + FrameBox[GridBox[{ + { + ItemBox[ + TagBox[ + RowBox[{"{", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"t1", "\[Rule]", + RowBox[{"Root", "[", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"7", " ", + SuperscriptBox["a0", "6"]}], "+", + RowBox[{"24", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", "p0"}], "-", + RowBox[{"72", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["p0", "2"]}], "-", + RowBox[{"24", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "2"], " ", "pf"}], "+", + TemplateBox[{"31"}, + "OutputSizeLimit`Skeleton"], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"366", " ", + SuperscriptBox["a0", "4"], " ", + SuperscriptBox["jMax", "2"]}], "+", + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "p0"}], "-", + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "pf"}], "+", + RowBox[{"456", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "3"], " ", "tf"}], "-", + RowBox[{"144", " ", + SuperscriptBox["jMax", "5"], " ", "p0", " ", "tf"}], "+", + + RowBox[{"144", " ", + SuperscriptBox["jMax", "5"], " ", "pf", " ", "tf"}], "-", + + RowBox[{"360", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"1080", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "v0"}], "+", + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "tf", " ", "v0"}], "-", + + RowBox[{"144", " ", + SuperscriptBox["jMax", "5"], " ", + SuperscriptBox["tf", "2"], " ", "v0"}], "+", + RowBox[{"216", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["v0", "2"]}], "-", + RowBox[{"1080", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "3"], " ", "vf"}], "-", + RowBox[{"432", " ", + SuperscriptBox["jMax", "4"], " ", "v0", " ", "vf"}], "+", + + RowBox[{"216", " ", + SuperscriptBox["jMax", "4"], " ", + SuperscriptBox["vf", "2"]}]}], ")"}], " ", + SuperscriptBox["#1", "2"]}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"696", " ", + SuperscriptBox["a0", "3"], " ", + SuperscriptBox["jMax", "3"]}], "+", + RowBox[{"144", " ", + SuperscriptBox["jMax", "5"], " ", "p0"}], "-", + RowBox[{"144", " ", + SuperscriptBox["jMax", "5"], " ", "pf"}], "+", + RowBox[{"792", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "4"], " ", "tf"}], "-", + RowBox[{"288", " ", "a0", " ", + SuperscriptBox["jMax", "5"], " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"864", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "v0"}], "+", + RowBox[{"144", " ", + SuperscriptBox["jMax", "5"], " ", "tf", " ", "v0"}], "-", + + RowBox[{"864", " ", "a0", " ", + SuperscriptBox["jMax", "4"], " ", "vf"}]}], ")"}], " ", + SuperscriptBox["#1", "3"]}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"540", " ", + SuperscriptBox["a0", "2"], " ", + SuperscriptBox["jMax", "4"]}], "+", + RowBox[{"576", " ", "a0", " ", + SuperscriptBox["jMax", "5"], " ", "tf"}], "-", + RowBox[{"72", " ", + SuperscriptBox["jMax", "6"], " ", + SuperscriptBox["tf", "2"]}], "+", + RowBox[{"216", " ", + SuperscriptBox["jMax", "5"], " ", "v0"}], "-", + RowBox[{"216", " ", + SuperscriptBox["jMax", "5"], " ", "vf"}]}], ")"}], " ", + SuperscriptBox["#1", "4"]}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"144", " ", "a0", " ", + SuperscriptBox["jMax", "5"]}], "+", + RowBox[{"144", " ", + SuperscriptBox["jMax", "6"], " ", "tf"}]}], ")"}], " ", + SuperscriptBox["#1", "5"]}]}], "&"}], ",", "1"}], "]"}]}], + ",", + RowBox[{"t2", "\[Rule]", "0"}], ",", + RowBox[{"t3", "\[Rule]", + FractionBox[ + TemplateBox[{"1"}, + "OutputSizeLimit`Skeleton"], "jMax"]}], ",", + TemplateBox[{"2"}, + "OutputSizeLimit`Skeleton"], ",", + RowBox[{"t6", "\[Rule]", "0"}], ",", + RowBox[{"t7", "\[Rule]", + FractionBox[ + TemplateBox[{"1"}, + "OutputSizeLimit`Skeleton"], + RowBox[{"jMax", " ", + TemplateBox[{"1"}, + "OutputSizeLimit`Skeleton"]}]]}], ",", + RowBox[{"vPlat", "\[Rule]", + FractionBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "+", + RowBox[{"2", " ", "jMax", " ", "v0"}], "+", + TemplateBox[{"1"}, + "OutputSizeLimit`Skeleton"], "+", + RowBox[{"2", " ", + SuperscriptBox["jMax", "2"], " ", + SuperscriptBox[ + TemplateBox[{"1"}, + "OutputSizeLimit`Skeleton"], "2"]}]}], + RowBox[{"2", " ", "jMax"}]]}]}], "}"}], ",", + TemplateBox[{"4"}, + "OutputSizeLimit`Skeleton"]}], "}"}], + Short[#, 10]& ], + BaseStyle->{Deployed -> False}, + StripOnInput->False]}, + {GridBox[{ + { + PaneBox[ + TagBox[ + TooltipBox[ + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource[ + "FEStrings", "sizeBriefExplanation"], StandardForm], + ImageSizeCache->{56., {2., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLText", + StripOnInput->False], + StyleBox[ + DynamicBox[ + ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeExplanation"], + StandardForm]], DynamicUpdating -> True, LineIndent -> 0, + LinebreakAdjustments -> {1., 100, 0, 0, 0}, + LineSpacing -> {1, 2}, StripOnInput -> False]], + Annotation[#, + Style[ + Dynamic[ + FEPrivate`FrontEndResource["FEStrings", "sizeExplanation"]], + DynamicUpdating -> True, LineIndent -> 0, + LinebreakAdjustments -> {1., 100, 0, 0, 0}, + LineSpacing -> {1, 2}], "Tooltip"]& ], + Alignment->Center, + BaselinePosition->Baseline, + ImageSize->{Automatic, {25, Full}}], + ButtonBox[ + PaneSelectorBox[{False-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowLess"], + StandardForm], + ImageSizeCache->{49., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControl", + StripOnInput->False], True-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowLess"], + StandardForm]], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControlActive", + StripOnInput->False]}, Dynamic[ + CurrentValue["MouseOver"]], + Alignment->Center, + FrameMargins->0, + ImageSize->{Automatic, {25, Full}}], + Appearance->None, + BaselinePosition->Baseline, + ButtonFunction:>OutputSizeLimit`ButtonFunction[ + OutputSizeLimit`Defer, 1186, 33777537423254864718, 10/2], + Enabled->True, + Evaluator->Automatic, + Method->"Queued"], + ButtonBox[ + PaneSelectorBox[{False-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowMore"], + StandardForm], + ImageSizeCache->{55., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControl", + StripOnInput->False], True-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowMore"], + StandardForm], + ImageSizeCache->{55., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControlActive", + StripOnInput->False]}, Dynamic[ + CurrentValue["MouseOver"]], + Alignment->Center, + FrameMargins->0, + ImageSize->{Automatic, {25, Full}}], + Appearance->None, + BaselinePosition->Baseline, + + ButtonFunction:>OutputSizeLimit`ButtonFunction[ + OutputSizeLimit`Defer, 1186, 33777537423254864718, 10 2], + Enabled->True, + Evaluator->Automatic, + Method->"Queued"], + ButtonBox[ + PaneSelectorBox[{False-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowAll"], + StandardForm], + ImageSizeCache->{41., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControl", + StripOnInput->False], True-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowAll"], + StandardForm]], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControlActive", + StripOnInput->False]}, Dynamic[ + CurrentValue["MouseOver"]], + Alignment->Center, + FrameMargins->0, + ImageSize->{Automatic, {25, Full}}], + Appearance->None, + BaselinePosition->Baseline, + + ButtonFunction:>OutputSizeLimit`ButtonFunction[ + OutputSizeLimit`Defer, 1186, 33777537423254864718, Infinity], + Enabled->True, + Evaluator->Automatic, + Method->"Queued"], + ButtonBox[ + PaneSelectorBox[{False-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeChangeLimit"], + StandardForm], + ImageSizeCache->{76., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControl", + StripOnInput->False], True-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeChangeLimit"], + StandardForm], + ImageSizeCache->{76., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControlActive", + StripOnInput->False]}, Dynamic[ + CurrentValue["MouseOver"]], + Alignment->Center, + FrameMargins->0, + ImageSize->{Automatic, {25, Full}}], + Appearance->None, + BaselinePosition->Baseline, + ButtonFunction:>FrontEndExecute[{ + FrontEnd`SetOptions[ + FrontEnd`$FrontEnd, + FrontEnd`PreferencesSettings -> {"Page" -> "Advanced"}], + FrontEnd`FrontEndToken["PreferencesDialog"]}], + Evaluator->None, + Method->"Preemptive"]} + }, + AutoDelete->False, + FrameStyle->GrayLevel[0.85], + GridBoxDividers->{"Columns" -> {False, {True}}}, + GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, + GridBoxSpacings->{"Columns" -> {{2}}}]} + }, + DefaultBaseStyle->"Column", + GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, + GridBoxDividers->{"Columns" -> {{False}}, "Rows" -> {{False}}}, + GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{1.}}}, + GridBoxSpacings->{"Columns" -> { + Offset[0.27999999999999997`], { + Offset[0.5599999999999999]}, + Offset[0.27999999999999997`]}, "Rows" -> { + Offset[0.2], + Offset[1.2], { + Offset[0.4]}, + Offset[0.2]}}], + BaseStyle->"OutputSizeLimit", + FrameMargins->{{12, 12}, {0, 15}}, + FrameStyle->GrayLevel[0.85], + RoundingRadius->5, + StripOnInput->False], + Deploy, + DefaultBaseStyle->"Deploy"], + If[33777537423254864718 === $SessionID, + Out[1186], Message[ + MessageName[Syntax, "noinfoker"]]; Missing["NotAvailable"]; + Null]]], "Output", + CellChangeTimes->{ + 3.8172854543332233`*^9, {3.8172854891473827`*^9, 3.817285495711211*^9}, { + 3.8172901636218853`*^9, 3.817290183026518*^9}}, + CellLabel-> + "Out[1186]=",ExpressionUUID->"62f936fc-cb17-4761-8af3-6aa1484e4439"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + RowBox[{"a7", "\[Equal]", "0"}], ",", + RowBox[{"v7", "\[Equal]", "vf"}], ",", + RowBox[{"p7", "\[Equal]", "pf"}], ",", + RowBox[{"a3", "\[Equal]", "0"}], ",", + RowBox[{"t2", "\[Equal]", "0"}], ",", + RowBox[{"t6", "\[Equal]", "0"}], ",", + RowBox[{"v3", "\[Equal]", "vPlat"}], ",", + RowBox[{"tAll", "\[Equal]", "tf"}]}], "}"}], ",", + RowBox[{"{", + RowBox[{ + "t1", ",", "t2", ",", "t3", ",", "t4", ",", "t5", ",", "t6", ",", "t7", + ",", "vPlat"}], "}"}]}], "]"}]], "Input", + CellChangeTimes->{{3.817290206575521*^9, 3.817290228477895*^9}, { + 3.817290267309166*^9, 3.817290292319786*^9}, {3.817290352069686*^9, + 3.817290357255505*^9}}, + CellLabel-> + "In[1191]:=",ExpressionUUID->"c7301810-c3e4-4f58-ac24-e3a7212be788"], + +Cell[BoxData[ + InterpretationBox[ + TagBox[ + FrameBox[GridBox[{ + { + ItemBox[ + TagBox[ + RowBox[{"{", + TemplateBox[{"1"}, + "OutputSizeLimit`Skeleton"], "}"}], + Short[#, 5]& ], + BaseStyle->{Deployed -> False}, + StripOnInput->False]}, + {GridBox[{ + { + PaneBox[ + TagBox[ + TooltipBox[ + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource[ + "FEStrings", "sizeBriefExplanation"], StandardForm], + ImageSizeCache->{56., {2., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLText", + StripOnInput->False], + StyleBox[ + DynamicBox[ + ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeExplanation"], + StandardForm]], DynamicUpdating -> True, LineIndent -> 0, + LinebreakAdjustments -> {1., 100, 0, 0, 0}, + LineSpacing -> {1, 2}, StripOnInput -> False]], + Annotation[#, + Style[ + Dynamic[ + FEPrivate`FrontEndResource["FEStrings", "sizeExplanation"]], + DynamicUpdating -> True, LineIndent -> 0, + LinebreakAdjustments -> {1., 100, 0, 0, 0}, + LineSpacing -> {1, 2}], "Tooltip"]& ], + Alignment->Center, + BaselinePosition->Baseline, + ImageSize->{Automatic, {25, Full}}], + ButtonBox[ + PaneSelectorBox[{False-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowLess"], + StandardForm], + ImageSizeCache->{49., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControl", + StripOnInput->False], True-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowLess"], + StandardForm], + ImageSizeCache->{49., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControlActive", + StripOnInput->False]}, Dynamic[ + CurrentValue["MouseOver"]], + Alignment->Center, + FrameMargins->0, + ImageSize->{Automatic, {25, Full}}], + Appearance->None, + BaselinePosition->Baseline, + + ButtonFunction:>OutputSizeLimit`ButtonFunction[ + OutputSizeLimit`Defer, 1191, 33777537423254864718, 5/2], + Enabled->True, + Evaluator->Automatic, + Method->"Queued"], + ButtonBox[ + PaneSelectorBox[{False-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowMore"], + StandardForm], + ImageSizeCache->{55., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControl", + StripOnInput->False], True-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowMore"], + StandardForm], + ImageSizeCache->{55., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControlActive", + StripOnInput->False]}, Dynamic[ + CurrentValue["MouseOver"]], + Alignment->Center, + FrameMargins->0, + ImageSize->{Automatic, {25, Full}}], + Appearance->None, + BaselinePosition->Baseline, + + ButtonFunction:>OutputSizeLimit`ButtonFunction[ + OutputSizeLimit`Defer, 1191, 33777537423254864718, 5 2], + Enabled->True, + Evaluator->Automatic, + Method->"Queued"], + ButtonBox[ + PaneSelectorBox[{False-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowAll"], + StandardForm], + ImageSizeCache->{41., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControl", + StripOnInput->False], True-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeShowAll"], + StandardForm]], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControlActive", + StripOnInput->False]}, Dynamic[ + CurrentValue["MouseOver"]], + Alignment->Center, + FrameMargins->0, + ImageSize->{Automatic, {25, Full}}], + Appearance->None, + BaselinePosition->Baseline, + + ButtonFunction:>OutputSizeLimit`ButtonFunction[ + OutputSizeLimit`Defer, 1191, 33777537423254864718, Infinity], + Enabled->True, + Evaluator->Automatic, + Method->"Queued"], + ButtonBox[ + PaneSelectorBox[{False-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeChangeLimit"], + StandardForm], + ImageSizeCache->{76., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControl", + StripOnInput->False], True-> + StyleBox[ + StyleBox[ + DynamicBox[ToBoxes[ + FEPrivate`FrontEndResource["FEStrings", "sizeChangeLimit"], + StandardForm], + ImageSizeCache->{76., {0., 7.}}], + StripOnInput->False, + DynamicUpdating->True, + LineSpacing->{1, 2}, + LineIndent->0, + LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControlActive", + StripOnInput->False]}, Dynamic[ + CurrentValue["MouseOver"]], + Alignment->Center, + FrameMargins->0, + ImageSize->{Automatic, {25, Full}}], + Appearance->None, + BaselinePosition->Baseline, + ButtonFunction:>FrontEndExecute[{ + FrontEnd`SetOptions[ + FrontEnd`$FrontEnd, + FrontEnd`PreferencesSettings -> {"Page" -> "Advanced"}], + FrontEnd`FrontEndToken["PreferencesDialog"]}], + Evaluator->None, + Method->"Preemptive"]} + }, + AutoDelete->False, + FrameStyle->GrayLevel[0.85], + GridBoxDividers->{"Columns" -> {False, {True}}}, + GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, + GridBoxSpacings->{"Columns" -> {{2}}}]} + }, + DefaultBaseStyle->"Column", + GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, + GridBoxDividers->{"Columns" -> {{False}}, "Rows" -> {{False}}}, + GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{1.}}}, + GridBoxSpacings->{"Columns" -> { + Offset[0.27999999999999997`], { + Offset[0.5599999999999999]}, + Offset[0.27999999999999997`]}, "Rows" -> { + Offset[0.2], + Offset[1.2], { + Offset[0.4]}, + Offset[0.2]}}], + BaseStyle->"OutputSizeLimit", + FrameMargins->{{12, 12}, {0, 15}}, + FrameStyle->GrayLevel[0.85], + RoundingRadius->5, + StripOnInput->False], + Deploy, + DefaultBaseStyle->"Deploy"], + If[33777537423254864718 === $SessionID, + Out[1191], Message[ + MessageName[Syntax, "noinfoker"]]; Missing["NotAvailable"]; + Null]]], "Output", + CellChangeTimes->{{3.8172902147198057`*^9, 3.817290234260724*^9}, { + 3.817290279169634*^9, 3.817290292855104*^9}, 3.817290360040864*^9}, + CellLabel-> + "Out[1191]=",ExpressionUUID->"6c94b5e9-f573-4b5c-ab43-64030d4820d3"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{"Simplify", "[", + RowBox[{ + RowBox[{"v7", "/.", + RowBox[{"{", + RowBox[{ + RowBox[{"t2", "\[Rule]", "0"}], ",", + RowBox[{"t6", "\[Rule]", "0"}], ",", + RowBox[{"a3", "\[Rule]", "0"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{ + RowBox[{"t1", "\[Rule]", "tz"}], ",", + RowBox[{"t3", "\[Rule]", + RowBox[{ + FractionBox["a0", "jMax"], "+", "tz"}]}], ",", + RowBox[{"t7", "\[Rule]", "t5"}], ",", + RowBox[{"t5", "\[Rule]", + SqrtBox[ + FractionBox[ + RowBox[{"vPlat", "-", "vf"}], "jMax"]]}], ",", + RowBox[{"vPlat", "\[Rule]", + RowBox[{ + FractionBox[ + SuperscriptBox["a0", "2"], + RowBox[{"2", "jMax"}]], "+", + RowBox[{"2", "a0", " ", "tz"}], "+", + RowBox[{"jMax", " ", + SuperscriptBox["tz", "2"]}], "+", "v0"}]}]}], "}"}]}], "]"}]], "Input",\ + + CellChangeTimes->{{3.817290560671061*^9, 3.817290709981179*^9}}, + CellLabel-> + "In[1203]:=",ExpressionUUID->"56ebba05-01d5-4a2c-ad4f-ad659d1cf0dd"], + +Cell[BoxData["vf"], "Output", + CellChangeTimes->{{3.8172905614800863`*^9, 3.817290610581071*^9}, { + 3.8172906462676277`*^9, 3.817290710756241*^9}}, + CellLabel-> + "Out[1203]=",ExpressionUUID->"d4571f25-fe10-417c-9f57-ca49055dad88"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{"as", "=", + RowBox[{"Simplify", "[", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"p7", "/.", + RowBox[{"{", + RowBox[{ + RowBox[{"t2", "\[Rule]", "0"}], ",", + RowBox[{"t6", "\[Rule]", "0"}], ",", + RowBox[{"a3", "\[Rule]", "0"}]}], "}"}]}], "//.", + RowBox[{"{", + RowBox[{ + RowBox[{"t1", "\[Rule]", "tz"}], ",", + RowBox[{"t3", "\[Rule]", + RowBox[{ + FractionBox["a0", "jMax"], "+", "tz"}]}], ",", + RowBox[{"t7", "\[Rule]", "t5"}], ",", + RowBox[{"t5", "\[Rule]", + SqrtBox[ + FractionBox[ + RowBox[{"vPlat", "-", "vf"}], "jMax"]]}], ",", + RowBox[{"vPlat", "\[Rule]", + RowBox[{ + FractionBox[ + SuperscriptBox["a0", "2"], + RowBox[{"2", "jMax"}]], "+", + RowBox[{"2", "a0", " ", "tz"}], "+", + RowBox[{"jMax", " ", + SuperscriptBox["tz", "2"]}], "+", "v0"}]}]}], "}"}]}], ")"}], + "\[Equal]", "pf"}], ",", "t4"}], "]"}], "]"}]}]], "Input", + CellChangeTimes->{{3.817290717066217*^9, 3.8172907172686167`*^9}, { + 3.817290764255752*^9, 3.817290806725108*^9}}, + CellLabel-> + "In[1207]:=",ExpressionUUID->"56b6fc79-62d0-42c2-87cc-f794cbcb5cdd"], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{"{", + RowBox[{"t4", "\[Rule]", + RowBox[{"-", + RowBox[{"(", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"4", " ", + SuperscriptBox["a0", "3"]}], "+", + RowBox[{"12", " ", "a0", " ", "jMax", " ", + RowBox[{"(", + RowBox[{"v0", "+", + RowBox[{"jMax", " ", "tz", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"3", " ", "tz"}], "+", + RowBox[{ + SqrtBox["2"], " ", + SqrtBox[ + FractionBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "+", + RowBox[{"4", " ", "a0", " ", "jMax", " ", "tz"}], "+", + RowBox[{"2", " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"jMax", " ", + SuperscriptBox["tz", "2"]}], "+", "v0", "-", "vf"}], + ")"}]}]}], + SuperscriptBox["jMax", "2"]]]}]}], ")"}]}]}], ")"}]}], "+", + + RowBox[{"3", " ", + SuperscriptBox["a0", "2"], " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"8", " ", "tz"}], "+", + RowBox[{ + SqrtBox["2"], " ", + SqrtBox[ + FractionBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "+", + RowBox[{"4", " ", "a0", " ", "jMax", " ", "tz"}], "+", + RowBox[{"2", " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"jMax", " ", + SuperscriptBox["tz", "2"]}], "+", "v0", "-", "vf"}], + ")"}]}]}], + SuperscriptBox["jMax", "2"]]]}]}], ")"}]}], "+", + RowBox[{"6", " ", + SuperscriptBox["jMax", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "p0"}], "-", + RowBox[{"2", " ", "pf"}], "+", + RowBox[{"2", " ", "jMax", " ", + SuperscriptBox["tz", "3"]}], "+", + RowBox[{"4", " ", "tz", " ", "v0"}], "+", + RowBox[{ + SqrtBox["2"], " ", "jMax", " ", + SuperscriptBox["tz", "2"], " ", + SqrtBox[ + FractionBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "+", + RowBox[{"4", " ", "a0", " ", "jMax", " ", "tz"}], "+", + RowBox[{"2", " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"jMax", " ", + SuperscriptBox["tz", "2"]}], "+", "v0", "-", "vf"}], + ")"}]}]}], + SuperscriptBox["jMax", "2"]]]}], "+", + RowBox[{ + SqrtBox["2"], " ", "v0", " ", + SqrtBox[ + FractionBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "+", + RowBox[{"4", " ", "a0", " ", "jMax", " ", "tz"}], "+", + RowBox[{"2", " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"jMax", " ", + SuperscriptBox["tz", "2"]}], "+", "v0", "-", "vf"}], + ")"}]}]}], + SuperscriptBox["jMax", "2"]]]}], "+", + RowBox[{ + SqrtBox["2"], " ", + SqrtBox[ + FractionBox[ + RowBox[{ + SuperscriptBox["a0", "2"], "+", + RowBox[{"4", " ", "a0", " ", "jMax", " ", "tz"}], "+", + RowBox[{"2", " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"jMax", " ", + SuperscriptBox["tz", "2"]}], "+", "v0", "-", "vf"}], + ")"}]}]}], + SuperscriptBox["jMax", "2"]]], " ", "vf"}]}], ")"}]}]}], ")"}], + "/", + RowBox[{"(", + RowBox[{"6", " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox["a0", "2"], "+", + RowBox[{"4", " ", "a0", " ", "jMax", " ", "tz"}], "+", + RowBox[{"2", " ", "jMax", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"jMax", " ", + SuperscriptBox["tz", "2"]}], "+", "v0"}], ")"}]}]}], ")"}]}], + ")"}]}], ")"}]}]}], "}"}], "}"}]], "Output", + CellChangeTimes->{ + 3.817290719038806*^9, {3.8172907755228233`*^9, 3.8172908080980453`*^9}}, + CellLabel-> + "Out[1207]=",ExpressionUUID->"c92984f1-3112-488a-a1aa-56f4020cc38b"] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"ToString", "[", + RowBox[{ + RowBox[{"as", "[", + RowBox[{"[", + RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}], ",", "CForm"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input", + CellChangeTimes->{{3.817290810785329*^9, 3.8172908291171417`*^9}}, + CellLabel-> + "In[1211]:=",ExpressionUUID->"c5f79d04-b5a4-48f4-b333-f5ac44447a96"], + +Cell[BoxData["\<\"-(4*Power(a0,3) + 12*a0*jMax*(v0 + jMax*tz*(3*tz + \ +Sqrt(2)*Sqrt((Power(a0,2) + 4*a0*jMax*tz + 2*jMax*(jMax*Power(tz,2) + v0 - \ +vf))/Power(jMax,2)))) + 3*Power(a0,2)*jMax*(8*tz + Sqrt(2)*Sqrt((Power(a0,2) \ ++ 4*a0*jMax*tz + 2*jMax*(jMax*Power(tz,2) + v0 - vf))/Power(jMax,2))) + \ +6*Power(jMax,2)*(2*p0 - 2*pf + 2*jMax*Power(tz,3) + 4*tz*v0 + \ +Sqrt(2)*jMax*Power(tz,2)*Sqrt((Power(a0,2) + 4*a0*jMax*tz + \ +2*jMax*(jMax*Power(tz,2) + v0 - vf))/Power(jMax,2)) + \ +Sqrt(2)*v0*Sqrt((Power(a0,2) + 4*a0*jMax*tz + 2*jMax*(jMax*Power(tz,2) + v0 - \ +vf))/Power(jMax,2)) + Sqrt(2)*Sqrt((Power(a0,2) + 4*a0*jMax*tz + \ +2*jMax*(jMax*Power(tz,2) + v0 - \ +vf))/Power(jMax,2))*vf))/(6.*jMax*(Power(a0,2) + 4*a0*jMax*tz + \ +2*jMax*(jMax*Power(tz,2) + v0)))\"\>"], "Output", + CellChangeTimes->{{3.8172908129615107`*^9, 3.8172908295455503`*^9}}, + CellLabel-> + "Out[1211]=",ExpressionUUID->"b95d9d94-82ce-4419-a67f-dfa9e2ea0eac"] +}, Open ]] +}, +WindowSize->{772, 791}, +WindowMargins->{{Automatic, -140}, {-153, Automatic}}, +Magnification:>0.9 Inherited, +FrontEndVersion->"12.0 for Linux x86 (64-bit) (April 8, 2019)", +StyleDefinitions->"Default.nb" +] +(* End of Notebook Content *) + +(* Internal cache information *) +(*CellTagsOutline +CellTagsIndex->{} +*) +(*CellTagsIndex +CellTagsIndex->{} +*) +(*NotebookFileOutline +Notebook[{ +Cell[558, 20, 153, 3, 22, "title",ExpressionUUID->"6a564cc6-a23e-4a5a-8ee9-69267da34876"], +Cell[714, 25, 1085, 26, 118, "Input",ExpressionUUID->"bcd06c4f-cbaa-4b1b-a6b1-5c4ac4a41442"], +Cell[1802, 53, 623, 16, 52, "Input",ExpressionUUID->"5a5138b0-8941-429f-a081-6482a01195c5"], +Cell[2428, 71, 6633, 210, 854, "Input",ExpressionUUID->"9382707b-2876-460d-b0fb-ca70e05b1e9a"], +Cell[9064, 283, 12277, 326, 338, "Input",ExpressionUUID->"93a49805-7b39-4e71-a5ce-78f2b77ae9c0"], +Cell[21344, 611, 1913, 36, 29, "Input",ExpressionUUID->"5878fecc-824c-4d1e-9afc-06f4774e587c"], +Cell[CellGroupData[{ +Cell[23282, 651, 532, 12, 29, "Input",ExpressionUUID->"54246e45-b069-4bf6-aa74-c0e21c44f308"], +Cell[23817, 665, 408, 8, 47, "Output",ExpressionUUID->"1fc1b4b4-8e2b-4c6c-a9c8-9f361ba240af"] +}, Open ]], +Cell[24240, 676, 480, 7, 33, "Text",ExpressionUUID->"0616ae41-3a02-473a-878f-96412e2fc8c5"], +Cell[CellGroupData[{ +Cell[24745, 687, 874, 14, 52, "Input",ExpressionUUID->"f08feb2e-6079-473b-b866-92670dea0a56"], +Cell[25622, 703, 701, 9, 56, "Output",ExpressionUUID->"3c38abf0-85fb-4a6c-bb73-13647123db5a"] +}, Open ]], +Cell[26338, 715, 150, 3, 33, "Text",ExpressionUUID->"0a48f25a-db59-414e-a9d8-f836650cf87d"], +Cell[26491, 720, 5889, 168, 231, "Input",ExpressionUUID->"167a7b57-8177-4747-a9c0-9f4026ebbce4"], +Cell[CellGroupData[{ +Cell[32405, 892, 436, 11, 52, "Input",ExpressionUUID->"fe5cd889-d2ba-4d6c-a9e7-19ee388c29a9"], +Cell[32844, 905, 274, 4, 33, "Output",ExpressionUUID->"80f10292-ac56-43e3-89bb-4d010f19c0d7"] +}, Open ]], +Cell[CellGroupData[{ +Cell[33155, 914, 932, 23, 52, "Input",ExpressionUUID->"53e5952a-4fb5-4d63-8377-5a9caddfc267"], +Cell[34090, 939, 719, 10, 78, "Output",ExpressionUUID->"1d340d11-56a5-4b00-8e1b-1f9344aadb3f"] +}, Open ]], +Cell[34824, 952, 150, 3, 33, "Text",ExpressionUUID->"417bee0a-e71c-4074-951a-e0096c8c0197"], +Cell[34977, 957, 16104, 442, 593, "Input",ExpressionUUID->"3f1f8812-a017-42e0-b936-21036f34dc96"], +Cell[CellGroupData[{ +Cell[51106, 1403, 437, 11, 52, "Input",ExpressionUUID->"3f328cb6-a4a3-4ace-a469-e5facf0fa91d"], +Cell[51546, 1416, 327, 5, 33, "Output",ExpressionUUID->"6bca33c2-2d90-4bf0-b923-36fcadb51ccc"] +}, Open ]], +Cell[CellGroupData[{ +Cell[51910, 1426, 1217, 29, 52, "Input",ExpressionUUID->"1fececb1-454e-4c00-b1bc-a70612370596"], +Cell[53130, 1457, 440, 7, 33, "Output",ExpressionUUID->"5aff4def-f576-4ca5-89b7-f55e90bb6c72"] +}, Open ]], +Cell[53585, 1467, 150, 3, 33, "Text",ExpressionUUID->"d3a768d1-c0c4-4efe-8e80-ab5dbf747cd7"], +Cell[CellGroupData[{ +Cell[53760, 1474, 12615, 375, 649, "Input",ExpressionUUID->"974e8e10-d3f1-4e6a-a853-9fc5dad435e4"], +Cell[66378, 1851, 1570, 41, 58, "Output",ExpressionUUID->"fee03818-edb7-4c7e-adf9-6057b529fee0"] +}, Open ]], +Cell[CellGroupData[{ +Cell[67985, 1897, 535, 13, 52, "Input",ExpressionUUID->"74f7a769-943f-439a-b0fe-982782319c14"], +Cell[68523, 1912, 410, 7, 33, "Output",ExpressionUUID->"9824cb0f-3f12-4424-9d36-486c355fab98"] +}, Open ]], +Cell[CellGroupData[{ +Cell[68970, 1924, 986, 24, 52, "Input",ExpressionUUID->"d68ce2f0-b649-4203-8509-b3f21c8f28cb"], +Cell[69959, 1950, 617, 9, 56, "Output",ExpressionUUID->"fe413dc7-5e2a-4520-9d33-8f49c70c7b41"] +}, Open ]], +Cell[70591, 1962, 150, 3, 33, "Text",ExpressionUUID->"711a5ce3-235c-4dbf-9218-066b4eb46c49"], +Cell[70744, 1967, 9687, 305, 611, "Input",ExpressionUUID->"85a6097a-70b5-49a4-ae56-e8dd0a51a428"], +Cell[CellGroupData[{ +Cell[80456, 2276, 436, 11, 52, "Input",ExpressionUUID->"ff08bb2c-cbc7-4ff9-9446-25236262b0fb"], +Cell[80895, 2289, 330, 6, 33, "Output",ExpressionUUID->"d79ca432-17e6-4aa4-a418-147377e63ae1"] +}, Open ]], +Cell[CellGroupData[{ +Cell[81262, 2300, 981, 27, 52, "Input",ExpressionUUID->"88f65d51-d426-4c7d-aace-31506d46a598"], +Cell[82246, 2329, 268, 4, 33, "Output",ExpressionUUID->"84758f21-14e0-42f6-9b83-cb23c120b6bc"] +}, Open ]], +Cell[82529, 2336, 165, 3, 33, "Text",ExpressionUUID->"c11911ed-fd56-444f-962b-8af3f3a9b05a"], +Cell[82697, 2341, 766, 20, 29, "Input",ExpressionUUID->"340208a3-1996-4056-a70b-135cb5fa325f"], +Cell[83466, 2363, 790, 20, 29, "Input",ExpressionUUID->"b9fc4b80-b964-4452-bfa0-1bacfaa6b76f"], +Cell[84259, 2385, 150, 3, 33, "Text",ExpressionUUID->"99449829-c4bf-4429-bccb-5da052e184d9"], +Cell[84412, 2390, 15597, 417, 590, "Input",ExpressionUUID->"b9e54b84-cf4e-4e09-ab7a-a99715a91325"], +Cell[100012, 2809, 334, 8, 29, "Input",ExpressionUUID->"98d6e25b-fc2d-4463-90d0-1a15fbf23a75"], +Cell[CellGroupData[{ +Cell[100371, 2821, 1184, 27, 74, "Input",ExpressionUUID->"62b88e2e-78df-4751-b6b7-001704723f20"], +Cell[101558, 2850, 761, 11, 56, "Output",ExpressionUUID->"b40240b0-47e7-4e6d-945b-939c5a3558fa"] +}, Open ]], +Cell[CellGroupData[{ +Cell[102356, 2866, 1034, 23, 52, "Input",ExpressionUUID->"158b4300-bfb7-4b5a-8159-758d681ae08d"], +Cell[103393, 2891, 2497, 37, 254, "Output",ExpressionUUID->"e20a6e42-4ef8-4047-8d1b-5377fe92d967"] +}, Open ]], +Cell[CellGroupData[{ +Cell[105927, 2933, 494, 13, 48, "Input",ExpressionUUID->"31e513cf-3262-402d-bad9-4c6b077f7a18"], +Cell[106424, 2948, 6123, 159, 138, "Output",ExpressionUUID->"927ca1f4-b1f2-46e9-b22f-370a4803207d"] +}, Open ]], +Cell[CellGroupData[{ +Cell[112584, 3112, 1528, 34, 96, "Input",ExpressionUUID->"7bde4fb2-842b-410a-bcc1-362bed2a8caf"], +Cell[114115, 3148, 1125, 16, 56, "Output",ExpressionUUID->"3dcc9912-a43b-4174-a19c-4775a4e8e819"] +}, Open ]], +Cell[CellGroupData[{ +Cell[115277, 3169, 287, 7, 29, "Input",ExpressionUUID->"973ea747-5737-4d06-a9d9-d99114c416a1"], +Cell[115567, 3178, 644, 13, 33, "Output",ExpressionUUID->"aff4b1ef-e052-492e-b19c-e52d78aa043d"] +}, Open ]], +Cell[116226, 3194, 565, 15, 29, "Input",ExpressionUUID->"c0000ea9-c6f6-47f9-bc66-7c8a7a154c7c"], +Cell[CellGroupData[{ +Cell[116816, 3213, 718, 17, 34, InheritFromParent,ExpressionUUID->"5e9a3dfa-4e2c-4030-9e6a-c6b17de55888"], +Cell[117537, 3232, 440, 12, 33, "Output",ExpressionUUID->"9c1863ed-ca66-49ec-b569-563d55abc9bf"] +}, Open ]], +Cell[CellGroupData[{ +Cell[118014, 3249, 314, 8, 29, "Input",ExpressionUUID->"546f9925-4556-44e7-a8c2-3230b1c55c46"], +Cell[118331, 3259, 172, 3, 33, "Output",ExpressionUUID->"12b12744-6305-4c68-84a5-82edaa46c7e0"] +}, Open ]], +Cell[CellGroupData[{ +Cell[118540, 3267, 746, 18, 29, "Input",ExpressionUUID->"42f07270-0ef7-4b55-8337-dcbacdfb6ce2"], +Cell[119289, 3287, 12578, 326, 249, "Output",ExpressionUUID->"792f3906-7b60-408f-8afa-50ad83f27f0e"] +}, Open ]], +Cell[CellGroupData[{ +Cell[131904, 3618, 1210, 34, 61, "Input",ExpressionUUID->"2cd0eb76-7df1-4664-970a-ff086120e648"], +Cell[133117, 3654, 32245, 787, 603, "Output",ExpressionUUID->"42f43c8d-3e50-48eb-bc53-4f756722bfea"] +}, Open ]], +Cell[CellGroupData[{ +Cell[165399, 4446, 292, 6, 29, "Input",ExpressionUUID->"05e2a80e-52d7-418e-a037-d9b9f1bb531c"], +Cell[165694, 4454, 3882, 57, 408, "Output",ExpressionUUID->"3632a081-b586-4363-9583-6c7129578d0e"] +}, Open ]], +Cell[169591, 4514, 182, 3, 29, "Input",ExpressionUUID->"d6432a14-ddff-46ef-8f9b-62f0f6200cd0"], +Cell[169776, 4519, 32220, 787, 1517, InheritFromParent,ExpressionUUID->"466c0d61-adb3-4dc1-952d-241af8bf9d33"], +Cell[CellGroupData[{ +Cell[202021, 5310, 322, 8, 29, "Input",ExpressionUUID->"0215e8fc-7402-4781-b0e4-16b977a2d5d3"], +Cell[202346, 5320, 899, 23, 35, "Output",ExpressionUUID->"e95a6718-f2eb-44e6-90df-b7ac8c4207c7"] +}, Open ]], +Cell[CellGroupData[{ +Cell[203282, 5348, 707, 17, 29, "Input",ExpressionUUID->"5464c1ac-5775-49e3-95bc-2e3e0252d6c0"], +Cell[203992, 5367, 12913, 327, 583, "Output",ExpressionUUID->"b72c266f-a7f8-4687-9d93-b9c9367fda96"] +}, Open ]], +Cell[CellGroupData[{ +Cell[216942, 5699, 1169, 25, 52, "Input",ExpressionUUID->"ef2eadde-82ba-41d3-9a0b-d30fc7d7a204"], +Cell[218114, 5726, 391, 7, 66, "Output",ExpressionUUID->"dfe8e946-3c69-4840-8c7e-bd40f759ef5f"] +}, Open ]], +Cell[218520, 5736, 160, 3, 33, "Text",ExpressionUUID->"5c00d19c-efbb-475f-a4a4-adc1877059e7"], +Cell[218683, 5741, 5502, 128, 316, "Input",ExpressionUUID->"013ba19d-162c-4e14-9e6b-43bcf125ceef"], +Cell[224188, 5871, 531, 9, 56, "Text",ExpressionUUID->"ccf44efd-e09a-4bbb-a696-b4c90f7a95eb"], +Cell[CellGroupData[{ +Cell[224744, 5884, 948, 18, 52, "Input",ExpressionUUID->"b4fd3303-7c30-4af8-94b1-4505577eaf40"], +Cell[225695, 5904, 636, 10, 33, "Output",ExpressionUUID->"3c247a78-5f1f-4bfe-aeb8-c0def9d99fe4"] +}, Open ]], +Cell[226346, 5917, 182, 3, 33, "Text",ExpressionUUID->"6e1bb727-a1dc-4c24-af7f-abfa0f3b9409"], +Cell[CellGroupData[{ +Cell[226553, 5924, 952, 24, 74, "Input",ExpressionUUID->"c24549d5-e55a-4ad4-a91d-4e532e8d2688"], +Cell[227508, 5950, 781, 12, 166, "Output",ExpressionUUID->"8a1b58c3-1441-4fe3-bbe7-d56171dd7cae"] +}, Open ]], +Cell[CellGroupData[{ +Cell[228326, 5967, 747, 19, 52, "Input",ExpressionUUID->"27add3ed-17eb-49e9-9b82-a98025fa047d"], +Cell[229076, 5988, 1254, 19, 298, "Output",ExpressionUUID->"9edd45ed-0ce4-41cc-9909-2527fddc394d"] +}, Open ]], +Cell[CellGroupData[{ +Cell[230367, 6012, 1080, 24, 52, "Input",ExpressionUUID->"76ceed0f-1818-4f48-ae21-f8daf9cd0832"], +Cell[231450, 6038, 17876, 415, 505, "Output",ExpressionUUID->"46a43cc4-d030-4bab-8cd7-2a1f9e8641fc"] +}, Open ]], +Cell[CellGroupData[{ +Cell[249363, 6458, 380, 7, 29, "Input",ExpressionUUID->"b4557152-17d6-464a-a9f3-17efadbdba9c"], +Cell[249746, 6467, 17713, 411, 477, "Output",ExpressionUUID->"c0df61e4-93ae-49db-8a65-19a2a6e672cc"] +}, Open ]], +Cell[CellGroupData[{ +Cell[267496, 6883, 802, 20, 52, "Input",ExpressionUUID->"a28fc3ef-309c-4020-8e87-7ea695c7f0f2"], +Cell[268301, 6905, 15676, 374, 441, "Output",ExpressionUUID->"62f936fc-cb17-4761-8af3-6aa1484e4439"] +}, Open ]], +Cell[CellGroupData[{ +Cell[284014, 7284, 850, 21, 52, "Input",ExpressionUUID->"c7301810-c3e4-4f58-ac24-e3a7212be788"], +Cell[284867, 7307, 8972, 232, 91, "Output",ExpressionUUID->"6c94b5e9-f573-4b5c-ab43-64030d4820d3"] +}, Open ]], +Cell[CellGroupData[{ +Cell[293876, 7544, 1042, 31, 150, "Input",ExpressionUUID->"56ebba05-01d5-4a2c-ad4f-ad659d1cf0dd"], +Cell[294921, 7577, 232, 4, 33, "Output",ExpressionUUID->"d4571f25-fe10-417c-9f57-ca49055dad88"] +}, Open ]], +Cell[CellGroupData[{ +Cell[295190, 7586, 1372, 37, 217, "Input",ExpressionUUID->"56b6fc79-62d0-42c2-87cc-f794cbcb5cdd"], +Cell[296565, 7625, 4613, 120, 559, "Output",ExpressionUUID->"c92984f1-3112-488a-a1aa-56f4020cc38b"] +}, Open ]], +Cell[CellGroupData[{ +Cell[301215, 7750, 405, 10, 52, "Input",ExpressionUUID->"c5f79d04-b5a4-48f4-b333-f5ac44447a96"], +Cell[301623, 7762, 933, 14, 265, "Output",ExpressionUUID->"b95d9d94-82ce-4419-a67f-dfa9e2ea0eac"] +}, Open ]] +} +] +*) + diff --git a/src/python.cpp b/src/python.cpp new file mode 100644 index 00000000..3cc4ee17 --- /dev/null +++ b/src/python.cpp @@ -0,0 +1,83 @@ +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#ifdef WITH_REFLEXXES + #include +#endif + + +namespace py = pybind11; +using namespace pybind11::literals; // to bring in the `_a` literal +using namespace ruckig; + + +PYBIND11_MODULE(_ruckig, m) { + m.doc() = "Online Trajectory Generation"; + + constexpr size_t DOFs {1}; + + py::class_>(m, "InputParameter") + .def(py::init<>()) + .def_readonly_static("degrees_of_freedom", &InputParameter::degrees_of_freedom) + .def_readwrite("current_position", &InputParameter::current_position) + .def_readwrite("current_velocity", &InputParameter::current_velocity) + .def_readwrite("current_acceleration", &InputParameter::current_acceleration) + .def_readwrite("target_position", &InputParameter::target_position) + .def_readwrite("target_velocity", &InputParameter::target_velocity) + .def_readwrite("target_acceleration", &InputParameter::target_acceleration) + .def_readwrite("max_velocity", &InputParameter::max_velocity) + .def_readwrite("max_acceleration", &InputParameter::max_acceleration) + .def_readwrite("max_jerk", &InputParameter::max_jerk) + .def_readwrite("minimum_duration", &InputParameter::minimum_duration); + + py::class_>(m, "OutputParameter") + .def(py::init<>()) + .def_readwrite("new_position", &OutputParameter::new_position) + .def_readwrite("new_velocity", &OutputParameter::new_velocity) + .def_readwrite("new_acceleration", &OutputParameter::new_acceleration) + .def_readwrite("duration", &OutputParameter::duration) + .def_readwrite("new_calculation", &OutputParameter::new_calculation) + .def_readwrite("calculation_duration", &OutputParameter::calculation_duration) + .def("__copy__", [](const OutputParameter &self) { + return OutputParameter(self); + }); + + py::enum_(m, "Result") + .value("Working", Result::Working) + .value("Finished", Result::Finished) + .value("Error", Result::Error) + .export_values(); + + py::class_>(m, "Quintic") + .def(py::init(), "delta_time"_a) + .def_readonly("delta_time", &Quintic::delta_time) + .def("update", &Quintic::update); + + py::class_>(m, "Smoothie") + .def(py::init(), "delta_time"_a) + .def_readonly("delta_time", &Smoothie::delta_time) + .def("update", &Smoothie::update); + + py::class_>(m, "Ruckig") + .def(py::init(), "delta_time"_a) + .def_readonly("delta_time", &Ruckig::delta_time) + .def("update", &Ruckig::update) + .def("at_time", &Ruckig::atTime); + +#ifdef WITH_REFLEXXES + py::class_>(m, "Reflexxes") + .def(py::init(), "delta_time"_a) + .def_readonly("delta_time", &Reflexxes::delta_time) + .def("update", &Reflexxes::update) + .def("at_time", &Reflexxes::atTime); +#endif +} diff --git a/src/ruckig.cpp b/src/ruckig.cpp new file mode 100644 index 00000000..798a9956 --- /dev/null +++ b/src/ruckig.cpp @@ -0,0 +1,1546 @@ +#include +#include + +#include +#include +#include + + +namespace ruckig { + +void Profile::set(double p0, double v0, double a0, const std::array& j) { + this->j = j; + t_sum[0] = t[0]; + a[0] = a0; + v[0] = v0; + p[0] = p0; + + for (size_t i = 0; i < 6; i += 1) { + t_sum[i+1] = t_sum[i] + t[i+1]; + } + for (size_t i = 0; i < 7; i += 1) { + a[i+1] = a[i] + t[i] * j[i]; + v[i+1] = v[i] + t[i] * a[i] + std::pow(t[i], 2) * j[i] / 2; + p[i+1] = p[i] + t[i] * v[i] + std::pow(t[i], 2) * a[i] / 2 + std::pow(t[i], 3) * j[i] / 6; + } +} + +bool Profile::check(double pf, double vf, double vMax, double aMax) const { + // Velocity and acceleration limits can be broken in the beginnging if the initial velocity and acceleration are too high + // std::cout << std::setprecision(15) << "target: " << std::abs(p[7]-pf) << " " << std::abs(v[7] - vf) << std::endl; + return std::all_of(t.begin(), t.end(), [](double tm){ return tm >= 0; }) + && std::all_of(v.begin() + 3, v.end(), [vMax](double vm){ return std::abs(vm) < std::abs(vMax) + 1e-9; }) + && std::all_of(a.begin() + 2, a.end(), [aMax](double am){ return std::abs(am) < std::abs(aMax) + 1e-9; }) + && std::abs(p[7] - pf) < 2e-7 && std::abs(v[7] - vf) < 2e-7; +} + +std::tuple Profile::integrate(double t, double p0, double v0, double a0, double j) { + const double p_new = p0 + t * (v0 + t * (a0 / 2 + t * j / 6)); + const double v_new = v0 + t * (a0 + t * j / 2); + const double a_new = a0 + t * j; + return {p_new, v_new, a_new}; +} + +bool RuckigStep1::time_up_acc0_acc1_vel(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + profile.t[0] = (-a0 + aMax)/jMax; + profile.t[1] = (Power(a0,2) - 2*Power(aMax,2) - 2*jMax*v0 + 2*jMax*vMax)/(2*aMax*jMax); + profile.t[2] = aMax/jMax; + profile.t[3] = (3*Power(a0,4) - 8*Power(a0,3)*aMax + 24*a0*aMax*jMax*v0 + 6*Power(a0,2)*(Power(aMax,2) - 2*jMax*v0) - 12*jMax*(2*aMax*jMax*(p0 - pf) + Power(aMax,2)*(v0 + vf + 2*vMax) - jMax*(Power(v0,2) + Power(vf,2) - 2*Power(vMax,2))))/(24.*aMax*Power(jMax,2)*vMax); + profile.t[4] = profile.t[2]; + profile.t[5] = -aMax/jMax + (vMax-vf)/aMax; + profile.t[6] = profile.t[2]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + return profile.check(pf, vf, vMax, aMax); +} + +bool RuckigStep2::time_up_acc0_acc1_vel(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + // Profile UDDU + { + profile.t[0] = (-a0 + aMax)/jMax; + profile.t[1] = (3*aMax*jMax*(Power(a0,2) + 2*a0*aMax - 6*Power(aMax,2) + 2*aMax*jMax*tf + 2*jMax*(-v0 + vf)) - Sqrt(3)*Sqrt(Power(aMax,2)*(-3*Power(a0,4) + 4*Power(a0,3)*aMax + 12*Power(a0,2)*(Power(aMax,2) - aMax*jMax*tf + jMax*(v0 - vf)) - 24*a0*aMax*(Power(aMax,2) - aMax*jMax*tf + jMax*(v0 - vf)) + 12*(Power(aMax,4) - 2*Power(aMax,3)*jMax*tf + Power(aMax,2)*Power(jMax,2)*Power(tf,2) - Power(jMax,2)*Power(v0 - vf,2) + 2*aMax*Power(jMax,2)*(2*p0 - 2*pf + tf*(v0 + vf)))))*Abs(jMax))/(12.*Power(aMax,2)*Power(jMax,2)); + profile.t[2] = aMax/jMax; + profile.t[3] = (-6*Power(aMax,3)*jMax + Sqrt(3)*Sqrt(Power(aMax,2)*(-3*Power(a0,4) + 4*Power(a0,3)*aMax + 12*Power(a0,2)*(Power(aMax,2) - aMax*jMax*tf + jMax*(v0 - vf)) - 24*a0*aMax*(Power(aMax,2) - aMax*jMax*tf + jMax*(v0 - vf)) + 12*(Power(aMax,4) - 2*Power(aMax,3)*jMax*tf + Power(aMax,2)*Power(jMax,2)*Power(tf,2) - Power(jMax,2)*Power(v0 - vf,2) + 2*aMax*Power(jMax,2)*(2*p0 - 2*pf + tf*(v0 + vf)))))*Abs(jMax))/(6.*Power(aMax,2)*Power(jMax,2)); + profile.t[4] = profile.t[2]; + profile.t[5] = -(3*aMax*jMax*(Power(a0,2) - 2*a0*aMax + 6*Power(aMax,2) - 2*aMax*jMax*tf + 2*jMax*(-v0 + vf)) + Sqrt(3)*Sqrt(Power(aMax,2)*(-3*Power(a0,4) + 4*Power(a0,3)*aMax + 12*Power(a0,2)*(Power(aMax,2) - aMax*jMax*tf + jMax*(v0 - vf)) - 24*a0*aMax*(Power(aMax,2) - aMax*jMax*tf + jMax*(v0 - vf)) + 12*(Power(aMax,4) - 2*Power(aMax,3)*jMax*tf + Power(aMax,2)*Power(jMax,2)*Power(tf,2) - Power(jMax,2)*Power(v0 - vf,2) + 2*aMax*Power(jMax,2)*(2*p0 - 2*pf + tf*(v0 + vf)))))*Abs(jMax))/(12.*Power(aMax,2)*Power(jMax,2)); + profile.t[6] = profile.t[2]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + + // Profile UDUD + { + profile.t[0] = (-a0 + aMax)/jMax; + profile.t[1] = (3*Power(a0,4) - 4*Power(a0,3)*aMax + 24*a0*Power(aMax,3) - 6*Power(a0,2)*(Power(aMax,2) + 2*aMax*jMax*tf + 2*jMax*(v0 - vf)) - 12*(2*Power(aMax,4) - 2*Power(aMax,3)*jMax*tf - 2*aMax*Power(jMax,2)*(p0 - pf + tf*v0) - Power(jMax,2)*Power(v0 - vf,2) + Power(aMax,2)*jMax*(-v0 + vf)))/(12.*aMax*jMax*(Power(a0,2) - 2*a0*aMax + 2*(Power(aMax,2) - aMax*jMax*tf + jMax*(-v0 + vf)))); + profile.t[2] = aMax/jMax; + profile.t[3] = -(Power(a0,2) - 2*a0*aMax + 4*Power(aMax,2) - 2*aMax*jMax*tf - 2*jMax*v0 + 2*jMax*vf)/(2.*aMax*jMax); + profile.t[4] = profile.t[2]; + profile.t[5] = (3*Power(a0,4) - 8*Power(a0,3)*aMax - 6*Power(a0,2)*(Power(aMax,2) + 2*jMax*(v0 - vf)) + 24*a0*(Power(aMax,3) + aMax*jMax*(v0 - vf)) - 12*(2*Power(aMax,4) - 2*Power(aMax,3)*jMax*tf - Power(jMax,2)*Power(v0 - vf,2) + Power(aMax,2)*jMax*(-v0 + vf) + 2*aMax*Power(jMax,2)*(p0 - pf + tf*vf)))/(12.*aMax*jMax*(Power(a0,2) - 2*a0*aMax + 2*(Power(aMax,2) - aMax*jMax*tf + jMax*(-v0 + vf)))); + profile.t[6] = profile.t[2]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, jMax, 0, -jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + + return false; +} + +bool RuckigStep1::time_up_acc1_vel(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + profile.t[0] = (-2*a0*jMax + Sqrt(2)*Sqrt(Power(a0,2) + 2*jMax*(-v0 + vMax))*Abs(jMax))/(2*Power(jMax,2)); + profile.t[1] = 0; + profile.t[2] = Sqrt(Power(a0,2)/2 + jMax*(-v0 + vMax))/Abs(jMax); + profile.t[3] = (-2*jMax*(2*Power(a0,3)*aMax - 6*a0*aMax*jMax*v0 + 3*jMax*(2*aMax*jMax*(p0 - pf) + Power(aMax,2)*(vf + vMax) + jMax*(-Power(vf,2) + Power(vMax,2)))) + 3*Sqrt(2)*aMax*Sqrt(Power(a0,2) + 2*jMax*(-v0 + vMax))*(Power(a0,2) - 2*jMax*(v0 + vMax))*Abs(jMax))/(12.*aMax*Power(jMax,3)*vMax); + profile.t[4] = aMax/jMax; + profile.t[5] = (-Power(aMax,2)/jMax - vf + vMax)/aMax; + profile.t[6] = profile.t[4]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + return profile.check(pf, vf, vMax, aMax); +} + +bool RuckigStep2::time_up_acc1_vel(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + // Profile UDDU + { + std::array polynom; + polynom[0] = 12*Power(jMax,4); + polynom[1] = 24*(2*a0 + aMax)*Power(jMax,3); + polynom[2] = 12*Power(jMax,2)*(5*Power(a0,2) + 4*a0*aMax + Power(aMax,2) - 2*aMax*jMax*tf + 2*jMax*(v0 - vf)); + polynom[3] = 24*a0*jMax*(Power(a0,2) + a0*aMax + Power(aMax,2) - 2*aMax*jMax*tf + 2*jMax*(v0 - vf)); + polynom[4] = 3*Power(a0,4) + 4*Power(a0,3)*aMax + 6*Power(a0,2)*(Power(aMax,2) - 2*aMax*jMax*tf + 2*jMax*(v0 - vf)) + 12*jMax*(-2*aMax*jMax*(p0 - pf + tf*v0) + Power(aMax,2)*(v0 - vf) + jMax*Power(v0 - vf,2)); + + auto roots = Roots::solveQuart(polynom); + for (double t: roots) { + profile.t[0] = t; + profile.t[1] = 0; + profile.t[2] = a0/jMax + t; + profile.t[3] = -(Power(a0,2) + 2*a0*(aMax + 2*jMax*t) + 2*(Power(aMax,2) + aMax*jMax*(2*t - tf) + jMax*(jMax*Power(t,2) + v0 - vf)))/(2.*aMax*jMax); + profile.t[4] = aMax/jMax; + profile.t[5] = (Power(a0,2) - 2*Power(aMax,2) + 4*a0*jMax*t + 2*jMax*(jMax*Power(t,2) + v0 - vf))/(2.*aMax*jMax); + profile.t[6] = profile.t[4]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + } + + // Profile UDUD + { + std::array polynom; + polynom[0] = 12*Power(jMax,4); + polynom[1] = 24*(2*a0 - aMax)*Power(jMax,3); + polynom[2] = 12*Power(jMax,2)*(5*Power(a0,2) - 4*a0*aMax - Power(aMax,2) + 2*aMax*jMax*tf + 2*jMax*(v0 - vf)); + polynom[3] = 24*a0*jMax*(Power(a0,2) - a0*aMax - Power(aMax,2) + 2*aMax*jMax*tf + 2*jMax*(v0 - vf)); + polynom[4] = 3*Power(a0,4) - 4*Power(a0,3)*aMax + 12*jMax*(2*aMax*jMax*(p0 - pf + tf*v0) + jMax*Power(v0 - vf,2) + Power(aMax,2)*(-v0 + vf)) - 6*Power(a0,2)*(Power(aMax,2) - 2*aMax*jMax*tf + 2*jMax*(-v0 + vf)); + + auto roots = Roots::solveQuart(polynom); + for (double t: roots) { + profile.t[0] = t; + profile.t[1] = 0; + profile.t[2] = a0/jMax + t; + profile.t[3] = (Power(a0,2) - 2*Power(aMax,2) - 2*a0*(aMax - 2*jMax*t) + 2*aMax*jMax*(-2*t + tf) + 2*jMax*(jMax*Power(t,2) + v0 - vf))/(2.*aMax*jMax); + profile.t[4] = aMax/jMax; + profile.t[5] = -(Power(a0,2) + 4*a0*jMax*t + 2*(Power(aMax,2) + jMax*(jMax*Power(t,2) + v0 - vf)))/(2.*aMax*jMax); + profile.t[6] = profile.t[4]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, jMax, 0, -jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + } + + return false; +} + +bool RuckigStep1::time_up_acc0_vel(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + profile.t[0] = (-a0 + aMax)/jMax; + profile.t[1] = (Power(a0,2) - 2*Power(aMax,2) + 2*jMax*(-v0 + vMax))/(2*aMax*jMax); + profile.t[2] = aMax/jMax; + profile.t[3] = ((3*Power(a0,4) - 8*Power(a0,3)*aMax + 24*a0*aMax*jMax*v0 + 6*Power(a0,2)*(Power(aMax,2) - 2*jMax*v0) - 12*jMax*(Power(aMax,2)*(v0 + vMax) + jMax*(-Power(v0,2) + Power(vMax,2)) + 2*aMax*(jMax*(p0 - pf) + SqrtComplex(jMax)*SqrtComplex(-vf + vMax)*(vf + vMax))))/(24.*aMax*Power(jMax,2)*vMax)).real(); + profile.t[4] = Sqrt((-vf + vMax)/jMax); + profile.t[5] = 0; + profile.t[6] = profile.t[4]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + return profile.check(pf, vf, vMax, aMax); +} + +bool RuckigStep2::time_up_acc0_vel(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + const double h1 = Power(a0,2) - 2*a0*aMax + Power(aMax,2) - 2*aMax*jMax*tf + 2*jMax*(-v0 + vf); + const double h2 = 3*Power(a0,4) - 8*Power(a0,3)*aMax + 24*a0*aMax*jMax*(v0 - vf) + 6*Power(a0,2)*(Power(aMax,2) + 2*jMax*(-v0 + vf)) - 12*jMax*(Power(aMax,2)*(v0 - vf) - jMax*Power(v0 - vf,2) + 2*aMax*jMax*(p0 - pf + tf*vf)); + const double h3 = 144*(Power(h1,2) + h2)*Power(jMax,4); + + // Profile UDDU + { + const double h4 = 1728*(2*Power(h1,3) + 9*Power(aMax,2)*h2 - 6*h1*h2)*Power(jMax,6); + const auto h5 = PowerComplex(h4 + SqrtComplex(-4*Power(h3,3) + Power(h4,2)),1./3); + const auto h6 = SqrtComplex((2*Power(2,1./3)*h3 + h5*(Power(2,2./3)*h5 + 24*(3*Power(aMax,2) - 2*h1)*Power(jMax,2)))/(h5*Power(jMax,4)))/(6.*Sqrt(2)); + const auto h7 = (-2*(Power(aMax,3) - aMax*h1))/(h6*Power(jMax,3)); + const auto h8 = -(2*Power(2,1./3)*h3 + h5*(Power(2,2./3)*h5 + 48*(-3*Power(aMax,2) + 2*h1)*Power(jMax,2)))/(72.*h5*Power(jMax,4)); + + // Solution 3 + { + profile.t[0] = (-a0 + aMax)/jMax; + profile.t[1] = ((Power(a0,2)*aMax - 2*a0*aMax*(aMax - h6*jMax) - jMax*(PowerComplex(h6,2)*SqrtComplex(h7 + h8)*Power(jMax,2) + Power(aMax,2)*(h6 + 2*tf) + aMax*(PowerComplex(h6,2)*jMax - h6*jMax*(SqrtComplex(h7 + h8) + 2*tf) + 2*(v0 - vf))))/(2.*aMax*h6*Power(jMax,2))).real(); + profile.t[2] = aMax/jMax; + profile.t[3] = ((-(Power(a0,2)*aMax) + 2*a0*Power(aMax,2) + PowerComplex(h6,2)*SqrtComplex(h7 + h8)*Power(jMax,3) - Power(aMax,2)*jMax*(h6 - 2*tf) + aMax*jMax*(-(PowerComplex(h6,2)*jMax) + h6*SqrtComplex(h7 + h8)*jMax + 2*v0 - 2*vf))/(2.*aMax*h6*Power(jMax,2))).real(); + profile.t[4] = -(aMax - h6*jMax + SqrtComplex(h7 + h8)*jMax).real()/(2.*jMax); + profile.t[5] = 0; + profile.t[6] = profile.t[4]; + + // std::cout << profile.t[0] << std::endl; + // std::cout << profile.t[1] << std::endl; + // std::cout << profile.t[2] << std::endl; + // std::cout << profile.t[3] << std::endl; + // std::cout << profile.t[4] << std::endl; + // std::cout << profile.t[5] << std::endl; + // std::cout << profile.t[6] << std::endl; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + } + + // Profile UDUD + { + const double h4 = 1728*(-2*Power(h1,3) + 9*Power(aMax,2)*h2 + 6*h1*h2)*Power(jMax,6); + const auto h5 = PowerComplex(h4 + SqrtComplex(-4*Power(h3,3) + Power(h4,2)),1./3); + const auto h6 = SqrtComplex((2*Power(2,0.3333333333333333)*h3 + h5*(Power(2,0.6666666666666666)*h5 + 24*(3*Power(aMax,2) + 2*h1)*Power(jMax,2)))/(h5*Power(jMax,4)))/(6.*Sqrt(2)); + const auto h7 = (2*aMax*(Power(aMax,2) + h1))/(h6*Power(jMax,3)); + const auto h8 = (-2*Power(2,0.3333333333333333)*h3 + h5*(-(Power(2,0.6666666666666666)*h5) + 48*(3*Power(aMax,2) + 2*h1)*Power(jMax,2)))/(72.*h5*Power(jMax,4)); + + // Solution 2 + { + profile.t[0] = (-a0 + aMax)/jMax; + profile.t[1] = ((Power(a0,2)*aMax + 2*Power(aMax,3) + PowerComplex(h6,2)*SqrtComplex(-h7 + h8)*Power(jMax,3) - 2*a0*aMax*(aMax - h6*jMax) - Power(aMax,2)*jMax*(5.*h6 + 2*tf) + aMax*jMax*(PowerComplex(h6,2)*jMax - h6*SqrtComplex(-h7 + h8)*jMax + 2.*h6*jMax*tf - 2*v0 + 2*vf))/(2.*aMax*h6*Power(jMax,2))).real(); + profile.t[2] = aMax/jMax; + profile.t[3] = (-(Power(a0,2)*aMax - 2*a0*Power(aMax,2) + 2*Power(aMax,3) + PowerComplex(h6,2)*SqrtComplex(-h7 + h8)*Power(jMax,3) + Power(aMax,2)*jMax*(h6 - 2*tf) + aMax*jMax*(-(PowerComplex(h6,2)*jMax) + h6*SqrtComplex(-h7 + h8)*jMax - 2*v0 + 2*vf))/(2.*aMax*h6*Power(jMax,2))).real(); + profile.t[4] = (aMax - h6*jMax + SqrtComplex(-h7 + h8)*jMax).real()/(2.*jMax); + profile.t[5] = 0; + profile.t[6] = profile.t[4]; + + // std::cout << profile.t[0] << std::endl; + // std::cout << profile.t[1] << std::endl; + // std::cout << profile.t[2] << std::endl; + // std::cout << profile.t[3] << std::endl; + // std::cout << profile.t[4] << std::endl; + // std::cout << profile.t[5] << std::endl; + // std::cout << profile.t[6] << std::endl; + // std::cout << "---" << std::endl; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, jMax, 0, -jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + } + + return false; +} + +bool RuckigStep1::time_up_vel(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + profile.t[0] = ((-2*a0*jMax + Sqrt(2)*Sqrt(Power(a0,2) + 2*jMax*(-v0 + vMax))*Abs(jMax))/(2*Power(jMax,2))); + profile.t[1] = 0; + profile.t[2] = Sqrt(Power(a0,2)/2 + jMax*(-v0 + vMax))/Abs(jMax); + profile.t[3] = ((-4*jMax*(Power(a0,3) + 3*Power(jMax,2)*(p0 - pf) - 3*a0*jMax*v0 + 3*jMax*SqrtComplex(jMax)*SqrtComplex(-vf + vMax)*(vf + vMax)) + 3*Sqrt(2)*SqrtComplex(Power(a0,2) + 2*jMax*(-v0 + vMax))*(Power(a0,2) - 2*jMax*(v0 + vMax))*Abs(jMax))/(12.*Power(jMax,3)*vMax)).real(); + profile.t[4] = Sqrt((-vf + vMax)/jMax); + profile.t[5] = 0; + profile.t[6] = profile.t[4]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + return profile.check(pf, vf, vMax, aMax); +} + +bool RuckigStep2::time_up_vel(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + // Profile UDDU + { + // Find root of 5th order polynom + std::array polynom; + polynom[0] = 1.0; + polynom[1] = (15*Power(a0,2) + 16*a0*jMax*tf - 2*Power(jMax,2)*Power(tf,2) + 6*jMax*v0 - 6*jMax*vf)/(4*a0*jMax + 4*Power(jMax,2)*tf); + polynom[2] = (29*Power(a0,3) + 33*Power(a0,2)*jMax*tf + 6*Power(jMax,2)*(p0 - pf + tf*v0) - 12*a0*jMax*(jMax*Power(tf,2) - 3*v0 + 3*vf))/(6.*Power(jMax,2)*(a0 + jMax*tf)); + polynom[3] = (61*Power(a0,4) + 76*Power(a0,3)*jMax*tf + 48*a0*Power(jMax,2)*(p0 - pf + tf*v0) - 24*Power(jMax,3)*tf*(p0 - pf + tf*v0) + 36*Power(jMax,2)*Power(v0 - vf,2) - 60*Power(a0,2)*jMax*(jMax*Power(tf,2) - 3*v0 + 3*vf))/(24.*Power(jMax,3)*(a0 + jMax*tf)); + polynom[4] = (a0*(7*Power(a0,4) + 10*Power(a0,3)*jMax*tf + 12*a0*Power(jMax,2)*(p0 - pf + tf*v0) - 24*Power(jMax,3)*tf*(p0 - pf + tf*v0) + 36*Power(jMax,2)*Power(v0 - vf,2) - 12*Power(a0,2)*jMax*(jMax*Power(tf,2) - 3*v0 + 3*vf)))/(12.*Power(jMax,4)*(a0 + jMax*tf)); + polynom[5] = (7*Power(a0,6) + 12*Power(a0,5)*jMax*tf + 24*Power(a0,3)*Power(jMax,2)*(p0 - pf + tf*v0) - 36*Power(a0,2)*Power(jMax,2)*(2*jMax*tf*(p0 - pf + tf*v0) - 3*Power(v0 - vf,2)) - 72*Power(jMax,3)*(jMax*Power(p0 - pf + tf*v0,2) - Power(v0 - vf,3)) - 18*Power(a0,4)*jMax*(jMax*Power(tf,2) - 3*v0 + 3*vf))/(144.*Power(jMax,5)*(a0 + jMax*tf)); + + // Solve 4th order derivative analytically + auto extremas = Roots::solveQuart(5 * polynom[0], 4 * polynom[1], 3 * polynom[2], 2 * polynom[3], polynom[4]); + std::set> tz_intervals; + + double tz_min {0.0}; + double tz_max = std::min(tf, (tf - a0/jMax) / 2); + double tz_current {tz_min}; + + for (double tz: extremas) { + if (tz <= 0.0 || tz >= tz_max) { + continue; + } + + // Check that polynom(lower) and polynom(upper) have different signs (should only happen at first and last boundary) + // std::cout << "tz_current: " << tz_current << " " << eval(polynom, tz_current) << std::endl; + // std::cout << "tz: " << tz << " " << eval(polynom, tz) << std::endl; + double val_current = eval(polynom, tz_current); + double val_new = eval(polynom, tz); + if (std::abs(val_new) < 1e-15) { + tz_intervals.insert({tz - 1e-12, tz + 1e-12}); + tz += 1e-14; + } else if (val_current * val_new < 0) { + tz_intervals.insert({tz_current, tz}); + } + tz_current = tz; + } + if (eval(polynom, tz_current) * eval(polynom, tz_max) < 0) { + tz_intervals.insert({tz_current, tz_max}); + } + + for (auto interval: tz_intervals) { + // Use safe Newton method + double lower = std::get<0>(interval); + double upper = std::get<1>(interval); + double tz = Roots::shrinkInterval(polynom.data(), 6, lower, upper, 1e-16); + + double vPlat = Power(a0,2)/(2.*jMax) + 2*a0*tz + jMax*Power(tz,2) + v0; + double h1 = 2*Sqrt((vPlat - vf)/jMax); + + profile.t[0] = tz; + profile.t[1] = 0; + profile.t[2] = a0/jMax + tz; + profile.t[3] = -(4*Power(a0,3) + 12*a0*jMax*(v0 + jMax*tz*(3*tz + h1)) + 3*Power(a0,2)*jMax*(8*tz + h1) + 6*Power(jMax,2)*(2*p0 - 2*pf + 2*jMax*Power(tz,3) + 4*tz*v0 + jMax*Power(tz,2)*h1 + v0*h1 + h1*vf))/(6.*jMax*(Power(a0,2) + 4*a0*jMax*tz + 2*jMax*(jMax*Power(tz,2) + v0)));; + profile.t[4] = Sqrt((-vf + vPlat)/jMax); + profile.t[5] = 0; + profile.t[6] = profile.t[4]; + + // std::cout << profile.t[0] << std::endl; + // std::cout << profile.t[1] << std::endl; + // std::cout << profile.t[2] << std::endl; + // std::cout << profile.t[3] << std::endl; + // std::cout << profile.t[4] << std::endl; + // std::cout << profile.t[5] << std::endl; + // std::cout << profile.t[6] << std::endl; + // std::cout << "---" << std::endl; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + } + + // Profile UDUD + { + // Find root of 6th order polynom + std::array polynom; + polynom[0] = 144*Power(jMax,6); + polynom[1] = -144*Power(jMax,5)*(-5*a0 + jMax*tf); + polynom[2] = 36*Power(jMax,4)*(39*Power(a0,2) - 16*a0*jMax*tf + 2*jMax*(jMax*Power(tf,2) + 3*v0 - 3*vf)); + polynom[3] = 24*Power(jMax,3)*(55*Power(a0,3) - 33*Power(a0,2)*jMax*tf - 6*Power(jMax,2)*(p0 - pf + tf*v0) + 12*a0*jMax*(jMax*Power(tf,2) + 3*v0 - 3*vf)); + polynom[4] = 6*Power(jMax,2)*(101*Power(a0,4) - 76*Power(a0,3)*jMax*tf - 48*a0*Power(jMax,2)*(p0 - pf + tf*v0) + 12*Power(jMax,2)*(2*jMax*tf*(p0 - pf + tf*v0) + 3*Power(v0 - vf,2)) + 60*Power(a0,2)*jMax*(jMax*Power(tf,2) + 3*v0 - 3*vf)); + polynom[5] = 12*a0*jMax*(11*Power(a0,4) - 10*Power(a0,3)*jMax*tf - 12*a0*Power(jMax,2)*(p0 - pf + tf*v0) + 12*Power(jMax,2)*(2*jMax*tf*(p0 - pf + tf*v0) + 3*Power(v0 - vf,2)) + 12*Power(a0,2)*jMax*(jMax*Power(tf,2) + 3*v0 - 3*vf)); + polynom[6] = 11*Power(a0,6) - 12*Power(a0,5)*jMax*tf - 24*Power(a0,3)*Power(jMax,2)*(p0 - pf + tf*v0) + 36*Power(a0,2)*Power(jMax,2)*(2*jMax*tf*(p0 - pf + tf*v0) + 3*Power(v0 - vf,2)) + 72*Power(jMax,3)*(jMax*Power(p0 - pf + tf*v0,2) + Power(v0 - vf,3)) + 18*Power(a0,4)*jMax*(jMax*Power(tf,2) + 3*v0 - 3*vf); + + std::array deriv; + deriv[0] = 6 * polynom[0]; + deriv[1] = 5 * polynom[1]; + deriv[2] = 4 * polynom[2]; + deriv[3] = 3 * polynom[3]; + deriv[4] = 2 * polynom[4]; + deriv[5] = polynom[5]; + + auto dd_extremas = Roots::solveQuart(5 * deriv[0], 4 * deriv[1], 3 * deriv[2], 2 * deriv[3], deriv[4]); + std::set> dd_tz_intervals; + + double tz_min {0.0}; + double tz_max = std::min(tf, (tf - a0/jMax) / 2); + double dd_tz_current {tz_min}; + + for (double tz: dd_extremas) { + if (tz <= 0.0 || tz >= tz_max) { + continue; + } + + // Check that polynom(lower) and polynom(upper) have different signs (should only happen at first and last boundary) + if (eval(deriv, dd_tz_current) * eval(deriv, tz) < 0) { + dd_tz_intervals.insert({dd_tz_current, tz}); + } + dd_tz_current = tz; + } + if (eval(deriv, dd_tz_current) * eval(deriv, tz_max) < 0) { + dd_tz_intervals.insert({dd_tz_current, tz_max}); + } + + std::set> tz_intervals; + double tz_current {tz_min}; + + for (auto interval: dd_tz_intervals) { + double lower = std::get<0>(interval); + double upper = std::get<1>(interval); + double tz = Roots::shrinkInterval(deriv.data(), 6, lower, upper, 1e-14); + + if (tz <= 0.0 || tz >= tz_max) { + continue; + } + // Check that polynom(lower) and polynom(upper) have different signs (should only happen at first and last boundary) + if (eval(polynom, tz_current) * eval(polynom, tz) < 0) { + tz_intervals.insert({tz_current, tz}); + } + tz_current = tz; + } + if (eval(polynom, tz_current) * eval(polynom, tz_max) < 0) { + tz_intervals.insert({tz_current, tz_max}); + } + + for (auto interval: tz_intervals) { + // Use safe Newton method + double lower = std::get<0>(interval); + double upper = std::get<1>(interval); + double tz = Roots::shrinkInterval(polynom.data(), 7, lower, upper, 1e-14); + + double vPlat = Power(a0,2)/(2.*jMax) + 2*a0*tz + jMax*Power(tz,2) + v0; + // std::cout << "BE CAREFUL " << vPlat << std::endl; + + profile.t[0] = tz; + profile.t[1] = 0; + profile.t[2] = a0/jMax + tz; + profile.t[3] = tf - (2*tz + a0/jMax + 2 * Sqrt((vf - vPlat)/jMax)); + profile.t[4] = Sqrt((vf - vPlat)/jMax); + profile.t[5] = 0; + profile.t[6] = profile.t[4]; + + // std::cout << profile.t[4] << " " << Sqrt((vf - vPlat)/jMax) << std::endl; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, jMax, 0, -jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + } + + return false; +} + +bool RuckigStep1::time_up_acc0_acc1(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + const double h1 = Abs(aMax)*Abs(jMax)*Sqrt(6*(3*Power(a0,4) - 8*Power(a0,3)*aMax + 24*a0*aMax*jMax*v0 + 6*Power(a0,2)*(Power(aMax,2) - 2*jMax*v0) + 6*(Power(aMax,4) + 4*aMax*Power(jMax,2)*(-p0 + pf) - 2*Power(aMax,2)*jMax*(v0 + vf) + 2*Power(jMax,2)*(Power(v0,2) + Power(vf,2))))); + + profile.t[0] = (-a0 + aMax)/jMax; + profile.t[1] = (6*Power(a0,2)*aMax*jMax - 18*Power(aMax,3)*jMax - 12*aMax*Power(jMax,2)*v0 + h1)/(12.*Power(aMax,2)*Power(jMax,2)); + profile.t[2] = aMax/jMax; + profile.t[3] = 0; + profile.t[4] = profile.t[2]; + profile.t[5] = (-18*Power(aMax,3)*jMax - 12*aMax*Power(jMax,2)*vf + h1)/(12.*Power(aMax,2)*Power(jMax,2)); + profile.t[6] = profile.t[2]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + return profile.check(pf, vf, vMax, aMax); +} + +bool RuckigStep2::time_up_acc0_acc1(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + if (std::abs(a0) < 1e-16) { + profile.t[0] = (Power(aMax,2)*Power(tf,2) - Power(v0 - vf,2) + 2*aMax*(2*p0 - 2*pf + tf*(v0 + vf)))/(2.*Power(aMax,2)*tf); + profile.t[1] = -(Power(aMax,2)*Power(tf,2) - 2*Power(v0 - vf,2) + aMax*(8*p0 - 8*pf + 5*tf*v0 + 3*tf*vf))/(2.*Power(aMax,2)*tf); + profile.t[2] = profile.t[0]; + profile.t[3] = 0; + profile.t[4] = profile.t[0]; + profile.t[5] = -(Power(aMax,2)*Power(tf,2) - 2*Power(v0 - vf,2) + aMax*(8*p0 - 8*pf + 3*tf*v0 + 5*tf*vf))/(2.*Power(aMax,2)*tf); + profile.t[6] = profile.t[0]; + jMax = aMax/profile.t[0]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + return profile.check(pf, vf, vMax, aMax); + } + + double h1 = -12*(2*Power(aMax,3)*tf + Power(a0,2)*(aMax*tf - v0 + vf) - 2*a0*aMax*(aMax*tf - v0 + vf)); + double h2 = -12*(Power(aMax,2)*Power(tf,2) - Power(v0 - vf,2) + 2*aMax*(2*p0 - 2*pf + tf*(v0 + vf))); + double h3 = 3*Power(a0,3) - 4*Power(a0,2)*aMax - 12*a0*Power(aMax,2) + 24*Power(aMax,3); + double h4 = h1 - Sqrt(Power(h1,2) - 4*a0*h2*h3); + double h5 = h1 + Sqrt(Power(h1,2) - 4*a0*h2*h3); + double h6 = 2*aMax*h4*(2*p0 - 2*pf + tf*(v0 + vf)); + double h7 = 2*a0*aMax*h2*(a0*tf + 2*v0 - 2*vf); + + profile.t[0] = (6*(a0 - aMax)*(-h6 + h7 + 4*Power(aMax,3)*h2*tf - Power(aMax,2)*tf*(4*a0*h2 + h4*tf) + (-2*Power(a0,2)*h2 + h4*(v0 - vf))*(v0 - vf)))/(a0*h2*h3); + profile.t[1] = (24*Power(aMax,2)*(-h6 + 4*Power(aMax,3)*h2*tf - Power(aMax,2)*h4*Power(tf,2) + h4*Power(v0 - vf,2)) - 6*a0*aMax*(-h6 + 16*Power(aMax,3)*h2*tf - Power(aMax,2)*(h4*Power(tf,2) + 12*h2*(v0 - vf)) + h4*Power(v0 - vf,2)) - 3*Power(a0,4)*h2*(aMax*tf - v0 + vf) - 4*Power(a0,3)*aMax*h2*(aMax*tf - v0 + vf) + 3*Power(a0,2)*(h6 + 16*Power(aMax,3)*h2*tf - h4*Power(v0 - vf,2) + Power(aMax,2)*(h4*Power(tf,2) + 20*h2*(-v0 + vf))))/(2.*a0*aMax*h2*h3); + profile.t[2] = (-6*aMax*(-h6 + h7 + 4*Power(aMax,3)*h2*tf - Power(aMax,2)*tf*(4*a0*h2 + h4*tf) + (-2*Power(a0,2)*h2 + h4*(v0 - vf))*(v0 - vf)))/(a0*h2*h3); + profile.t[3] = 0; + profile.t[4] = profile.t[2]; + profile.t[5] = (24*Power(aMax,2)*(-h6 + 4*Power(aMax,3)*h2*tf - Power(aMax,2)*h4*Power(tf,2) + h4*Power(v0 - vf,2)) - 6*a0*aMax*(-h6 + 16*Power(aMax,3)*h2*tf - Power(aMax,2)*(h4*Power(tf,2) + 20*h2*(v0 - vf)) + h4*Power(v0 - vf,2)) + 3*Power(a0,2)*(-h6 + 24*Power(aMax,3)*h2*tf - Power(aMax,2)*(h4*Power(tf,2) + 28*h2*(v0 - vf)) + h4*Power(v0 - vf,2)) + 3*Power(a0,4)*h2*(3*aMax*tf - v0 + vf) - 4*Power(a0,3)*aMax*h2*(7*aMax*tf - 5*v0 + 5*vf))/(2.*a0*aMax*h2*h3); + profile.t[6] = profile.t[2]; + + jMax = h4/(2.*h2); + + // std::cout << profile.t[0] << std::endl; + // std::cout << profile.t[1] << std::endl; + // std::cout << profile.t[2] << std::endl; + // std::cout << profile.t[4] << std::endl; + // std::cout << profile.t[5] << std::endl; + // std::cout << jMax << std::endl; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + return profile.check(pf, vf, vMax, aMax); +} + +bool RuckigStep1::time_up_acc1(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + // if (a0 < 2e-15 && v0 < 2e-15) { + + // } + + const double h1 = 5*Power(a0,2) + 6*a0*aMax + Power(aMax,2) + 2*jMax*v0; + const double h2 = 2*a0 + aMax; + const double h3 = 3*Power(a0,4) + 8*Power(a0,3)*aMax + 24*a0*aMax*jMax*v0 + 6*Power(a0,2)*(Power(aMax,2) + 2*jMax*v0) + 12*jMax*(2*aMax*jMax*(p0 - pf) + Power(aMax,2)*(v0 + vf) + jMax*(Power(v0,2) - Power(vf,2))); + const double h4 = (a0 + aMax)*(Power(a0,2) + a0*aMax + 2*jMax*v0); + const double h5 = 4*Power(a0,4) + 8*Power(a0,3)*aMax + Power(aMax,4) + 24*aMax*Power(jMax,2)*(p0 - pf) - 24*a0*aMax*jMax*v0 + 4*Power(a0,2)*(Power(aMax,2) - 4*jMax*v0) + Power(aMax,2)*jMax*(-8*v0 + 12*vf) + 4*Power(jMax,2)*(4*Power(v0,2) - 3*Power(vf,2)); + const double h6 = (2*Power(h1,3) - 6*h1*(h3 + 6*h2*h4) + 9*(Power(h2,2)*h3 + 12*Power(h4,2))); + const auto h7 = 12*Power(jMax,2)*PowerComplex(h6 + SqrtComplex(Power(h6,2) - 4*Power(h5,3)),1./3); + const auto h8 = SqrtComplex((4*Power(2,1./3)*h5)/h7 + (Power(2,2./3)*h7 + 24*(-2*h1 + 3*Power(h2,2))*Power(jMax,2))/(72.*Power(jMax,4))); + const auto h9 = SqrtComplex((-576*Power(2,1./3)*h5)/h7 - (2*Power(2,2./3)*h7)/Power(jMax,4) - (96.*(h1*(3*h2 + 2.*h8*jMax) - 3.*(Power(h2,3) + 2*h4 + Power(h2,2)*h8*jMax)))/(h8*Power(jMax,3))); + const auto h10 = SqrtComplex((-576*Power(2,1./3)*h5)/h7 - (2*Power(2,2./3)*h7)/Power(jMax,4) + (96.*(3*h1*h2 - 3*Power(h2,3) - 6*h4 - 2.*h1*h8*jMax + 3*Power(h2,2)*h8*jMax))/(h8*Power(jMax,3))); + + // Solution 2 + { + profile.t[0] = -h2/(2*jMax) + (h9 - 12.*h8).real()/24.; + profile.t[1] = 0; + profile.t[2] = -aMax/(2*jMax) + (h9 - 12.*h8).real()/24.; + profile.t[3] = 0; + profile.t[4] = aMax/jMax; + profile.t[5] = -((12*Power(a0,2)*aMax + jMax*(12*Power(aMax,2)*h8 + aMax*(-12.*PowerComplex(h8,2)*jMax + h8*jMax*h9 - 24*v0) + h8*jMax*(h8*jMax*h9 + 24*vf)))/(24.*aMax*h8*Power(jMax,2))).real(); + profile.t[6] = profile.t[4]; + + profile.t[2] = (profile.t[2] + profile.t[4]) / 2; + profile.t[4] = profile.t[2]; + + // std::cout << "HERE" << std::endl; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + + // Solution 4 + { + profile.t[0] = -h2/(2.*jMax) + (h10 + 12.*h8).real()/24.; + profile.t[1] = 0; + profile.t[2] = -aMax/(2.*jMax) + (h10 + 12.*h8).real()/24.; + profile.t[3] = 0; + profile.t[4] = aMax/jMax; + profile.t[5] = -(Power(aMax,2) + aMax*(-(Power(a0,2)/(h8*jMax)) + h10*jMax/12. + h8*jMax + (2*v0)/h8) + jMax*(-(h10*h8*jMax)/12. + 2*vf)).real()/(2.*aMax*jMax); + profile.t[6] = profile.t[4]; + + profile.t[2] = (profile.t[2] + profile.t[4]) / 2; + profile.t[4] = profile.t[2]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + + return false; +} + +bool RuckigStep2::time_up_acc1(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + // a3 != 0 + // Case UDDU, Solution 2 + { + profile.t[0] = 0; + profile.t[1] = 0; + profile.t[2] = -(-2*Power(a0,3)*jMax - 6*Power(a0,2)*aMax*jMax - 6*a0*Power(aMax,2)*jMax + 12*Power(jMax,3)*p0 - 12*Power(jMax,3)*pf - 6*Power(aMax,2)*Power(jMax,2)*tf + 6*aMax*Power(jMax,3)*Power(tf,2) + 12*Power(jMax,3)*tf*vf - Sqrt(2)*Sqrt(Power(jMax,2)*(2*Power(Power(a0,3) + 3*Power(a0,2)*aMax + 3*a0*Power(aMax,2) + 3*Power(aMax,2)*jMax*tf - 3*Power(jMax,2)*(2*p0 - 2*pf + tf*(aMax*tf + 2*vf)),2) - 3*(Power(a0,2) + 2*a0*aMax + 2*(Power(aMax,2) - aMax*jMax*tf + jMax*(v0 - vf)))*(Power(a0,4) + 4*Power(a0,3)*aMax + 6*Power(a0,2)*Power(aMax,2) + 12*jMax*(-2*aMax*jMax*(p0 - pf + tf*v0) + Power(aMax,2)*(v0 - vf) + jMax*Power(v0 - vf,2)) - 12*a0*jMax*(-(Power(aMax,2)*tf) + jMax*(2*p0 - 2*pf + aMax*Power(tf,2) + 2*tf*vf))))))/(6.*Power(jMax,2)*(Power(a0,2) + 2*a0*aMax + 2*(Power(aMax,2) - aMax*jMax*tf + jMax*(v0 - vf)))); + profile.t[3] = -(4*Power(a0,3)*jMax + 12*Power(a0,2)*aMax*jMax + 18*a0*Power(aMax,2)*jMax + 12*Power(aMax,3)*jMax + 12*Power(jMax,3)*p0 - 12*Power(jMax,3)*pf - 12*a0*aMax*Power(jMax,2)*tf - 18*Power(aMax,2)*Power(jMax,2)*tf + 6*aMax*Power(jMax,3)*Power(tf,2) + 12*a0*Power(jMax,2)*v0 + 12*aMax*Power(jMax,2)*v0 - 12*a0*Power(jMax,2)*vf - 12*aMax*Power(jMax,2)*vf + 12*Power(jMax,3)*tf*vf + Sqrt(2)*Sqrt(Power(jMax,2)*(2*Power(Power(a0,3) + 3*Power(a0,2)*aMax + 3*a0*Power(aMax,2) + 3*Power(aMax,2)*jMax*tf - 3*Power(jMax,2)*(2*p0 - 2*pf + tf*(aMax*tf + 2*vf)),2) - 3*(Power(a0,2) + 2*a0*aMax + 2*(Power(aMax,2) - aMax*jMax*tf + jMax*(v0 - vf)))*(Power(a0,4) + 4*Power(a0,3)*aMax + 6*Power(a0,2)*Power(aMax,2) + 12*jMax*(-2*aMax*jMax*(p0 - pf + tf*v0) + Power(aMax,2)*(v0 - vf) + jMax*Power(v0 - vf,2)) - 12*a0*jMax*(-(Power(aMax,2)*tf) + jMax*(2*p0 - 2*pf + aMax*Power(tf,2) + 2*tf*vf))))))/(6.*Power(jMax,2)*(Power(a0,2) + 2*a0*aMax + 2*(Power(aMax,2) - aMax*jMax*tf + jMax*(v0 - vf)))); + profile.t[4] = -(-4*Power(a0,3)*jMax - 12*Power(a0,2)*aMax*jMax - 18*a0*Power(aMax,2)*jMax - 12*Power(aMax,3)*jMax - 12*Power(jMax,3)*p0 + 12*Power(jMax,3)*pf + 12*a0*aMax*Power(jMax,2)*tf + 18*Power(aMax,2)*Power(jMax,2)*tf - 6*aMax*Power(jMax,3)*Power(tf,2) - 12*a0*Power(jMax,2)*v0 - 12*aMax*Power(jMax,2)*v0 + 12*a0*Power(jMax,2)*vf + 12*aMax*Power(jMax,2)*vf - 12*Power(jMax,3)*tf*vf + Sqrt(2)*Sqrt(Power(jMax,2)*(2*Power(Power(a0,3) + 3*Power(a0,2)*aMax + 3*a0*Power(aMax,2) + 3*Power(aMax,2)*jMax*tf - 3*Power(jMax,2)*(2*p0 - 2*pf + tf*(aMax*tf + 2*vf)),2) - 3*(Power(a0,2) + 2*a0*aMax + 2*(Power(aMax,2) - aMax*jMax*tf + jMax*(v0 - vf)))*(Power(a0,4) + 4*Power(a0,3)*aMax + 6*Power(a0,2)*Power(aMax,2) + 12*jMax*(-2*aMax*jMax*(p0 - pf + tf*v0) + Power(aMax,2)*(v0 - vf) + jMax*Power(v0 - vf,2)) - 12*a0*jMax*(-(Power(aMax,2)*tf) + jMax*(2*p0 - 2*pf + aMax*Power(tf,2) + 2*tf*vf))))))/(6.*Power(jMax,2)*(Power(a0,2) + 2*a0*aMax + 2*(Power(aMax,2) - aMax*jMax*tf + jMax*(v0 - vf)))); + profile.t[5] = -(2*Power(a0,3)*jMax + 12*Power(a0,2)*aMax*jMax + 18*a0*Power(aMax,2)*jMax + 12*Power(aMax,3)*jMax - 12*Power(jMax,3)*p0 + 12*Power(jMax,3)*pf - 6*Power(a0,2)*Power(jMax,2)*tf - 12*a0*aMax*Power(jMax,2)*tf - 18*Power(aMax,2)*Power(jMax,2)*tf + 6*aMax*Power(jMax,3)*Power(tf,2) + 12*aMax*Power(jMax,2)*v0 - 12*Power(jMax,3)*tf*v0 - 12*aMax*Power(jMax,2)*vf - Sqrt(2)*Sqrt(Power(jMax,2)*(2*Power(Power(a0,3) + 3*Power(a0,2)*aMax + 3*a0*Power(aMax,2) + 3*Power(aMax,2)*jMax*tf - 3*Power(jMax,2)*(2*p0 - 2*pf + tf*(aMax*tf + 2*vf)),2) - 3*(Power(a0,2) + 2*a0*aMax + 2*(Power(aMax,2) - aMax*jMax*tf + jMax*(v0 - vf)))*(Power(a0,4) + 4*Power(a0,3)*aMax + 6*Power(a0,2)*Power(aMax,2) + 12*jMax*(-2*aMax*jMax*(p0 - pf + tf*v0) + Power(aMax,2)*(v0 - vf) + jMax*Power(v0 - vf,2)) - 12*a0*jMax*(-(Power(aMax,2)*tf) + jMax*(2*p0 - 2*pf + aMax*Power(tf,2) + 2*tf*vf))))))/(6.*Power(jMax,2)*(Power(a0,2) + 2*a0*aMax + 2*(Power(aMax,2) - aMax*jMax*tf + jMax*(v0 - vf)))); + profile.t[6] = (aMax/jMax); + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + + // Case UDUD, Solution 1 + { + profile.t[0] = 0; + profile.t[1] = 0; + profile.t[2] = -(-2*Power(a0,3)*jMax + 6*Power(a0,2)*aMax*jMax - 6*a0*Power(aMax,2)*jMax + 12*Power(jMax,3)*p0 - 12*Power(jMax,3)*pf + 6*Power(aMax,2)*Power(jMax,2)*tf - 6*aMax*Power(jMax,3)*Power(tf,2) + 12*Power(jMax,3)*tf*vf + Sqrt(2)*Sqrt(Power(jMax,2)*(2*Power(Power(a0,3) - 3*Power(a0,2)*aMax + 3*a0*Power(aMax,2) - 3*jMax*(Power(aMax,2)*tf + jMax*(2*p0 - 2*pf - aMax*Power(tf,2) + 2*tf*vf)),2) - 3*(Power(a0,2) - 2*a0*aMax + 2*jMax*(aMax*tf + v0 - vf))*(Power(a0,4) - 4*Power(a0,3)*aMax + 6*Power(a0,2)*Power(aMax,2) + 12*jMax*(2*aMax*jMax*(p0 - pf + tf*v0) + jMax*Power(v0 - vf,2) + Power(aMax,2)*(-v0 + vf)) - 12*a0*jMax*(Power(aMax,2)*tf + jMax*(2*p0 - 2*pf - aMax*Power(tf,2) + 2*tf*vf))))))/(6.*Power(jMax,2)*(Power(a0,2) - 2*a0*aMax + 2*jMax*(aMax*tf + v0 - vf))); + profile.t[3] = (Sqrt(2)*Sqrt(Power(jMax,2)*(2*Power(Power(a0,3) - 3*Power(a0,2)*aMax + 3*a0*Power(aMax,2) - 3*jMax*(Power(aMax,2)*tf + jMax*(2*p0 - 2*pf - aMax*Power(tf,2) + 2*tf*vf)),2) - 3*(Power(a0,2) - 2*a0*aMax + 2*jMax*(aMax*tf + v0 - vf))*(Power(a0,4) - 4*Power(a0,3)*aMax + 6*Power(a0,2)*Power(aMax,2) + 12*jMax*(2*aMax*jMax*(p0 - pf + tf*v0) + jMax*Power(v0 - vf,2) + Power(aMax,2)*(-v0 + vf)) - 12*a0*jMax*(Power(aMax,2)*tf + jMax*(2*p0 - 2*pf - aMax*Power(tf,2) + 2*tf*vf))))))/(3.*Power(jMax,2)*(Power(a0,2) - 2*a0*aMax + 2*jMax*(aMax*tf + v0 - vf))); + profile.t[4] = -(4*Power(a0,3)*jMax - 12*Power(a0,2)*aMax*jMax + 6*a0*Power(aMax,2)*jMax + 12*Power(jMax,3)*p0 - 12*Power(jMax,3)*pf + 12*a0*aMax*Power(jMax,2)*tf - 6*Power(aMax,2)*Power(jMax,2)*tf - 6*aMax*Power(jMax,3)*Power(tf,2) + 12*a0*Power(jMax,2)*v0 - 12*aMax*Power(jMax,2)*v0 - 12*a0*Power(jMax,2)*vf + 12*aMax*Power(jMax,2)*vf + 12*Power(jMax,3)*tf*vf + Sqrt(2)*Sqrt(Power(jMax,2)*(2*Power(Power(a0,3) - 3*Power(a0,2)*aMax + 3*a0*Power(aMax,2) - 3*jMax*(Power(aMax,2)*tf + jMax*(2*p0 - 2*pf - aMax*Power(tf,2) + 2*tf*vf)),2) - 3*(Power(a0,2) - 2*a0*aMax + 2*jMax*(aMax*tf + v0 - vf))*(Power(a0,4) - 4*Power(a0,3)*aMax + 6*Power(a0,2)*Power(aMax,2) + 12*jMax*(2*aMax*jMax*(p0 - pf + tf*v0) + jMax*Power(v0 - vf,2) + Power(aMax,2)*(-v0 + vf)) - 12*a0*jMax*(Power(aMax,2)*tf + jMax*(2*p0 - 2*pf - aMax*Power(tf,2) + 2*tf*vf))))))/(6.*Power(jMax,2)*(Power(a0,2) - 2*a0*aMax + 2*jMax*(aMax*tf + v0 - vf))); + profile.t[5] = (Power(a0,3) + Power(a0,2)*(-6*aMax + 3*jMax*tf) + 6*a0*(Power(aMax,2) + jMax*(v0 - vf)) - 6*jMax*(aMax*(aMax*tf + 2*v0 - 2*vf) - jMax*(2*p0 - 2*pf + tf*(v0 + vf))))/(3.*jMax*(Power(a0,2) - 2*a0*aMax + 2*jMax*(aMax*tf + v0 - vf))); + profile.t[6] = (aMax/jMax); + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, jMax, 0, -jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + return false; +} + +bool RuckigStep1::time_up_acc0(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + if (std::abs(vf) < 1e-16) { + const auto h1 = Sqrt(3)*SqrtComplex(-3*Power(a0,4) + 8*Power(a0,3)*aMax - 24*a0*aMax*jMax*v0 - 6*Power(a0,2)*(Power(aMax,2) - 2*jMax*v0) + 12*jMax*(2*aMax*jMax*(p0 - pf) + Power(aMax,2)*v0 - jMax*Power(v0,2))); + const auto h2 = SqrtComplex(9*Power(aMax,2) - Complex(0,6)*h1); + + // Solution 2 + { + profile.t[0] = (-a0 + aMax)/jMax; + profile.t[1] = (3*Power(a0,2) - 3*Power(aMax,2) - 6*jMax*v0 - Complex(0,1)*h1 - aMax*h2).real()/(6.*aMax*jMax); + profile.t[2] = aMax/jMax; + profile.t[3] = 0; + profile.t[4] = (-3*aMax + h2.real())/(6.*jMax); + profile.t[5] = 0; + profile.t[6] = profile.t[4]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + + // Solution 1 + { + profile.t[0] = (-a0 + aMax)/jMax; + profile.t[1] = (3*Power(a0,2) - 3*Power(aMax,2) - 6*jMax*v0 - Complex(0,1)*h1 + aMax*h2).real()/(6.*aMax*jMax); + profile.t[2] = aMax/jMax; + profile.t[3] = 0; + profile.t[4] = -(3*aMax + h2.real())/(6.*jMax); + profile.t[5] = 0; + profile.t[6] = profile.t[4]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + + return false; + } + + const double h1 = Power(aMax,2) + 2*jMax*vf; + const double h2 = 3*Power(a0,4) - 8*Power(a0,3)*aMax + 24*a0*aMax*jMax*v0 + 6*Power(a0,2)*(Power(aMax,2) - 2*jMax*v0) - 12*jMax*(2*aMax*jMax*(p0 - pf) + Power(aMax,2)*(v0 + vf) + jMax*(-Power(v0,2) + Power(vf,2))); + const double h3 = Power(jMax,4)*(-3*Power(a0,4) + 8*Power(a0,3)*aMax + Power(aMax,4) + 24*aMax*Power(jMax,2)*(p0 - pf) - 24*a0*aMax*jMax*v0 - 6*Power(a0,2)*(Power(aMax,2) - 2*jMax*v0) + 4*Power(aMax,2)*jMax*(3*v0 - 2*vf) + 4*Power(jMax,2)*(-3*Power(v0,2) + 4*Power(vf,2))); + const double h4 = 1728*Power(jMax,6)*(-2*Power(h1,3) - 6*h1*(h2 - 12*Power(aMax,2)*jMax*vf) + 9*Power(aMax,2)*(h2 - 48*Power(jMax,2)*Power(vf,2))); + const auto h5 = Power(h4 + Sqrt(-11943936*Power(h3,3) + Power(h4,2)),1./3); + const auto h6 = SqrtComplex((-4*Power(2,1./3)*h3)/(h5*Power(jMax,4)) - h5/(36.*Power(2,1./3)*Power(jMax,4)) + Power(aMax,2)/Power(jMax,2) - (2*h1)/(3.*Power(jMax,2))); + const auto h7 = SqrtComplex((288*Power(2,1./3)*h3*h6 + h5*(Power(2,2./3)*h5*h6 + 48*jMax*(3*Power(aMax,3) - 3*aMax*h1 + 3*Power(aMax,2)*h6*jMax - 2*h1*h6*jMax + 12*aMax*jMax*vf)))/(h5*h6))/(6.*Sqrt(2)*Power(Abs(jMax),2)); + const auto h8 = SqrtComplex((288*Power(2,1./3)*h3*h6 + h5*(Power(2,2./3)*h5*h6 + 48*jMax*(-3*Power(aMax,3) + 3*Power(aMax,2)*h6*jMax - 2*h1*h6*jMax + 3*aMax*(h1 - 4*jMax*vf))))/(h5*h6))/(6.*Sqrt(2)*Power(Abs(jMax),2)); + + // std::cout << "HERE" << std::endl; + + // Solution 2 + { + profile.t[0] = (-a0 + aMax)/jMax; + profile.t[1] = -(-Power(a0,2) + Power(aMax,2) + jMax*(h6*h7*jMax + 2*v0) + aMax*(-h6*jMax + h7*jMax - (2*vf)/h6)).real()/(2.*aMax*jMax); + profile.t[2] = aMax/jMax; + profile.t[3] = 0; + profile.t[4] = (-aMax/jMax - h6 + h7).real()/2; + profile.t[5] = 0; + profile.t[6] = profile.t[4]; + + profile.t[2] = (profile.t[2] + profile.t[4]) / 2; + profile.t[4] = profile.t[2]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + + // Solution 4 + { + profile.t[0] = (-a0 + aMax)/jMax; + profile.t[1] = -(-Power(a0,2) + Power(aMax,2) + jMax*(-(h6*h8*jMax) + 2*v0) + aMax*(h6*jMax + h8*jMax + (2*vf)/h6)).real()/(2.*aMax*jMax); + profile.t[2] = aMax/jMax; + profile.t[3] = 0; + profile.t[4] = (-aMax/jMax + h6 + h8).real()/2; + profile.t[5] = 0; + profile.t[6] = profile.t[4]; + + profile.t[2] = (profile.t[2] + profile.t[4]) / 2; + profile.t[4] = profile.t[2]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + + return false; +} + +bool RuckigStep2::time_up_acc0(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + // a3 != 0 + + // Solution 1 + profile.t[0] = (-a0 + aMax)/jMax; + profile.t[1] = -(4*Power(a0,3)*jMax - 12*Power(a0,2)*aMax*jMax + 18*a0*Power(aMax,2)*jMax - 12*Power(aMax,3)*jMax + 12*Power(jMax,3)*p0 - 12*Power(jMax,3)*pf - 12*a0*aMax*Power(jMax,2)*tf + 18*Power(aMax,2)*Power(jMax,2)*tf - 6*aMax*Power(jMax,3)*Power(tf,2) - 12*a0*Power(jMax,2)*v0 + 12*aMax*Power(jMax,2)*v0 + 12*a0*Power(jMax,2)*vf - 12*aMax*Power(jMax,2)*vf + 12*Power(jMax,3)*tf*vf + Sqrt(2)*Sqrt(Power(jMax,2)*(2*Power(Power(a0,3) - 6*Power(aMax,3) + 9*Power(aMax,2)*jMax*tf + 3*a0*aMax*(3*aMax - 2*jMax*tf) + Power(a0,2)*(-6*aMax + 3*jMax*tf) - 6*Power(jMax,2)*(p0 - pf + tf*v0) - 3*aMax*jMax*(jMax*Power(tf,2) - 2*v0 + 2*vf),2) - 9*Power(Power(a0,2) - 2*a0*aMax + 2*(Power(aMax,2) - aMax*jMax*tf + jMax*(-v0 + vf)),3))))/(6.*Power(jMax,2)*(-Power(a0,2) + 2*a0*aMax - 2*Power(aMax,2) + 2*aMax*jMax*tf + 2*jMax*v0 - 2*jMax*vf)); + profile.t[2] = (2*Power(a0,3)*jMax - 12*Power(a0,2)*aMax*jMax + 18*a0*Power(aMax,2)*jMax - 12*Power(aMax,3)*jMax - 12*Power(jMax,3)*p0 + 12*Power(jMax,3)*pf + 6*Power(a0,2)*Power(jMax,2)*tf - 12*a0*aMax*Power(jMax,2)*tf + 18*Power(aMax,2)*Power(jMax,2)*tf - 6*aMax*Power(jMax,3)*Power(tf,2) + 12*aMax*Power(jMax,2)*v0 - 12*Power(jMax,3)*tf*v0 - 12*aMax*Power(jMax,2)*vf + Sqrt(2)*Sqrt(Power(jMax,2)*(2*Power(Power(a0,3) - 6*Power(aMax,3) + 9*Power(aMax,2)*jMax*tf + 3*a0*aMax*(3*aMax - 2*jMax*tf) + Power(a0,2)*(-6*aMax + 3*jMax*tf) - 6*Power(jMax,2)*(p0 - pf + tf*v0) - 3*aMax*jMax*(jMax*Power(tf,2) - 2*v0 + 2*vf),2) - 9*Power(Power(a0,2) - 2*a0*aMax + 2*(Power(aMax,2) - aMax*jMax*tf + jMax*(-v0 + vf)),3))))/(6.*Power(jMax,2)*(-Power(a0,2) + 2*a0*aMax - 2*Power(aMax,2) + 2*aMax*jMax*tf + 2*jMax*v0 - 2*jMax*vf)); + profile.t[3] = (-2*Power(a0,3)*jMax + 12*Power(a0,2)*aMax*jMax - 18*a0*Power(aMax,2)*jMax + 12*Power(aMax,3)*jMax + 12*Power(jMax,3)*p0 - 12*Power(jMax,3)*pf - 6*Power(a0,2)*Power(jMax,2)*tf + 12*a0*aMax*Power(jMax,2)*tf - 18*Power(aMax,2)*Power(jMax,2)*tf + 6*aMax*Power(jMax,3)*Power(tf,2) - 12*aMax*Power(jMax,2)*v0 + 12*Power(jMax,3)*tf*v0 + 12*aMax*Power(jMax,2)*vf + Sqrt(2)*Sqrt(Power(jMax,2)*(2*Power(Power(a0,3) - 6*Power(aMax,3) + 9*Power(aMax,2)*jMax*tf + 3*a0*aMax*(3*aMax - 2*jMax*tf) + Power(a0,2)*(-6*aMax + 3*jMax*tf) - 6*Power(jMax,2)*(p0 - pf + tf*v0) - 3*aMax*jMax*(jMax*Power(tf,2) - 2*v0 + 2*vf),2) - 9*Power(Power(a0,2) - 2*a0*aMax + 2*(Power(aMax,2) - aMax*jMax*tf + jMax*(-v0 + vf)),3))))/(6.*Power(jMax,2)*(-Power(a0,2) + 2*a0*aMax - 2*Power(aMax,2) + 2*aMax*jMax*tf + 2*jMax*v0 - 2*jMax*vf)); + profile.t[4] = -(2*Power(a0,3)*jMax - 6*Power(a0,2)*aMax*jMax + 6*a0*Power(aMax,2)*jMax - 12*Power(jMax,3)*p0 + 12*Power(jMax,3)*pf + 6*Power(a0,2)*Power(jMax,2)*tf - 12*a0*aMax*Power(jMax,2)*tf + 6*Power(aMax,2)*Power(jMax,2)*tf - 6*aMax*Power(jMax,3)*Power(tf,2) - 12*Power(jMax,3)*tf*v0 + Sqrt(2)*Sqrt(Power(jMax,2)*(2*Power(Power(a0,3) - 6*Power(aMax,3) + 9*Power(aMax,2)*jMax*tf + 3*a0*aMax*(3*aMax - 2*jMax*tf) + Power(a0,2)*(-6*aMax + 3*jMax*tf) - 6*Power(jMax,2)*(p0 - pf + tf*v0) - 3*aMax*jMax*(jMax*Power(tf,2) - 2*v0 + 2*vf),2) - 9*Power(Power(a0,2) - 2*a0*aMax + 2*(Power(aMax,2) - aMax*jMax*tf + jMax*(-v0 + vf)),3))))/(6.*Power(jMax,2)*(-Power(a0,2) + 2*a0*aMax - 2*Power(aMax,2) + 2*aMax*jMax*tf + 2*jMax*v0 - 2*jMax*vf)); + profile.t[5] = 0; + profile.t[6] = 0; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + + return false; +} + +bool RuckigStep1::time_up_none(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + if (std::abs(v0) < 1e-14 && std::abs(a0) < 1e-14 && std::abs(vf) < 1e-14) { + profile.t[0] = Power((pf - p0)/(2*jMax),1./3); + profile.t[1] = 0; + profile.t[2] = profile.t[0]; + profile.t[3] = 0; + profile.t[4] = profile.t[0]; + profile.t[5] = 0; + profile.t[6] = profile.t[0]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + return profile.check(pf, vf, vMax, aMax); + } + + if (std::abs(a0) < 1e-14 && std::abs(p0 - pf) < 1e-14) { + // Solution 2 + + profile.t[0] = Sqrt((1 + Sqrt(5))/2.)*Sqrt(-(v0/jMax)); + profile.t[1] = 0; + profile.t[2] = profile.t[0]; + profile.t[3] = 0; + profile.t[4] = ((-1 + Sqrt(5))*Sqrt((1 + Sqrt(5))/2.)*Sqrt(-(v0/jMax)))/2; + profile.t[5] = 0; + profile.t[6] = profile.t[4]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + return profile.check(pf, vf, vMax, aMax); + } + + if (std::abs(a0) < 1e-14 && std::abs(vf) < 1e-14 && std::abs(p0 - pf) < 2e-5) { + // Solution 2, plus epsilon in timing + + double h4 = Sqrt(1 + Sqrt(5)); + double h1 = (16*(27*jMax*Power(p0 - pf,2) + 26*Power(v0,3)))/Power(jMax,3); + auto h2 = PowerComplex(h1 + SqrtComplex(Power(h1,2) - (256*Power(v0,6))/Power(jMax,6)),1./3); + double h3 = Sqrt(-(v0/jMax)); + double h5 = (2*(-4*(4 + 3*Sqrt(5)) + Power(h4,6))*v0)/jMax; + double h6 = (8.*(-4*p0 + 4*pf + Sqrt(2)*(5 + Sqrt(5))*h3*h4*v0))/jMax; + auto h7 = (Power(2,2./3)*h2 - (16*v0)/jMax + (8*Power(2,1./3)*Power(v0,2))/(h2*Power(jMax,2)))/6.; + auto h8 = (-(Sqrt(2)*h3*Power(h4,3)) + 2.*SqrtComplex(h7) + SqrtComplex((Sqrt(2)*h3*Power(h4,3)*h5 + h6)/SqrtComplex(h7) - 4.*h7 + (16*(4 + 3*Sqrt(5))*v0)/jMax - (6*(1 + Sqrt(5))*Power(h4,4)*v0)/jMax))/4.; + + auto eps1 = -(3*Sqrt(2)*(1 + Sqrt(5))*h3*h4*PowerComplex(h8,2)*jMax + 4.*(PowerComplex(h8,3)*jMax + 4*(p0 - pf) - 3.*h8*v0*(1 + Sqrt(5))))/(8.*v0); + auto eps2 = h8; + auto eps4 = (3*Sqrt(2)*(1 + Sqrt(5))*h3*h4*PowerComplex(h8,2)*jMax + 4.*PowerComplex(h8,3)*jMax + 16*(p0 - pf) - 4.*h8*v0*(1 + 3*Sqrt(5)))/(8.*v0); + + profile.t[0] = Sqrt((1 + Sqrt(5))/2.)*h3 + eps1.real(); + profile.t[1] = 0; + profile.t[2] = profile.t[0] - eps1.real() + eps2.real(); + profile.t[3] = 0; + profile.t[4] = ((-1 + Sqrt(5))*Sqrt((1 + Sqrt(5))/2.)*h3)/2; + profile.t[5] = 0; + profile.t[6] = profile.t[4] + eps4.real(); + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + return profile.check(pf, vf, vMax, aMax); + } + + if (std::abs(v0) < 1e-14 && std::abs(vf) < 1e-14) { + // Solution 2 + { + const double h1 = Power(a0,3) + 3*Power(jMax,2)*(p0 - pf); + const double h2 = -Power(a0,8) + 192*Power(a0,5)*Power(jMax,2)*(p0 - pf) + 288*Power(a0,2)*Power(jMax,4)*Power(p0 - pf,2); + const double h3 = Power(a0,2)*jMax*(Power(a0,3) + 3*Power(jMax,2)*(p0 - pf)); + const double h4 = 17*Power(a0,6) + 48*Power(a0,3)*Power(jMax,2)*(p0 - pf) + 72*Power(jMax,4)*Power(p0 - pf,2); + const double h5 = 3*(-576*Power(a0,2)*Power(h3,2) + 96*Power(a0,4)*h1*h3*jMax + 3*Power(a0,12)*Power(jMax,2) + (12*Power(a0,6) + 16*Power(h1,2))*h4*Power(jMax,2)); + const double h6 = 6*Power(3*Power(jMax,4)*(h5 + Sqrt(Power(h5,2) - 3*Power(h2,3)*Power(jMax,4))),1./3); + const double h7 = (h2/h6 + h6/(108.*Power(jMax,4)))/Power(a0,2); + const double h8 = Sqrt(-9*h7 + (3*Power(a0,6) + 4*Power(h1,2))/(Power(a0,4)*Power(jMax,2)))/3.; + const double h9 = (8*h1*(-27 + (8*Power(h1,2))/Power(a0,6)))/(27.*Power(jMax,3)); + const double h10 = (-6*h8 + Sqrt(36*h7 - (9*h9)/h8 + (8*(3*Power(a0,6) + 4*Power(h1,2)))/(Power(a0,4)*Power(jMax,2))) + (4*h1)/(Power(a0,2)*jMax))/12.; + + profile.t[0] = (-6*h8 + Sqrt(36*h7 - (9*h9)/h8 + (8*(3*Power(a0,6) + 4*Power(h1,2)))/(Power(a0,4)*Power(jMax,2))) - (8*a0)/jMax + (12*jMax*(p0 - pf))/Power(a0,2))/12.; + profile.t[1] = 0; + profile.t[2] = h10; + profile.t[3] = 0; + profile.t[4] = (-12*Power(a0,7) + 17*Power(a0,6)*h10*jMax + 12*Power(a0,5)*Power(h10,2)*Power(jMax,2) - 18*Power(a0,4)*Power(jMax,2)*(Power(h10,3)*jMax + 2*p0 - 2*pf) + 48*Power(a0,3)*h10*Power(jMax,3)*(p0 - pf) + 36*Power(a0,2)*Power(h10,2)*Power(jMax,4)*(p0 - pf) + 72*h10*Power(jMax,5)*Power(p0 - pf,2))/(-(Power(a0,6)*jMax) + 48*Power(a0,3)*Power(jMax,3)*(p0 - pf) + 72*Power(jMax,5)*Power(p0 - pf,2)); + profile.t[5] = 0; + profile.t[6] = profile.t[4]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + } + + if (std::abs(a0) < 1e-14 && std::abs(vf) < 1e-14) { + // Solution 2 + { + const double h1 = jMax*Power(p0 - pf,2) - Power(v0,3); + const double h2 = p0 - pf; + const double h3 = 2*Power(jMax,3)*(54*h1*Power(h2,2)*jMax - 36*h1*Power(v0,3) + 180*Power(h2,2)*jMax*Power(v0,3) + Power(v0,6)); + const double h4 = -(Power(jMax,2)*v0*(12*jMax*Power(p0 - pf,2) + 11*Power(v0,3))); + const double h5 = Power(h3 + Sqrt(Power(h3,2) - 4*Power(h4,3)),1./3); + // Be careful of numerical stability of h6 + const long double h6 = (2*PowerLong(2,1./3)*h4 + PowerLong(2,2./3)*PowerLong(h5,2))/(6.*h5*PowerLong(jMax,2)*v0); + const long double h7 = PowerLong(h2,2)/PowerLong(v0,2) - (2*v0)/(3.*jMax); + const long double h8 = (-24*h2)/jMax - (8*PowerLong(h2,3))/PowerLong(v0,3); + const auto h9 = SqrtComplexLong(-h6 + 2*h7 - h8/(4.l*SqrtComplexLong(h6 + h7))); + const auto h10_c = -((long double)h2/v0 + SqrtComplexLong(h6 + h7) - h9)/(2.l); + const double h10 = h10_c.real(); + + profile.t[0] = h10; + profile.t[1] = 0; + profile.t[2] = (-p0 + pf + (-SqrtComplexLong(h6 + h7) + h9).real()*v0)/(2*v0); + profile.t[3] = 0; + profile.t[4] = (Power(h10,2)*jMax*(-p0 + pf)*v0 - Power(h10,3)*jMax*Power(v0,2) + 2*(-p0 + pf)*Power(v0,2) + h10*(jMax*Power(p0 - pf,2) - Power(v0,3)))/(jMax*Power(p0 - pf,2) + Power(v0,3)); + profile.t[5] = 0; + profile.t[6] = profile.t[4]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + } + + double h1 = 2*Power(a0,3) - 3*Power(jMax,2)*(p0 - pf) - 3.*a0*jMax*(v0 - 2*vf); + long double h2 = PowerLong(a0,2) - 2.l*jMax*(v0 - vf); + long double h3 = PowerLong(a0,5) - 24*PowerLong(a0,2)*PowerLong(jMax,2)*(p0 - pf) - 24*PowerLong(jMax,3)*(p0 - pf)*v0 + 4*PowerLong(a0,3)*jMax*(v0 + 3*vf) + 12*a0*PowerLong(jMax,2)*(PowerLong(v0,2) + 2*v0*vf - PowerLong(vf,2)); + long double h4 = 3*PowerLong(a0,4) - 24*a0*PowerLong(jMax,2)*(p0 - pf) - 4*PowerLong(jMax,2)*PowerLong(v0 - vf,2) + 4*PowerLong(a0,2)*jMax*(v0 + 5*vf); + long double h5 = PowerLong(a0,6) - 48*PowerLong(a0,3)*PowerLong(jMax,2)*(p0 - pf) - 144*a0*PowerLong(jMax,3)*(p0 - pf)*v0 + 6*PowerLong(a0,4)*jMax*(v0 + 3*vf) + 36*PowerLong(a0,2)*PowerLong(jMax,2)*(PowerLong(v0,2) + 2*v0*vf - PowerLong(vf,2)) - 72*PowerLong(jMax,3)*(jMax*PowerLong(p0 - pf,2) - (v0 - vf)*PowerLong(v0 + vf,2)); + long double h17 = jMax*(-PowerLong(a0,6) + 48*PowerLong(a0,3)*PowerLong(jMax,2)*(p0 - pf) - 144*a0*PowerLong(jMax,3)*(p0 - pf)*v0 + 6*PowerLong(a0,4)*jMax*(v0 - 3*vf) - 36*PowerLong(a0,2)*PowerLong(jMax,2)*(PowerLong(v0,2) - 2*v0*vf - PowerLong(vf,2)) + 72*PowerLong(jMax,3)*(jMax*PowerLong(p0 - pf,2) + PowerLong(v0 - vf,2)*(v0 + vf))); + long double h6 = -PowerLong(a0,8) + 192*PowerLong(a0,5)*PowerLong(jMax,2)*(p0 - pf) + 8*PowerLong(a0,6)*jMax*(v0 - 5*vf) + 1152*a0*PowerLong(jMax,4)*(p0 - pf)*v0*(v0 + vf) - 192*PowerLong(a0,3)*PowerLong(jMax,3)*(p0 - pf)*(5*v0 + 2*vf) - 120*PowerLong(a0,4)*PowerLong(jMax,2)*(PowerLong(v0,2) - 2*v0*vf - 3*PowerLong(vf,2)) + 96*PowerLong(a0,2)*PowerLong(jMax,3)*(3*jMax*PowerLong(p0 - pf,2) + 5*PowerLong(v0,3) - 3*PowerLong(v0,2)*vf - 15*v0*PowerLong(vf,2) + PowerLong(vf,3)) - 48*PowerLong(jMax,4)*(12*jMax*PowerLong(p0 - pf,2)*(v0 + vf) + PowerLong(v0 - vf,2)*(11*PowerLong(v0,2) + 26.l*v0*vf + 11*PowerLong(vf,2))); + long double h8 = 4*PowerLong(h1,2)/(9*h2) - h4/3; + long double h9 = -2*(h3 - h1*h4/h2 + PowerLong(2*h1,3)/PowerLong(3*h2,2))/3; + long double h7 = 3*(36*h2*PowerLong(h3,2) + 4*PowerLong(2*h1,2)*h5 + 3*h4*(PowerLong(h4,2) - 8*h1*h3 - 4*h2*h5)); + + // Important: Numerical stability of h10 + const auto h10_x = PowerLong(h6,3)/PowerLong(h7,2); + std::complex h10 = PowerComplexLong(3 * h7 * (1.l - SqrtComplexLong(1.l - 3.l*h10_x)),1./3); + if (std::abs(h10_x) < 1e-7) { + h10 = PowerComplexLong(h10_x,1./3)*PowerComplexLong(9*h7/2,1./3) + PowerComplexLong(h10_x,4./3)*PowerComplexLong(9*h7/2,1./3)/4.l + 5.l*PowerComplexLong(h10_x,7./3)*PowerComplexLong(9*h7/2,1./3)/16.l; + } + + const auto h11 = (h6/h10 + h10/3.l)/6.l; + const auto h12 = SqrtComplexLong((h2*(h10 - 3.l*(2*h4 - h6/h10)) + 2*PowerLong(2*h1,2))/18.l)/h2; + + // std::cout << std::setprecision(15) << "---" << std::endl; + // std::cout << "h1-6: " << h1 << " " << h2 << " " << h3 << " " << h4 << " " << h5 << " " << h6 << std::endl; + // std::cout << "h7-12: " << h7 << " " << h8 << " " << h9 << " " << h10 << " " << h11 << " " << h12 << std::endl; + + const auto h12_a = SqrtComplexLong((2*h8 - h11 + h9/h12)/h2); + const auto h12_b = SqrtComplexLong((2*h8 - h11 - h9/h12)/h2); + + const auto h13_c = (h12 - h12_a)/(2.l*jMax) - h1/(3*h2*jMax); + const auto h14_c = (h12 + h12_a)/(2.l*jMax) - h1/(3*h2*jMax); + const auto h15_c = (-h12 + h12_b)/(2.l*jMax) - h1/(3*h2*jMax); + const auto h16_c = (-h12 - h12_b)/(2.l*jMax) - h1/(3*h2*jMax); + // std::cout << "h13-16: " << h13_c << " " << h14_c << " " << h15_c << " " << h16_c << std::endl; + + // Solution 3 + if (h13_c.real() > 0.0 && std::abs(h13_c.imag()) < 2e-8) { + const double h13 = std::abs(h13_c); + + profile.t[0] = h13; + profile.t[1] = 0; + profile.t[2] = (-4*PowerLong(a0,3) + 3.l*((h2*(h12 - h12_a)) + 2*PowerLong(jMax,2)*(p0 - pf)) + 6l*a0*(h2 + jMax*(v0 - 2*vf))).real()/(6.l*h2*jMax); + profile.t[3] = 0; + profile.t[4] = -((Power(a0,7) + 13*Power(a0,6)*h13*jMax + 72*Power(jMax,4)*(-(h13*(jMax*Power(p0 - pf,2) - Power(v0 - vf,3))) + Power(h13,2)*jMax*(p0 - pf)*(v0 - vf) + 2*(p0 - pf)*v0*(v0 - vf) + Power(h13,3)*jMax*Power(v0 - vf,2)) + 6*Power(a0,5)*jMax*(7*Power(h13,2)*jMax + v0 + 3*vf) - 12*Power(a0,3)*Power(jMax,2)*(10*h13*jMax*(p0 - pf) - Power(v0,2) + Power(h13,2)*jMax*(13*v0 - 16*vf) - 2*v0*vf + 3*Power(vf,2)) + 6*Power(a0,4)*Power(jMax,2)*(3*Power(h13,3)*jMax - 8*p0 + 8*pf + h13*(v0 + 19*vf)) - 36*Power(a0,2)*Power(jMax,3)*(Power(h13,2)*jMax*(p0 - pf) + 2*(-p0 + pf)*v0 + 2*Power(h13,3)*jMax*(v0 - vf) + h13*(3*Power(v0,2) + 2*v0*vf - 3*Power(vf,2))) - 72*a0*Power(jMax,3)*(Power(v0,3) + Power(v0,2)*vf - 3*v0*Power(vf,2) + Power(vf,3) + jMax*(Power(p0,2) + Power(pf,2) + h13*pf*(4*v0 - 2*vf) - 2*p0*(pf + 2*h13*v0 - h13*vf) + Power(h13,2)*(-2*Power(v0,2) + 5*v0*vf - 3*Power(vf,2)))))/h17); + profile.t[5] = 0; + profile.t[6] = profile.t[4]; + + // Set average as only sum of t2 and t4 needs to be >0 + profile.t[2] = (profile.t[2] + profile.t[4]) / 2; + profile.t[4] = profile.t[2]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + + // Solution 4 + // 2e-18 comes from sqrt(double precision) + if (h14_c.real() > 0.0 && std::abs(h14_c.imag()) < 2e-8) { + const double h14 = h14_c.real(); + + profile.t[0] = h14; + profile.t[1] = 0; + profile.t[2] = (-4*PowerLong(a0,3) + 3.l*(h2*(h12 + h12_a) + 2*PowerLong(jMax,2)*(p0 - pf)) + 6l*a0*(h2 + jMax*(v0 - 2*vf))).real()/(6.l*h2*jMax); + profile.t[3] = 0; + profile.t[4] = -((Power(a0,7) + 13*Power(a0,6)*h14*jMax + 72*Power(jMax,4)*(-(h14*(jMax*Power(p0 - pf,2) - Power(v0 - vf,3))) + Power(h14,2)*jMax*(p0 - pf)*(v0 - vf) + 2*(p0 - pf)*v0*(v0 - vf) + Power(h14,3)*jMax*Power(v0 - vf,2)) + 6*Power(a0,5)*jMax*(7*Power(h14,2)*jMax + v0 + 3*vf) - 12*Power(a0,3)*Power(jMax,2)*(10*h14*jMax*(p0 - pf) - Power(v0,2) + Power(h14,2)*jMax*(13*v0 - 16*vf) - 2*v0*vf + 3*Power(vf,2)) + 6*Power(a0,4)*Power(jMax,2)*(3*Power(h14,3)*jMax - 8*p0 + 8*pf + h14*(v0 + 19*vf)) - 36*Power(a0,2)*Power(jMax,3)*(Power(h14,2)*jMax*(p0 - pf) + 2*(-p0 + pf)*v0 + 2*Power(h14,3)*jMax*(v0 - vf) + h14*(3*Power(v0,2) + 2*v0*vf - 3*Power(vf,2))) - 72*a0*Power(jMax,3)*(Power(v0,3) + Power(v0,2)*vf - 3*v0*Power(vf,2) + Power(vf,3) + jMax*(Power(p0,2) + Power(pf,2) + h14*pf*(4*v0 - 2*vf) - 2*p0*(pf + 2*h14*v0 - h14*vf) + Power(h14,2)*(-2*Power(v0,2) + 5*v0*vf - 3*Power(vf,2)))))/h17); + profile.t[5] = 0; + profile.t[6] = profile.t[4]; + + // std::cout << std::setprecision(9) << profile.t[0] << std::endl; + // std::cout << profile.t[1] << std::endl; + // std::cout << profile.t[2] << std::endl; + // std::cout << profile.t[3] << std::endl; + // std::cout << profile.t[4] << std::endl; + // std::cout << profile.t[5] << std::endl; + // std::cout << profile.t[6] << std::endl << std::endl; + + profile.t[2] = (profile.t[2] + profile.t[4]) / 2; + profile.t[4] = profile.t[2]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + + // Solution 2 + if (h15_c.real() > 0.0 && std::abs(h15_c.imag()) < 2e-8) { + const double h15 = h15_c.real(); + + profile.t[0] = h15; + profile.t[1] = 0; + profile.t[2] = (-4*PowerLong(a0,3) + 3.l*(h2*(-h12 + h12_b) + 2*PowerLong(jMax,2)*(p0 - pf)) + 6l*a0*(h2 + jMax*(v0 - 2*vf))).real()/(6.l*h2*jMax); + profile.t[3] = 0; + profile.t[4] = -((Power(a0,7) + 13*Power(a0,6)*h15*jMax + 72*Power(jMax,4)*(-(h15*(jMax*Power(p0 - pf,2) - Power(v0 - vf,3))) + Power(h15,2)*jMax*(p0 - pf)*(v0 - vf) + 2*(p0 - pf)*v0*(v0 - vf) + Power(h15,3)*jMax*Power(v0 - vf,2)) + 6*Power(a0,5)*jMax*(7*Power(h15,2)*jMax + v0 + 3*vf) - 12*Power(a0,3)*Power(jMax,2)*(10*h15*jMax*(p0 - pf) - Power(v0,2) + Power(h15,2)*jMax*(13*v0 - 16*vf) - 2*v0*vf + 3*Power(vf,2)) + 6*Power(a0,4)*Power(jMax,2)*(3*Power(h15,3)*jMax - 8*p0 + 8*pf + h15*(v0 + 19*vf)) - 36*Power(a0,2)*Power(jMax,3)*(Power(h15,2)*jMax*(p0 - pf) + 2*(-p0 + pf)*v0 + 2*Power(h15,3)*jMax*(v0 - vf) + h15*(3*Power(v0,2) + 2*v0*vf - 3*Power(vf,2))) - 72*a0*Power(jMax,3)*(Power(v0,3) + Power(v0,2)*vf - 3*v0*Power(vf,2) + Power(vf,3) + jMax*(Power(p0,2) + Power(pf,2) + h15*pf*(4*v0 - 2*vf) - 2*p0*(pf + 2*h15*v0 - h15*vf) + Power(h15,2)*(-2*Power(v0,2) + 5*v0*vf - 3*Power(vf,2)))))/h17); + profile.t[5] = 0; + profile.t[6] = profile.t[4]; + + profile.t[2] = (profile.t[2] + profile.t[4]) / 2; + profile.t[4] = profile.t[2]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + + // Solution 1 + if (h16_c.real() > 0.0 && std::abs(h16_c.imag()) < 2e-8) { + const double h16 = h16_c.real(); + + profile.t[0] = h16; + profile.t[1] = 0; + profile.t[2] = (-4*PowerLong(a0,3) + 3.l*(h2*(-h12 - h12_b) + 2*PowerLong(jMax,2)*(p0 - pf)) + 6l*a0*(h2 + jMax*(v0 - 2*vf))).real()/(6.l*h2*jMax); + profile.t[3] = 0; + profile.t[4] = -((PowerLong(a0,7) + 13*PowerLong(a0,6)*h16*jMax + 72*PowerLong(jMax,4)*(-(h16*(jMax*PowerLong(p0 - pf,2) - PowerLong(v0 - vf,3))) + PowerLong(h16,2)*jMax*(p0 - pf)*(v0 - vf) + 2*(p0 - pf)*v0*(v0 - vf) + PowerLong(h16,3)*jMax*PowerLong(v0 - vf,2)) + 6*PowerLong(a0,5)*jMax*(7*PowerLong(h16,2)*jMax + v0 + 3*vf) - 12*PowerLong(a0,3)*PowerLong(jMax,2)*(10*h16*jMax*(p0 - pf) - PowerLong(v0,2) + PowerLong(h16,2)*jMax*(13*v0 - 16*vf) - 2*v0*vf + 3*Power(vf,2)) + 6*PowerLong(a0,4)*PowerLong(jMax,2)*(3*PowerLong(h16,3)*jMax - 8*p0 + 8*pf + h16*(v0 + 19*vf)) - 36*PowerLong(a0,2)*PowerLong(jMax,3)*(PowerLong(h16,2)*jMax*(p0 - pf) + 2*(-p0 + pf)*v0 + 2*PowerLong(h16,3)*jMax*(v0 - vf) + h16*(3*PowerLong(v0,2) + 2*v0*vf - 3*PowerLong(vf,2))) - 72*a0*PowerLong(jMax,3)*(PowerLong(v0,3) + PowerLong(v0,2)*vf - 3*v0*PowerLong(vf,2) + PowerLong(vf,3) + jMax*(PowerLong(p0,2) + Power(pf,2) + h16*pf*(4*v0 - 2*vf) - 2*p0*(pf + 2*h16*v0 - h16*vf) + PowerLong(h16,2)*(-2*PowerLong(v0,2) + 5*v0*vf - 3*PowerLong(vf,2)))))/h17); + profile.t[5] = 0; + profile.t[6] = profile.t[4]; + + profile.t[2] = (profile.t[2] + profile.t[4]) / 2; + profile.t[4] = profile.t[2]; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + return false; +} + +bool RuckigStep2::time_up_none(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + if (std::abs(v0) < 1e-14 && std::abs(a0) < 1e-14 && std::abs(vf) < 1e-14) { + profile.t[0] = tf/4; + profile.t[1] = 0; + profile.t[2] = profile.t[0]; + profile.t[3] = 0; + profile.t[4] = profile.t[0]; + profile.t[5] = 0; + profile.t[6] = profile.t[0]; + + double jMaxNew = (-32*(p0 - pf))/Power(tf,3); + + profile.set(p0, v0, a0, {jMaxNew, 0, -jMaxNew, 0, -jMaxNew, 0, jMaxNew}); + return profile.check(pf, vf, vMax, aMax); + } + + if (std::abs(v0) < 1e-14 && std::abs(a0) < 1e-14) { + double h1 = Sqrt(Power(tf,2)*(Power(tf,2)*Power(vf,2) + 4*Power(2*p0 - 2*pf + tf*vf,2))); + profile.t[0] = (4*p0 - 4*pf + 3*tf*vf + h1/tf)/(4.*vf); + profile.t[1] = 0; + profile.t[2] = profile.t[0]; + profile.t[3] = 0; + profile.t[4] = profile.t[0]; + profile.t[5] = 0; + profile.t[6] = profile.t[0]; + + double jMaxNew = (4*(-4*p0*tf + 4*pf*tf - 2*Power(tf,2)*vf + h1))/Power(tf,4); + + profile.set(p0, v0, a0, {jMaxNew, 0, -jMaxNew, 0, -jMaxNew, 0, jMaxNew}); + return profile.check(pf, vf, vMax, aMax); + } + + if (std::abs(a0) < 1e-14 && std::abs(vf) < 1e-14) { + // Solution 1 + { + profile.t[0] = (-4*p0 + 4*pf - tf*v0 + Sqrt(Power(tf,2)*(Power(tf,2)*Power(v0,2) + 4*Power(2*p0 - 2*pf + tf*v0,2)))/tf)/(4.*v0); + profile.t[1] = 0; + profile.t[2] = profile.t[0]; + profile.t[3] = 0; + profile.t[4] = (4*p0 - 4*pf + 3*tf*v0 - Sqrt(Power(tf,2)*(Power(tf,2)*Power(v0,2) + 4*Power(2*p0 - 2*pf + tf*v0,2)))/tf)/(4.*v0); + profile.t[5] = 0; + profile.t[6] = profile.t[4]; + + double jMaxNew = (-4*(4*p0*tf - 4*pf*tf + 2*Power(tf,2)*v0 + Sqrt(Power(tf,2)*(Power(tf,2)*Power(v0,2) + 4*Power(2*p0 - 2*pf + tf*v0,2)))))/Power(tf,4); + + profile.set(p0, v0, a0, {jMaxNew, 0, -jMaxNew, 0, -jMaxNew, 0, jMaxNew}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + } + + // Profiles with a3 != 0, Solution UDDU + { + // First acc, then constant + { + std::array polynom; + polynom[0] = 12*Power(jMax,4); + polynom[1] = 24*Power(jMax,3)*(a0 - jMax*tf); + polynom[2] = 12*Power(jMax,2)*(2*Power(a0,2) - 4*a0*jMax*tf + jMax*(jMax*Power(tf,2) - 2*v0 + 2*vf)); + polynom[3] = 8*jMax*(Power(a0,3) - 3*Power(a0,2)*jMax*tf + 3*a0*Power(jMax,2)*Power(tf,2) - 6*Power(jMax,2)*(p0 - pf + tf*vf)); + polynom[4] = Power(a0,4) - 4*Power(a0,3)*jMax*tf + 6*Power(a0,2)*Power(jMax,2)*Power(tf,2) - 24*a0*Power(jMax,2)*(p0 - pf + tf*vf) + 12*Power(jMax,2)*(Power(v0 - vf,2) + jMax*tf*(2*p0 - 2*pf + tf*(v0 + vf))); + auto roots = Roots::solveQuart(polynom); + + for (double t: roots) { + if (t < 0.0 || t > tf) { + continue; + } + + profile.t[0] = t; + profile.t[1] = 0; + profile.t[2] = (-Power(a0,3) + 3*Power(a0,2)*jMax*(4*t + tf) + 6*a0*jMax*(jMax*(3*Power(t,2) - 4*t*tf + Power(tf,2)) + 3*(v0 - vf)) + 6*Power(jMax,2)*(-8*p0 + 8*pf + 2*jMax*Power(t,3) - 3*jMax*Power(t,2)*tf + jMax*t*Power(tf,2) - 2*t*v0 - 3*tf*v0 + 2*t*vf - 5*tf*vf))/(6.*jMax*(-Power(a0,2) + 2*a0*jMax*tf + jMax*(jMax*Power(tf,2) + 4*v0 - 4*vf))); + profile.t[3] = -(a0/jMax) - 2*t + tf; + profile.t[4] = -(5*Power(a0,3) - 9*Power(a0,2)*jMax*(-2*t + tf) + 6*a0*jMax*(3*jMax*t*(t - 2*tf) - v0 + vf) + 6*Power(jMax,2)*(-8*p0 + 8*pf + 2*jMax*Power(t,3) - 3*jMax*Power(t,2)*tf - 6*t*v0 - 3*tf*v0 + 6*t*vf - 5*tf*vf))/(6.*jMax*(-Power(a0,2) + 2*a0*jMax*tf + jMax*(jMax*Power(tf,2) + 4*v0 - 4*vf))); + profile.t[5] = 0; + profile.t[6] = 0; + + // std::cout << t << std::endl; + // std::cout << profile.t[0] << std::endl; + // std::cout << profile.t[1] << std::endl; + // std::cout << profile.t[2] << std::endl; + // std::cout << profile.t[3] << std::endl; + // std::cout << profile.t[4] << " " << -(5*Power(a0,3) - 9*Power(a0,2)*jMax*(-2*t + tf) + 6*a0*jMax*(3*jMax*t*(t - 2*tf) - v0 + vf) + 6*Power(jMax,2)*(-8*p0 + 8*pf + 2*jMax*Power(t,3) - 3*jMax*Power(t,2)*tf - 6*t*v0 - 3*tf*v0 + 6*t*vf - 5*tf*vf)) << std::endl; + // std::cout << "---" << std::endl; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + } + + // First constant, then acc + { + std::array polynom; + polynom[0] = 18*Power(jMax,4)*(Power(a0,2) + 2*a0*jMax*tf - jMax*(jMax*Power(tf,2) - 4*v0 + 4*vf)); + polynom[1] = -12*Power(jMax,3)*(2*Power(a0,3) + 6*Power(a0,2)*jMax*tf + 3*a0*jMax*(jMax*Power(tf,2) + 2*v0 - 2*vf) - 3*Power(jMax,2)*(4*p0 - 4*pf + jMax*Power(tf,3) - 2*tf*v0 + 6*tf*vf)); + polynom[2] = 18*Power(jMax,2)*(Power(a0,4) + 4*Power(a0,3)*jMax*tf + 4*Power(a0,2)*jMax*(jMax*Power(tf,2) + v0 - vf) - 2*a0*Power(jMax,2)*(6*p0 - 6*pf + jMax*Power(tf,3) - 4*tf*v0 + 10*tf*vf) - Power(jMax,2)*(Power(jMax,2)*Power(tf,4) - 8*Power(v0 - vf,2) + 4*jMax*tf*(3*p0 - 3*pf + tf*v0 + 2*tf*vf))); + polynom[3] = -6*jMax*(Power(a0,5) + 5*Power(a0,4)*jMax*tf + 4*Power(a0,3)*jMax*(2*jMax*Power(tf,2) + v0 - vf) - 12*Power(a0,2)*Power(jMax,2)*(2*p0 - 2*pf - tf*v0 + 3*tf*vf) - 6*a0*Power(jMax,2)*(Power(jMax,2)*Power(tf,4) - 2*Power(v0 - vf,2) + 8*jMax*tf*(p0 - pf + tf*vf)) - 12*Power(jMax,3)*(jMax*Power(tf,2)*(p0 - pf + tf*v0) + (v0 - vf)*(2*p0 - 2*pf - tf*v0 + 3*tf*vf))); + polynom[4] = Power(a0,6) + 6*Power(a0,5)*jMax*tf - 72*Power(jMax,3)*(jMax*Power(p0 - pf + tf*v0,2) - Power(v0 - vf,3)) + 6*Power(a0,4)*jMax*(2*jMax*Power(tf,2) + v0 - vf) - 24*Power(a0,3)*Power(jMax,2)*(2*p0 - 2*pf - tf*v0 + 3*tf*vf) - 18*Power(a0,2)*Power(jMax,2)*(Power(jMax,2)*Power(tf,4) - 2*Power(v0 - vf,2) + 8*jMax*tf*(p0 - pf + tf*vf)) - 72*a0*Power(jMax,3)*(jMax*Power(tf,2)*(p0 - pf + tf*v0) + (v0 - vf)*(2*p0 - 2*pf - tf*v0 + 3*tf*vf)); + auto roots = Roots::solveQuart(polynom); + + for (double t: roots) { + if (t < 0.0 || t > tf) { + continue; + } + + profile.t[0] = 0; + profile.t[1] = 0; + profile.t[2] = t; + profile.t[3] = (-Power(a0,4) + 2*Power(a0,3)*jMax*(t - 2*tf) - 3*Power(a0,2)*jMax*(jMax*(2*Power(t,2) - 2*t*tf + Power(tf,2)) + 2*(v0 - vf)) + 6*a0*Power(jMax,2)*(4*p0 - 4*pf + tf*(jMax*(-2*Power(t,2) + t*tf + Power(tf,2)) - 2*v0 + 6*vf)) + 6*Power(jMax,2)*(Power(jMax,2)*t*(t - tf)*Power(tf,2) - 4*Power(v0 - vf,2) + jMax*(-8*p0*t + 8*pf*t + 4*p0*tf - 4*pf*tf - 4*Power(t,2)*v0 + 3*Power(tf,2)*v0 + 4*Power(t,2)*vf - 8*t*tf*vf + Power(tf,2)*vf)))/(jMax*(Power(a0,3) + 3*Power(a0,2)*jMax*tf + 6*a0*jMax*(v0 - vf) + 6*Power(jMax,2)*(2*p0 - 2*pf + tf*(v0 + vf)))); + profile.t[4] = (Power(a0,4) - 2*Power(a0,3)*jMax*(t - 2*tf) + 3*Power(a0,2)*jMax*(jMax*Power(t - tf,2) + 2*(v0 - vf)) + 3*a0*Power(jMax,2)*(-2*p0 + 2*pf + 2*jMax*Power(t,2)*tf - jMax*t*Power(tf,2) - jMax*Power(tf,3) - 2*t*v0 + 4*tf*v0 + 2*t*vf - 6*tf*vf) - 3*Power(jMax,2)*(Power(jMax,2)*t*(t - tf)*Power(tf,2) - 4*Power(v0 - vf,2) + 2*jMax*(-2*p0*t + 2*pf*t + p0*tf - pf*tf - 2*Power(t,2)*v0 + t*tf*v0 + Power(tf,2)*v0 + 2*Power(t,2)*vf - 3*t*tf*vf)))/(jMax*(Power(a0,3) + 3*Power(a0,2)*jMax*tf + 6*a0*jMax*(v0 - vf) + 6*Power(jMax,2)*(2*p0 - 2*pf + tf*(v0 + vf)))); + profile.t[5] = 0; + profile.t[6] = (Power(a0,3)*(-t + tf) + 3*Power(a0,2)*jMax*(Power(t,2) - t*tf + Power(tf,2)) + 3*a0*jMax*(-6*p0 + 6*pf - tf*(jMax*(-2*Power(t,2) + t*tf + Power(tf,2)) - 2*v0 + 8*vf)) - 3*jMax*(Power(jMax,2)*t*(t - tf)*Power(tf,2) - 4*Power(v0 - vf,2) + jMax*(-8*p0*t + 8*pf*t + 2*p0*tf - 2*pf*tf - 4*Power(t,2)*v0 + 2*Power(tf,2)*v0 + 4*Power(t,2)*vf - 8*t*tf*vf)))/(Power(a0,3) + 3*Power(a0,2)*jMax*tf + 6*a0*jMax*(v0 - vf) + 6*Power(jMax,2)*(2*p0 - 2*pf + tf*(v0 + vf))); + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, -jMax, 0, jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + } + } + + // Profiles with a3 != 0, Solution UDUD + { + // First constant, then acc + { + std::array polynom; + polynom[0] = 18*Power(jMax,4)*Power(a0 - jMax*tf,2); + polynom[1] = 36*Power(jMax,4)*(a0 - jMax*tf)*(jMax*Power(tf,2) + 2*v0 - 2*vf); + polynom[2] = 6*Power(jMax,2)*(-2*Power(a0,4) + 8*Power(a0,3)*jMax*tf - 12*Power(a0,2)*Power(jMax,2)*Power(tf,2) + 6*a0*Power(jMax,2)*(2*p0 - 2*pf + jMax*Power(tf,3) + 2*tf*vf) + 3*Power(jMax,2)*(Power(jMax,2)*Power(tf,4) + 4*Power(v0 - vf,2) + 4*jMax*tf*(-p0 + pf + tf*v0 - 2*tf*vf))); + polynom[3] = 6*jMax*(Power(a0,5) - 5*Power(a0,4)*jMax*tf + 4*Power(a0,3)*jMax*(2*jMax*Power(tf,2) - v0 + vf) - 12*Power(a0,2)*Power(jMax,2)*(2*p0 - 2*pf - tf*v0 + 3*tf*vf) - 12*Power(jMax,3)*(jMax*Power(tf,2)*(p0 - pf + tf*v0) + (v0 - vf)*(-2*p0 + 2*pf + tf*v0 - 3*tf*vf)) - 6*a0*Power(jMax,2)*(Power(jMax,2)*Power(tf,4) - 2*Power(v0 - vf,2) - 8*jMax*tf*(p0 - pf + tf*vf))); + polynom[4] = -Power(a0,6) + 6*Power(a0,5)*jMax*tf + 72*Power(jMax,3)*(jMax*Power(p0 - pf + tf*v0,2) + Power(v0 - vf,3)) - 6*Power(a0,4)*jMax*(2*jMax*Power(tf,2) - v0 + vf) + 24*Power(a0,3)*Power(jMax,2)*(2*p0 - 2*pf - tf*v0 + 3*tf*vf) + 72*a0*Power(jMax,3)*(jMax*Power(tf,2)*(p0 - pf + tf*v0) + (v0 - vf)*(-2*p0 + 2*pf + tf*v0 - 3*tf*vf)) + 18*Power(a0,2)*Power(jMax,2)*(Power(jMax,2)*Power(tf,4) - 2*Power(v0 - vf,2) - 8*jMax*tf*(p0 - pf + tf*vf)); + auto roots = Roots::solveQuart(polynom); + + for (double t: roots) { + if (t < 0.0 || t > tf) { + continue; + } + + profile.t[0] = 0; + profile.t[1] = 0; + profile.t[2] = t; + profile.t[3] = -((Power(a0,5) - Power(a0,4)*jMax*(4*t + 5*tf) + 2*Power(a0,3)*jMax*(jMax*(3*Power(t,2) + 8*t*tf + 4*Power(tf,2)) - 2*v0 + 2*vf) + 6*Power(a0,2)*Power(jMax,2)*(-10*p0 + 10*pf + 2*jMax*Power(t,3) - 3*jMax*Power(t,2)*tf - 3*jMax*t*Power(tf,2) + jMax*Power(tf,3) + 2*t*v0 + 2*tf*v0 - 2*t*vf - 12*tf*vf) + 12*Power(jMax,3)*(Power(jMax,2)*t*Power(t - tf,2)*Power(tf,2) + (v0 - vf)*(2*p0 - 2*pf + 2*t*v0 - 3*tf*v0 - 2*t*vf + 5*tf*vf) - jMax*tf*(2*p0*(t + 2*tf) - 2*pf*(t + 2*tf) + 3*Power(t,2)*v0 - 3*t*tf*v0 + 3*Power(tf,2)*v0 - 3*Power(t,2)*vf + 5*t*tf*vf + Power(tf,2)*vf)) - 12*a0*Power(jMax,2)*(Power(jMax,2)*Power(t - tf,2)*tf*(2*t + tf) - 3*Power(v0 - vf,2) - jMax*(2*p0*(t + 5*tf) - 2*pf*(t + 5*tf) + 3*Power(t,2)*v0 - 2*t*tf*v0 + 2*Power(tf,2)*v0 - 3*Power(t,2)*vf + 4*t*tf*vf + 8*Power(tf,2)*vf)))/(jMax*(Power(a0,4) - 4*Power(a0,3)*jMax*tf + 6*Power(a0,2)*Power(jMax,2)*Power(tf,2) - 24*a0*Power(jMax,2)*(p0 - pf + tf*vf) + 12*Power(jMax,2)*(Power(v0 - vf,2) + jMax*tf*(2*p0 - 2*pf + tf*(v0 + vf)))))); + profile.t[4] = (-2*Power(a0,4)*t + Power(a0,3)*(jMax*(3*Power(t,2) + 8*t*tf - Power(tf,2)) - 2*v0 + 2*vf) + 3*Power(a0,2)*jMax*(-6*p0 + 6*pf + 2*jMax*Power(t,3) - 3*jMax*Power(t,2)*tf - 3*jMax*t*Power(tf,2) + 2*jMax*Power(tf,3) + 2*t*v0 + 2*tf*v0 - 2*t*vf - 8*tf*vf) + 6*Power(jMax,2)*(Power(jMax,2)*t*Power(t - tf,2)*Power(tf,2) + 2*(v0 - vf)*(p0 - pf + t*v0 - tf*v0 - t*vf + 2*tf*vf) + jMax*tf*(-2*p0*(t + tf) + 2*pf*(t + tf) - 3*Power(t,2)*v0 + 3*t*tf*v0 - 2*Power(tf,2)*v0 + 3*Power(t,2)*vf - 5*t*tf*vf)) - 6*a0*jMax*(Power(jMax,2)*Power(t - tf,2)*tf*(2*t + tf) - 2*Power(v0 - vf,2) - jMax*(2*p0*(t + 3*tf) - 2*pf*(t + 3*tf) + 3*Power(t,2)*v0 - 2*t*tf*v0 + Power(tf,2)*v0 - 3*Power(t,2)*vf + 4*t*tf*vf + 5*Power(tf,2)*vf)))/(Power(a0,4) - 4*Power(a0,3)*jMax*tf + 6*Power(a0,2)*Power(jMax,2)*Power(tf,2) - 24*a0*Power(jMax,2)*(p0 - pf + tf*vf) + 12*Power(jMax,2)*(Power(v0 - vf,2) + jMax*tf*(2*p0 - 2*pf + tf*(v0 + vf)))); + profile.t[5] = 0; + profile.t[6] = (Power(a0,5) - Power(a0,4)*jMax*(3*t + 4*tf) + Power(a0,3)*jMax*(jMax*(3*Power(t,2) + 12*t*tf + 5*Power(tf,2)) - 2*v0 + 2*vf) + 3*Power(a0,2)*Power(jMax,2)*(-14*p0 + 14*pf + 2*jMax*Power(t,3) - 3*jMax*Power(t,2)*tf - 5*jMax*t*Power(tf,2) + 2*jMax*Power(tf,3) + 2*t*v0 + 2*tf*v0 - 2*t*vf - 16*tf*vf) + 6*Power(jMax,3)*(Power(jMax,2)*t*Power(t - tf,2)*Power(tf,2) - 2*(v0 - vf)*(-p0 + pf + tf*v0 - 2*tf*vf) + jMax*tf*(6*pf*t + 2*pf*tf - 2*p0*(3*t + tf) - 3*Power(t,2)*v0 + t*tf*v0 - 2*Power(tf,2)*v0 + 3*Power(t,2)*vf - 7*t*tf*vf)) - 6*a0*Power(jMax,2)*(Power(jMax,2)*Power(t - tf,2)*tf*(2*t + tf) - 4*Power(v0 - vf,2) - jMax*(6*p0*t - 6*pf*t + 10*p0*tf - 10*pf*tf + 3*Power(t,2)*v0 - 2*t*tf*v0 + 3*Power(tf,2)*v0 - 3*Power(t,2)*vf + 8*t*tf*vf + 7*Power(tf,2)*vf)))/(jMax*(Power(a0,4) - 4*Power(a0,3)*jMax*tf + 6*Power(a0,2)*Power(jMax,2)*Power(tf,2) - 24*a0*Power(jMax,2)*(p0 - pf + tf*vf) + 12*Power(jMax,2)*(Power(v0 - vf,2) + jMax*tf*(2*p0 - 2*pf + tf*(v0 + vf))))); + + // std::cout << t << std::endl; + // std::cout << profile.t[0] << std::endl; + // std::cout << profile.t[1] << std::endl; + // std::cout << profile.t[2] << std::endl; + // std::cout << profile.t[3] << std::endl; + // std::cout << profile.t[4] << " " << std::endl; + // std::cout << "---" << std::endl; + + profile.set(p0, v0, a0, {jMax, 0, -jMax, 0, jMax, 0, -jMax}); + if (profile.check(pf, vf, vMax, aMax)) { + return true; + } + } + } + } + + double h1 = 8*p0 - 8*pf + a0*Power(tf,2) + 4*tf*v0 + 4*tf*vf; + double h2 = -16*a0*p0 + 16*a0*pf + Power(a0,2)*Power(tf,2) + 8*Power(v0,2) - 16*a0*tf*vf - 16*v0*vf + 8*Power(vf,2); + double h3 = 432*Power(h2,3) + 3888*Power(a0,4)*Power(h1,2)*Power(tf,2) + 2592*Power(a0,3)*h1*h2*Power(tf,2) + 1296*Power(a0,4)*h2*Power(tf,4) - 1296*Power(a0,6)*Power(tf,6); + double h4 = 36*Power(h2,2) + 144*Power(a0,3)*h1*Power(tf,2) - 36*Power(a0,4)*Power(tf,4); + auto h5 = PowerComplex(h3 + SqrtComplex(Power(h3,2) - 4*Power(h4,3)),1./3); + auto h6 = SqrtComplex((4*Power(h1,2))/Power(tf,6) + (4*h2)/(3.*Power(tf,4)) - (Power(2,1./3)*h4)/(9.*h5*Power(tf,4)) - h5/(9.*Power(2,1./3)*Power(tf,4))); + auto h7 = (8*Power(h1,2))/Power(tf,6) + (8*h2)/(3.*Power(tf,4)) + (Power(2,1./3)*h4)/(9.*h5*Power(tf,4)) + h5/(9.*Power(2,1./3)*Power(tf,4)); + auto h8 = ((-64*Power(h1,3))/Power(tf,9) - (32*h1*h2)/Power(tf,7) + (32*Power(a0,3))/(3.*Power(tf,3)))/(4.*h6); + auto h9 = -h6/2. - SqrtComplex(h7 + h8)/2. - h1/Power(tf,3); + auto h10 = -h6/2. + SqrtComplex(h7 + h8)/2. - h1/Power(tf,3); + auto h11 = h6/2. - SqrtComplex(h7 + h8)/2. - h1/Power(tf,3); + auto h12 = h6/2. + SqrtComplex(h7 + h8)/2. - h1/Power(tf,3); + + // std::cout << h9 << " " << h10 << " " << h11 << " " << h12 << std::endl; + + return false; +} + +bool RuckigStep1::time_down_acc0_acc1_vel(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + return time_up_acc0_acc1_vel(profile, p0, v0, a0, pf, vf, -vMax, -aMax, -jMax); +} + +bool RuckigStep2::time_down_acc0_acc1_vel(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + return time_up_acc0_acc1_vel(profile, tf, p0, v0, a0, pf, vf, -vMax, -aMax, -jMax); +} + +bool RuckigStep1::time_down_acc1_vel(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + return time_up_acc1_vel(profile, p0, v0, a0, pf, vf, -vMax, -aMax, -jMax); +} + +bool RuckigStep2::time_down_acc1_vel(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + return time_up_acc1_vel(profile, tf, p0, v0, a0, pf, vf, -vMax, -aMax, -jMax); +} + +bool RuckigStep1::time_down_acc0_vel(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + return time_up_acc0_vel(profile, p0, v0, a0, pf, vf, -vMax, -aMax, -jMax); +} + +bool RuckigStep2::time_down_acc0_vel(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + return time_up_acc0_vel(profile, tf, p0, v0, a0, pf, vf, -vMax, -aMax, -jMax); +} + +bool RuckigStep1::time_down_vel(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + return time_up_vel(profile, p0, v0, a0, pf, vf, -vMax, -aMax, -jMax); +} + +bool RuckigStep2::time_down_vel(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + return time_up_vel(profile, tf, p0, v0, a0, pf, vf, -vMax, -aMax, -jMax); +} + +bool RuckigStep1::time_down_acc0_acc1(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + return time_up_acc0_acc1(profile, p0, v0, a0, pf, vf, -vMax, -aMax, -jMax); +} + +bool RuckigStep2::time_down_acc0_acc1(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + return time_up_acc0_acc1(profile, tf, p0, v0, a0, pf, vf, -vMax, -aMax, -jMax); +} + +bool RuckigStep1::time_down_acc1(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + return time_up_acc1(profile, p0, v0, a0, pf, vf, -vMax, -aMax, -jMax); +} + +bool RuckigStep2::time_down_acc1(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + return time_up_acc1(profile, tf, p0, v0, a0, pf, vf, -vMax, -aMax, -jMax); +} + +bool RuckigStep1::time_down_acc0(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + return time_up_acc0(profile, p0, v0, a0, pf, vf, -vMax, -aMax, -jMax); +} + +bool RuckigStep2::time_down_acc0(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + return time_up_acc0(profile, tf, p0, v0, a0, pf, vf, -vMax, -aMax, -jMax); +} + +bool RuckigStep1::time_down_none(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + return time_up_none(profile, p0, v0, a0, pf, vf, -vMax, -aMax, -jMax); +} + +bool RuckigStep2::time_down_none(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + return time_up_none(profile, tf, p0, v0, a0, pf, vf, -vMax, -aMax, -jMax); +} + +bool RuckigStep1::get_profile(Profile& profile, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + // Test all cases to get ones that match + if (pf > p0) { + if (time_up_acc0_acc1_vel(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC0_ACC1_VEL; + + } else if (time_down_acc0_acc1_vel(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC0_ACC1_VEL; + + } else if (time_up_acc1_vel(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC1_VEL; + + } else if (time_down_acc1_vel(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC1_VEL; + + } else if (time_up_acc0_vel(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC0_VEL; + + } else if (time_down_acc0_vel(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC0_VEL; + + } else if (time_up_vel(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_VEL; + + } else if (time_down_vel(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_VEL; + + } else if (time_up_none(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_NONE; + + } else if (time_down_none(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_NONE; + + } else if (time_up_acc1(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC1; + + } else if (time_down_acc1(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC1; + + } else if (time_up_acc0(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC0; + + } else if (time_down_acc0(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC0; + + } else if (time_up_acc0_acc1(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC0_ACC1; + + } else if (time_down_acc0_acc1(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC0_ACC1; + + } else { + return false; + } + + } else { + if (time_down_acc0_acc1_vel(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC0_ACC1_VEL; + + } else if (time_up_acc0_acc1_vel(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC0_ACC1_VEL; + + } else if (time_down_acc1_vel(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC1_VEL; + + } else if (time_up_acc1_vel(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC1_VEL; + + } else if (time_down_acc0_vel(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC0_VEL; + + } else if (time_up_acc0_vel(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC0_VEL; + + } else if (time_down_vel(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_VEL; + + } else if (time_up_vel(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_VEL; + + } else if (time_down_none(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_NONE; + + } else if (time_up_none(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_NONE; + + } else if (time_down_acc1(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC1; + + } else if (time_up_acc1(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC1; + + } else if (time_down_acc0(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC0; + + } else if (time_up_acc0(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC0; + + } else if (time_down_acc0_acc1(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC0_ACC1; + + } else if (time_up_acc0_acc1(profile, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC0_ACC1; + + } else { + return false; + } + } + return true; +} + +bool RuckigStep2::get_profile(Profile& profile, double tf, double p0, double v0, double a0, double pf, double vf, double vMax, double aMax, double jMax) { + // Test all cases to get ones that match + if (pf > p0) { + if (time_up_none(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_NONE; + + } else if (time_down_none(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_NONE; + + } else if (time_up_vel(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_VEL; + + } else if (time_down_vel(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_VEL; + + } else if (time_up_acc0_acc1_vel(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC0_ACC1_VEL; + + } else if (time_down_acc0_acc1_vel(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC0_ACC1_VEL; + + } else if (time_up_acc0_vel(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC0_VEL; + + } else if (time_down_acc0_vel(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC0_VEL; + + } else if (time_up_acc1_vel(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC1_VEL; + + } else if (time_down_acc1_vel(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC1_VEL; + + } else if (time_up_acc0_acc1(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC0_ACC1; + + } else if (time_down_acc0_acc1(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC0_ACC1; + + } else if (time_up_acc1(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC1; + + } else if (time_down_acc1(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC1; + + } else if (time_up_acc0(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC0; + + } else if (time_down_acc0(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC0; + + } else { + return false; + } + + } else { + if (time_down_none(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_NONE; + + } else if (time_up_none(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_NONE; + + } else if (time_down_vel(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_VEL; + + } else if (time_up_vel(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_VEL; + + } else if (time_down_acc0_acc1_vel(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC0_ACC1_VEL; + + } else if (time_up_acc0_acc1_vel(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC0_ACC1_VEL; + + } else if (time_down_acc0_vel(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC0_VEL; + + } else if (time_up_acc0_vel(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC0_VEL; + + } else if (time_down_acc1_vel(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC1_VEL; + + } else if (time_up_acc1_vel(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC1_VEL; + + } else if (time_down_acc0_acc1(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC0_ACC1; + + } else if (time_up_acc0_acc1(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC0_ACC1; + + } else if (time_down_acc1(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC1; + + } else if (time_up_acc1(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC1; + + } else if (time_down_acc0(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::DOWN_ACC0; + + } else if (time_up_acc0(profile, tf, p0, v0, a0, pf, vf, vMax, aMax, jMax)) { + profile.type = Profile::Type::UP_ACC0; + + } else { + return false; + } + } + return true; +} + +inline double v_at_t(double v0, double a0, double j, double t) { + return v0 + a0 * t + j * std::pow(t, 2) / 2; +} + +void RuckigStep1::get_brake_trajectory(double v0, double a0, double vMax, double aMax, double jMax, std::array& t_brake, std::array& j_brake) { + t_brake[0] = 0.0; + t_brake[1] = 0.0; + j_brake[0] = 0.0; + j_brake[1] = 0.0; + + const double a0_sq_jMax = std::pow(a0, 2)/(2 * jMax) - vMax; + + if (a0 > aMax) { + j_brake[0] = -jMax; + + double t_to_a_max = (a0 - aMax) / jMax; + double v_at_a_max = v_at_t(v0, a0, -jMax, t_to_a_max); + + t_brake[0] = t_to_a_max + 2e-15; + + double t_to_a_zero = a0 / jMax; + double v_at_a_zero = v_at_t(v0, a0, -jMax, t_to_a_zero); + + if (v_at_a_zero > vMax) { + t_brake[0] = t_to_a_zero + 2e-15; + v_at_a_max = v_at_a_zero; + } + + if (v_at_a_max < -vMax) { + double t_to_v_max_while_a_max = -(v_at_a_max + vMax)/aMax; + double t_to_v_max_in_reverse_j_direction = (-std::pow(aMax, 2) - 2 * jMax * v_at_a_max + 2 * jMax * vMax)/(2*aMax*jMax); + t_brake[1] = std::min(t_to_v_max_while_a_max, t_to_v_max_in_reverse_j_direction); + + } else if (v_at_a_max > vMax) { + double t_to_other_a_max = (a0 + aMax) / jMax - 2e-15; + double t_to_v_max = -(-a0 - std::sqrt(std::pow(a0,2) + 2 * jMax * v0 - 2 * jMax * vMax))/jMax; + double t_to_v_max_brake_for_other = (2 * a0 + std::sqrt(2) * std::sqrt(std::pow(a0, 2) + 2 * jMax * (v0 + vMax)))/(2 * jMax); + + // std::cout << t_to_other_a_max << " " << t_to_v_max << " " << t_to_v_max_brake_for_other << std::endl; + + if (t_to_v_max_brake_for_other < t_to_other_a_max && t_to_v_max_brake_for_other < t_to_v_max) { + t_brake[0] = t_to_v_max_brake_for_other - 2e-15; + + } else if (t_to_other_a_max < t_to_v_max) { + double v_at_a_other_a_max = v_at_t(v0, a0, -jMax, t_to_other_a_max); + double t_to_v_max_while_a_max = (v_at_a_other_a_max - vMax)/aMax; + double t_to_v_max_brake_for_other_a_max = -(std::pow(aMax, 2) - 2 * jMax * (v_at_a_max + vMax))/(2 * aMax * jMax); + + t_brake[0] = t_to_other_a_max; + t_brake[1] = std::min(t_to_v_max_while_a_max, t_to_v_max_brake_for_other_a_max); + + } else { + t_brake[0] = t_to_v_max + 2e-15; + } + } + + } else if (a0 < -aMax) { + j_brake[0] = jMax; + + double t_to_a_max = -(a0 + aMax) / jMax; + double v_at_a_max = v_at_t(v0, a0, jMax, t_to_a_max); + + t_brake[0] = t_to_a_max + 2e-15; + + double t_to_a_zero = -a0 / jMax; + double v_at_a_zero = v_at_t(v0, a0, jMax, t_to_a_zero); + if (v_at_a_zero < -vMax) { + t_brake[0] = t_to_a_zero + 2e-15; + v_at_a_max = v_at_a_zero; + } + + if (v_at_a_max > vMax) { + double t_to_v_max_while_a_max = (v_at_a_max - vMax)/aMax; + double t_to_v_max_in_reverse_j_direction = (-std::pow(aMax, 2) + 2 * jMax * v_at_a_max + 2 * jMax * vMax)/(2*aMax*jMax); + t_brake[1] = std::min(t_to_v_max_while_a_max, t_to_v_max_in_reverse_j_direction); + // {a1 == -aMax, v1 == v0 - aMax * t1, -vMax == v1 + a1 * t2 + jMax / 2 * t2^2, 0 == a1 + jMax t2}, {t1, t2, a1, v1} + + } else if (v_at_a_max < -vMax) { + double t_to_other_a_max = -(a0 - aMax) / jMax - 2e-15; + double t_to_v_max = (-a0 + std::sqrt(std::pow(a0,2) - 2 * jMax * (v0 + vMax)))/jMax; + + if (t_to_other_a_max < t_to_v_max) { + double v_at_a_other_a_max = v_at_t(v0, a0, jMax, t_to_other_a_max); + double t_to_v_max_while_a_max = -(v_at_a_other_a_max + vMax)/aMax; + double t_to_v_max_brake_for_other_a_max = -(std::pow(aMax, 2) + 2 * jMax * (v_at_a_max - vMax))/(2 * aMax * jMax); + + t_brake[0] = t_to_other_a_max; + t_brake[1] = std::min(t_to_v_max_while_a_max, t_to_v_max_brake_for_other_a_max); + } else { + t_brake[0] = t_to_v_max + 2e-15; + } + } + + } else if ((v0 > vMax && (a0 > 0 || a0_sq_jMax < v0)) || (a0 > 0 && a0_sq_jMax > -v0)) { + j_brake[0] = -jMax; + double t_to_a_max = (a0 + aMax)/jMax; + double t_to_v_max_in_j_direction = (a0 + std::sqrt(std::pow(a0, 2) - 2 * jMax * (vMax - v0)))/jMax; + double t_to_v_max_in_reverse_j_direction = (2 * a0 + std::sqrt(2*(std::pow(a0, 2) + 2 * jMax * (v0 + vMax))))/(2 * jMax); + + if (t_to_a_max < t_to_v_max_in_j_direction && t_to_a_max < t_to_v_max_in_reverse_j_direction) { + double v_at_a_max = v_at_t(v0, a0, -jMax, t_to_a_max); + double t_to_v_max_while_a_max = (v_at_a_max - vMax)/aMax; + double t_to_v_max_in_reverse_j_direction = -(std::pow(aMax, 2) - 2 * jMax * (v_at_a_max + vMax))/(2 * aMax * jMax); + + t_brake[0] = t_to_a_max; + t_brake[1] = std::min(t_to_v_max_while_a_max, t_to_v_max_in_reverse_j_direction); + } else { + t_brake[0] = std::min(t_to_v_max_in_j_direction, t_to_v_max_in_reverse_j_direction); + } + + t_brake[0] = std::max(t_brake[0] - 2e-15, 0.0); + + } else if ((v0 < -vMax && (a0 < 0 || a0_sq_jMax > v0)) || (a0 < 0 && a0_sq_jMax > v0)) { + j_brake[0] = jMax; + double t_to_a_max = -(a0 - aMax)/jMax; + double t_to_v_max_in_j_direction = (-a0 + std::sqrt(std::pow(a0, 2) + 2 * jMax * (-vMax - v0)))/jMax; + double t_to_v_max_in_reverse_j_direction = (-2 * a0 + std::sqrt(2*(std::pow(a0, 2) - 2 * jMax * (v0 - vMax))))/(2 * jMax); + + if (t_to_a_max < t_to_v_max_in_j_direction && t_to_a_max < t_to_v_max_in_reverse_j_direction) { + double v_at_a_max = v_at_t(v0, a0, jMax, t_to_a_max); + double t_to_v_max_while_a_max = -(v_at_a_max + vMax)/aMax; + double t_to_v_max_in_reverse_j_direction = -(std::pow(aMax, 2) + 2 * jMax * (v_at_a_max - vMax))/(2 * aMax * jMax); + + t_brake[0] = t_to_a_max; + t_brake[1] = std::min(t_to_v_max_while_a_max, t_to_v_max_in_reverse_j_direction); + } else { + t_brake[0] = std::min(t_to_v_max_in_j_direction, t_to_v_max_in_reverse_j_direction); + } + + t_brake[0] = std::max(t_brake[0] - 2e-15, 0.0); + } + + // std::cout << t_brake[0] << " " << t_brake[1] << std::endl; +} + +} // namespace ruckig diff --git a/test/otg-test.cpp b/test/otg-test.cpp new file mode 100644 index 00000000..7aa0513f --- /dev/null +++ b/test/otg-test.cpp @@ -0,0 +1,296 @@ +#define CATCH_CONFIG_MAIN +#include + +#include +#include + +#include +#include +#include + +#ifdef WITH_REFLEXXES +#include +#endif + + +using namespace ruckig; +using Vec1 = InputParameter<1>::Vector; +using Vec2 = InputParameter<2>::Vector; +using Vec = InputParameter<3>::Vector; + + +template +void check(OTGType& otg, InputParameter& input, double time) { + OutputParameter output; + + while (otg.update(input, output) == Result::Working) { + input.current_position = output.new_position; + input.current_velocity = output.new_velocity; + input.current_acceleration = output.new_acceleration; + } + + CHECK( output.duration == Approx(time).margin(0.005) ); +} + + +template +void check_calculation(OTGType& otg, InputParameter& input) { + OutputParameter output; + + CAPTURE( input.current_position ); + CAPTURE( input.current_velocity ); + CAPTURE( input.current_acceleration ); + CAPTURE( input.target_position ); + CAPTURE( input.target_velocity ); + CAPTURE( input.max_velocity ); + CAPTURE( input.max_acceleration ); + CAPTURE( input.max_jerk ); + + auto result = otg.update(input, output); + + CHECK( result == Result::Working ); + CHECK_FALSE( std::isnan(output.duration) ); + + for (size_t dof = 0; dof < DOFs; dof += 1) { + CHECK_FALSE( std::isnan(output.new_position[dof]) ); + CHECK_FALSE( std::isnan(output.new_velocity[dof]) ); + CHECK_FALSE( std::isnan(output.new_acceleration[dof]) ); + } +} + + +template +void check_comparison(OTGType& otg, InputParameter& input, OTGCompType& otg_comparison) { + OutputParameter output; + + CAPTURE( input.current_position ); + CAPTURE( input.current_velocity ); + CAPTURE( input.current_acceleration ); + CAPTURE( input.target_position ); + CAPTURE( input.target_velocity ); + CAPTURE( input.max_velocity ); + CAPTURE( input.max_acceleration ); + CAPTURE( input.max_jerk ); + + auto result = otg.update(input, output); + CHECK( result == Result::Working ); + + OutputParameter output_comparison; + auto result_comparison = otg_comparison.update(input, output_comparison); + CHECK( output.duration == Approx(output_comparison.duration) ); + + double half_duration = output.duration / 2; + otg.atTime(half_duration, output); + otg_comparison.atTime(half_duration, output_comparison); + + for (size_t dof = 0; dof < DOFs; dof += 1) { + CHECK_FALSE( std::isnan(output.new_position[dof]) ); + CHECK_FALSE( std::isnan(output.new_velocity[dof]) ); + CHECK_FALSE( std::isnan(output.new_acceleration[dof]) ); + + if constexpr (DOFs <= 2) { + CHECK( output.new_position[dof] == Approx(output_comparison.new_position[dof]).margin(1e-7) ); + CHECK( output.new_velocity[dof] == Approx(output_comparison.new_velocity[dof]).margin(1e-7) ); + CHECK( output.new_acceleration[dof] == Approx(output_comparison.new_acceleration[dof]).margin(1e-7) ); + } + } +} + + +TEST_CASE("Quintic") { + InputParameter<3> input; + input.current_position = {0.0, 0.0, 0.0}; + input.current_velocity = {0.0, 0.0, 0.0}; + input.current_acceleration = {0.0, 0.0, 0.0}; + input.target_position = {1.0, 1.0, 1.0}; + input.target_velocity = {0.0, 0.0, 0.0}; + input.target_acceleration = {0.0, 0.0, 0.0}; + input.max_velocity = {1.0, 1.0, 1.0}; + input.max_acceleration = {1.0, 1.0, 1.0}; + input.max_jerk = {1.0, 1.0, 1.0}; + + Quintic<3> otg {0.005}; + check(otg, input, 3.915); + + input.current_position = {0.0, 0.0, 0.0}; + input.current_velocity = {0.0, 0.0, 0.0}; + input.current_acceleration = {0.0, 0.0, 0.0}; + input.max_jerk = {2.0, 2.0, 2.0}; + check(otg, input, 3.110); +} + +TEST_CASE("Ruckig") { + SECTION("Known examples") { + Ruckig<3> otg {0.005}; + + InputParameter<3> input; + input.current_position = {0.0, 0.0, 0.0}; + input.current_velocity = {0.0, 0.0, 0.0}; + input.current_acceleration = {0.0, 0.0, 0.0}; + input.target_position = {0.0, 0.0, 0.0}; + input.target_velocity = {0.0, 0.0, 0.0}; + input.target_acceleration = {0.0, 0.0, 0.0}; + input.max_velocity = {1.0, 1.0, 1.0}; + input.max_acceleration = {1.0, 1.0, 1.0}; + input.max_jerk = {1.0, 1.0, 1.0}; + check(otg, input, 0.0); + + input.target_position = {1.0, 1.0, 1.0}; + check(otg, input, 3.170); + + input.current_position = {0.0, 0.0, 0.0}; + input.current_velocity = {0.0, 0.0, 0.0}; + input.current_acceleration = {0.0, 0.0, 0.0}; + input.max_jerk = {2.0, 2.0, 2.0}; + check(otg, input, 2.560); + + input.current_position = {0.0, 0.0, 0.0}; + input.current_velocity = {0.0, 0.0, 0.0}; + input.current_acceleration = {0.0, 0.0, 0.0}; + input.max_velocity = {0.6, 0.6, 0.6}; + check(otg, input, 2.765); + + input.current_position = {0.0, 0.0, 0.0}; + input.current_velocity = {0.0, 0.0, 0.0}; + input.current_acceleration = {0.0, 0.0, 0.0}; + input.max_velocity = {0.4, 0.4, 0.4}; + check(otg, input, 3.390); + + input.current_position = {0.0, 0.0, 0.0}; + input.current_velocity = {0.3, 0.3, 0.3}; + input.current_acceleration = {0.0, 0.0, 0.0}; + input.max_velocity = {1.0, 1.0, 1.0}; + check(otg, input, 2.230); + + input.current_position = {0.0, 0.0, 0.0}; + input.current_velocity = {0.3, 0.3, 0.3}; + input.current_acceleration = {0.0, 0.0, 0.0}; + input.max_velocity = {0.6, 0.6, 0.6}; + check(otg, input, 2.410); + + input.current_position = {0.0, 0.0, 0.0}; + input.current_velocity = {0.0, 0.0, 0.0}; + input.current_acceleration = {0.0, 0.0, 0.0}; + input.target_position = {-1.0, -1.0, -1.0}; + check(otg, input, 2.765); + + input.current_position = {0.0, 0.0, 0.0}; + input.current_velocity = {0.2, 0.2, 0.2}; + input.current_acceleration = {0.0, 0.0, 0.0}; + input.target_position = {-1.0, -1.0, -1.0}; + input.max_velocity = {10.0, 10.0, 10.0}; + input.max_acceleration = {10.0, 10.0, 10.0}; + check(otg, input, 2.730); + + input.current_position = {-1.0, -1.0, -1.0}; + input.current_velocity = {0.2, 0.2, 0.2}; + input.current_acceleration = {0.0, 0.0, 0.0}; + input.target_position = {1.0, 1.0, 1.0}; + input.max_velocity = {0.4, 0.4, 0.4}; + input.max_acceleration = {1.0, 1.0, 1.0}; + check(otg, input, 5.605); + } + + SECTION("Random input with 3 DoF") { + Ruckig<3> otg {0.005}; + InputParameter<3> input; + + // Eigen returns uniform random floats between -1 and 1 + srand(42); + std::default_random_engine gen; + std::uniform_real_distribution dist(0.0, 1.0); + + for (size_t i = 0; i < 32*1024; i += 1) { + input.current_position = Vec::Random(); + input.current_velocity = dist(gen) < 0.9 ? (Vec)Vec::Random() : (Vec)Vec::Zero(); + input.current_acceleration = dist(gen) < 0.8 ? (Vec)Vec::Random() : (Vec)Vec::Zero(); + input.target_position = Vec::Random(); + input.max_velocity = 10 * Vec::Random().array().abs() + 0.1; + input.max_acceleration = 10 * Vec::Random().array().abs() + 0.1; + input.max_jerk = 10 * Vec::Random().array().abs() + 0.1; + + check_calculation(otg, input); + } + } + +#ifdef WITH_REFLEXXES + SECTION("Comparison with Reflexxes with 1 DoF") { + Ruckig<1> otg {0.005}; + Reflexxes<1> rflx {0.005}; + InputParameter<1> input; + + srand(43); + std::default_random_engine gen; + std::uniform_real_distribution dist(0.0, 1.0); + + for (size_t i = 0; i < 32*1024; i += 1) { + input.current_position = Vec1::Random(); + input.current_velocity = dist(gen) < 0.9 ? (Vec1)Vec1::Random() : (Vec1)Vec1::Zero(); + input.current_acceleration = dist(gen) < 0.85 ? (Vec1)Vec1::Random() : (Vec1)Vec1::Zero(); + input.target_position = Vec1::Random(); + input.max_velocity = 10 * Vec1::Random().array().abs() + 0.1; + input.max_acceleration = 10 * Vec1::Random().array().abs() + 0.1; + input.max_jerk = 10 * Vec1::Random().array().abs() + 0.1; + + check_comparison(otg, input, rflx); + } + + for (size_t i = 0; i < 720; i += 1) { + input.current_position = Vec1::Random(); + input.current_velocity = dist(gen) < 0.9 ? (Vec1)Vec1::Random() : (Vec1)Vec1::Zero(); + input.current_acceleration = dist(gen) < 0.8 ? (Vec1)Vec1::Random() : (Vec1)Vec1::Zero(); + input.target_position = Vec1::Random(); + input.target_velocity = Vec1::Random(); + input.max_velocity = 10 * Vec1::Random().array().abs() + input.target_velocity.array().abs(); // Target velocity needs to be smaller than max velocity + input.max_acceleration = 10 * Vec1::Random().array().abs() + 0.1; + input.max_jerk = 10 * Vec1::Random().array().abs() + 0.1; + + check_comparison(otg, input, rflx); + } + } + + /* SECTION("Comparison with Reflexxes with 2 DoF") { + Ruckig<2> otg {0.005}; + Reflexxes<2> rflx {0.005}; + InputParameter<2> input; + + srand(48); + std::default_random_engine gen; + std::uniform_real_distribution dist(0.0, 1.0); + + for (size_t i = 0; i < 0; i += 1) { + input.current_position = Vec2::Random(); + input.current_velocity = dist(gen) < 0.9 ? (Vec2)Vec2::Random() : (Vec2)Vec2::Zero(); + input.current_acceleration = dist(gen) < 0.8 ? (Vec2)Vec2::Random() : (Vec2)Vec2::Zero(); + input.target_position = Vec2::Random(); + input.max_velocity = 10 * Vec2::Random().array().abs() + 0.1; + input.max_acceleration = 10 * Vec2::Random().array().abs() + 0.1; + input.max_jerk = 10 * Vec2::Random().array().abs() + 0.1; + + check_comparison(otg, input, rflx); + } + } + + SECTION("Comparison with Reflexxes with 3 DoF") { + Ruckig<3> otg {0.005}; + Reflexxes<3> rflx {0.005}; + InputParameter<3> input; + + srand(44); + std::default_random_engine gen; + std::uniform_real_distribution dist(0.0, 1.0); + + for (size_t i = 0; i < 32*1024; i += 1) { + input.current_position = Vec::Random(); + input.current_velocity = dist(gen) < 0.9 ? (Vec)Vec::Random() : (Vec)Vec::Zero(); + input.current_acceleration = dist(gen) < 0.8 ? (Vec)Vec::Random() : (Vec)Vec::Zero(); + input.target_position = Vec::Random(); + input.max_velocity = 10 * Vec::Random().array().abs() + 0.1; + input.max_acceleration = 10 * Vec::Random().array().abs() + 0.1; + input.max_jerk = 10 * Vec::Random().array().abs() + 0.1; + + check_comparison(otg, input, rflx); + } + } */ +#endif +} diff --git a/test/otg_plot.py b/test/otg_plot.py new file mode 100644 index 00000000..102ef783 --- /dev/null +++ b/test/otg_plot.py @@ -0,0 +1,121 @@ +import copy +from pathlib import Path +import sys + +sys.path.insert(0, '../build') + +import matplotlib.pyplot as plt +import numpy as np + +from _ruckig import Quintic, InputParameter, OutputParameter, Result, Ruckig, Smoothie +from _ruckig import Reflexxes + + +def walk_through_trajectory(otg, inp): + t = 0.0 + t_list, out_list = [], [] + out = OutputParameter() + + res = Result.Working + while res == Result.Working: + res = otg.update(inp, out) + + inp.current_position = out.new_position + inp.current_velocity = out.new_velocity + inp.current_acceleration = out.new_acceleration + + t_list.append(t) + out_list.append(copy.copy(out)) + t += otg.delta_time + + return t_list, out_list + + +def plot_trajectory(t_list, out_list): + qaxis = np.array(list(map(lambda x: x.new_position, out_list))) + dqaxis = np.array(list(map(lambda x: x.new_velocity, out_list))) + ddqaxis = np.array(list(map(lambda x: x.new_acceleration, out_list))) + dddqaxis = np.diff(ddqaxis, axis=0, prepend=ddqaxis[0, 0]) / otg.delta_time + dddqaxis[0, :] = 0.0 + dddqaxis[-1, :] = 0.0 + + plt.figure(figsize=(8.0, 2.0 + 3.0 * inp.degrees_of_freedom), dpi=120) + + for dof in range(inp.degrees_of_freedom): + global_max = np.max([qaxis[:, dof], dqaxis[:, dof], ddqaxis[:, dof], dddqaxis[:, dof]]) + global_min = np.min([qaxis[:, dof], dqaxis[:, dof], ddqaxis[:, dof], dddqaxis[:, dof]]) + + plt.subplot(inp.degrees_of_freedom, 1, dof + 1) + plt.plot(t_list, qaxis[:, dof], label=f'r_{dof+1}') + plt.plot(t_list, dqaxis[:, dof], label=f'v_{dof+1}') + plt.plot(t_list, ddqaxis[:, dof], label=f'a_{dof+1}') + plt.plot(t_list, dddqaxis[:, dof], label=f'j_{dof+1}') + + # Plot limit lines + if inp.max_velocity[dof] < 1.4 * global_max: + plt.axhline(y=inp.max_velocity[dof], color='orange', linestyle='--', linewidth=1.1) + + if -inp.max_velocity[dof] > 1.4 * global_min: + plt.axhline(y=-inp.max_velocity[dof], color='orange', linestyle='--', linewidth=1.1) + + if inp.max_acceleration[dof] < 1.4 * global_max: + plt.axhline(y=inp.max_acceleration[dof], color='g', linestyle='--', linewidth=1.1) + + if -inp.max_acceleration[dof] > 1.4 * global_min: + plt.axhline(y=-inp.max_acceleration[dof], color='g', linestyle='--', linewidth=1.1) + + if inp.max_jerk[dof] < 1.4 * global_max: + plt.axhline(y=inp.max_jerk[dof], color='red', linestyle='--', linewidth=1.1) + + if -inp.max_jerk[dof] > 1.4 * global_min: + plt.axhline(y=-inp.max_jerk[dof], color='red', linestyle='--', linewidth=1.1) + + plt.legend() + plt.grid(True) + + plt.xlabel('t') + plt.savefig(Path(__file__).parent.parent / 'build' / 'otg_trajectory.png') + # plt.show() + +def print_input_for_mathematica(inp, dof, tf=None): + result = f"""p0->{inp.current_position[dof]}, \ +v0->{inp.current_velocity[dof]}, \ +a0->{inp.current_acceleration[dof]}, \ +pf->{inp.target_position[dof]}, \ +vf->{inp.target_velocity[dof]}, \ +af->{inp.target_acceleration[dof]}, \ +vMax->{inp.max_velocity[dof]}, \ +aMax->{inp.max_acceleration[dof]}, \ +jMax->{inp.max_jerk[dof]}""" + + if tf: + result += f', tf->{tf}' + print('{ ' + result + ' }') + + +if __name__ == '__main__': + inp = InputParameter() + inp.current_position = [0.683145] + inp.current_velocity = [-0.38827] + inp.current_acceleration = [0.0] + inp.target_position = [0.349339] + inp.target_velocity = [-0.654017] + inp.target_acceleration = [0] + inp.max_velocity = [1.30722] + inp.max_acceleration = [1.66874] + inp.max_jerk = [5.89685] + inp.minimum_duration = None + + # print_input_for_mathematica(inp, 0) + + # otg = Quintic(0.005) + # otg = Smoothie(0.005) + # otg = Reflexxes(0.005) + otg = Ruckig(0.005) + + t_list, out_list = walk_through_trajectory(otg, inp) + + print(f'Calculation duration: {out_list[1].calculation_duration:0.1f} [µs]') + print(f'Trajectory duration: {out_list[0].duration:0.3f} [s]') + + plot_trajectory(t_list, out_list)