### Install MachUpX Source: https://machupx.readthedocs.io/en/latest/_sources/installation.md.txt Install the package from the root directory. ```bash $ pip install . ``` -------------------------------- ### Verify Installation Source: https://machupx.readthedocs.io/en/latest/_sources/installation.md.txt Run tests to ensure the installation is functioning correctly. ```bash $ py.test ``` ```bash > py.test-script.py ``` -------------------------------- ### Install FreeCAD on Linux Source: https://machupx.readthedocs.io/en/latest/_sources/installation.md.txt Install FreeCAD using the apt package manager. ```bash $ sudo apt-get install freecad ``` -------------------------------- ### Check Git Version Source: https://machupx.readthedocs.io/en/latest/_sources/installation.md.txt Verify if Git is installed on your system. ```bash git --version ``` -------------------------------- ### Define Scene Run Commands Source: https://machupx.readthedocs.io/en/latest/_sources/creating_input_files.md.txt Example of configuring the 'run' dictionary within a scene JSON object to execute trim, force solving, and derivative calculations. ```json { ... "run" : { "pitch_trim" : { "set_trim_state" : true, "verbose" : true }, "solve_forces" : { "filename" : "my_forces.json", "dimensional" : false, "nondimensional" : false, "verbose" : true }, "derivatives" : { "filename" : "my_derivatives.json" } }, ... } ``` -------------------------------- ### Define Custom Spanwise Distribution Source: https://machupx.readthedocs.io/en/latest/_sources/creating_input_files.md.txt Example format for providing an explicit list of span locations for vortex nodes and control points. ```json [node_0_loc, cp_0_loc, node_1_loc, cp_1_loc,..., node_N_loc, cp_N_loc, node_N+1_loc] ``` -------------------------------- ### Interact with MachUpX via Python Interpreter Source: https://machupx.readthedocs.io/en/latest/_sources/user_interface.md.txt Demonstrates initializing a scene, displaying wireframes, solving forces, trimming, and calculating derivatives using the Scene class. ```python import machupX as MX input_file = "traditional_input.json" # Initialize scene my_scene = MX.Scene(input_file) # Display wireframe of the scene my_scene.display_wireframe(show_legend=True) # Solve aerodynamic forces and moments FM_results = my_scene.solve_forces(dimensional=True, non_dimensional=False, verbose=True) print(json.dumps(FM_results["traditional_airplane"]["total"], indent=4)) # Trim the aircraft in pitch trim_state = my_scene.aircraft_pitch_trim(set_trim_state=True, verbose=True) print(json.dumps(trim_state["traditional_airplane"])) # Calculate aerodynamic derivatives derivs = my_scene.aerodynamic_derivatives() print(json.dumps(derivs["traditional_plane"])) ``` -------------------------------- ### Clone MachUpX Repository Source: https://machupx.readthedocs.io/en/latest/_sources/installation.md.txt Download the source code from the official GitHub repository. ```bash $ git clone https://github.com/usuaero/MachUpX ``` -------------------------------- ### Run MachUpX via Command Line Source: https://machupx.readthedocs.io/en/latest/_sources/user_interface.md.txt Executes analysis defined in a JSON input file using the MachUpX module. ```python python -m machupX example_input.json ``` -------------------------------- ### Configure FreeCAD Python Path Source: https://machupx.readthedocs.io/en/latest/_sources/installation.md.txt Add FreeCAD modules to the Python path using conda-develop. ```bash $ conda-develop /usr/lib/freecad/lib $ conda-develop /usr/lib/freecad/bin $ conda-develop /usr/lib/freecad/bin/lib $ conda-develop /usr/lib/freecad/Ext $ conda-develop /usr/lib/freecad/Mod $ conda-develop /usr/lib/freecad/Gui ``` -------------------------------- ### Update MachUpX Repository Source: https://machupx.readthedocs.io/en/latest/_sources/installation.md.txt Pull the latest changes from the repository. ```bash $ git pull ``` -------------------------------- ### Debugging DatabaseBoundsError Source: https://machupx.readthedocs.io/en/latest/_sources/common_issues.md.txt Use a try-except block to catch DatabaseBoundsError and inspect the specific airfoil, indices, and input parameters causing the interpolation failure. ```python try: scene.solve_forces() except airfoil_db.DatabaseBoundsError as e: print(e.airfoil) print(e.exception_indices) print(e.inputs_dict) ``` -------------------------------- ### Define a Step Change in Twist Distribution Source: https://machupx.readthedocs.io/en/latest/_sources/creating_input_files.md.txt Use an array of span fractions and twist values to create a step change in the wing twist distribution. ```json "twist" : [[0.0, 0.0], [0.5, 0.0], [0.5, 2.0], [1.0, 2.0]] ``` -------------------------------- ### Scene.set_err_state() Source: https://machupx.readthedocs.io/en/latest/_sources/error_handling.rst.txt Configures how errors are processed within the MachUpX environment, allowing them to be treated as warnings or suppressed entirely. ```APIDOC ## Scene.set_err_state() ### Description Sets the global error handling state for the MachUpX scene. This allows users to toggle between raising errors, logging them as warnings, or suppressing them. ### Usage `Scene.set_err_state(state)` ``` -------------------------------- ### Custom Error Classes Source: https://machupx.readthedocs.io/en/latest/_sources/error_handling.rst.txt Overview of the custom error exceptions that may be raised during MachUpX operations. ```APIDOC ## Custom Error Classes ### SolverNotConvergedError Raised when the numerical solver fails to reach a converged state. ### DatabaseBoundsError Raised when input parameters fall outside the defined bounds of the airfoil database. Note: Angular values such as 'alpha' and 'trailing_flap_deflection' are reported in radians. ``` -------------------------------- ### Calculate Aerodynamic Center (Phillips' Approximation) Source: https://machupx.readthedocs.io/en/latest/_sources/developer_notes.md.txt General formula for the aerodynamic center using Phillips' approximation. ```text / b/2 \ _ 1 d | / ~ | x = ---- -- | | CL c x dy | ac CL,a da | / ac | \-b/2 / ``` -------------------------------- ### Define an Elliptic Chord Distribution Source: https://machupx.readthedocs.io/en/latest/_sources/creating_input_files.md.txt Specify an elliptic chord distribution by providing the root chord length and optional units. ```json "chord" : ["elliptic", 1.0] ``` ```json "chord" : ["elliptic", 1.0, "ft"] ``` -------------------------------- ### Calculate Aerodynamic Center (Constant Section Lift Coefficient) Source: https://machupx.readthedocs.io/en/latest/_sources/developer_notes.md.txt Simplified formula for the aerodynamic center assuming constant section lift coefficient over the span. ```text b/2 _ 1 / ~ x = - | c x dy ac S / ac -b/2 ``` -------------------------------- ### Specify column units in CSV files Source: https://machupx.readthedocs.io/en/latest/_sources/units.md.txt Add a final row to a CSV file to define the units for each column. ```csv # File: density_profile.csv 0.0, 1.225 2000.0, 1.0066 4000.0, 0.81935 "m", "kg/m^3" ``` -------------------------------- ### Specify units for float values Source: https://machupx.readthedocs.io/en/latest/_sources/units.md.txt Define units for a single float value by providing a list containing the value and the unit string. ```json "area" : [6.75, "ft^2"] ``` -------------------------------- ### Calculate Mean Aerodynamic Chord (MAC) Source: https://machupx.readthedocs.io/en/latest/developer_notes.html Mathematical definition of the Mean Aerodynamic Chord as a reference length based on Phillips Eq. 1.8.86. ```text b/2 1 / 2 MAC = - | c dy S / -b/2 ``` -------------------------------- ### Specify units for vector inputs Source: https://machupx.readthedocs.io/en/latest/_sources/units.md.txt Append the unit string as the final element in a vector input. ```json "velocity" : [100.0, 13.0, 0.0, "ft/s"] ``` -------------------------------- ### Specify units for array inputs Source: https://machupx.readthedocs.io/en/latest/_sources/units.md.txt Include units as an additional row at the end of an array structure. ```json "rho" : [[0.0, 1.225], [2000.0, 1.0066], [4000.0, 0.81935], ["m", "kg/m^3"]] ``` -------------------------------- ### Identify Trailing Vortex Impingement Warning Source: https://machupx.readthedocs.io/en/latest/common_issues.html This warning indicates that a control point is too close to a trailing vortex, which can be suppressed by adjusting the impingement_threshold in the solver parameters. ```text MachUpX detected a trailing vortex impinging upon a control point. This can lead to greatly exaggerated induced velocities at the control point. See "Common Issues" in the documentation for more information. This warning can be suppressed by reducing "impingement_threshold" in the solver parameters. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.