Skip to main content
Glama

wing_vlm_analysis

Analyze wing aerodynamics using Vortex Lattice Method or lifting line theory to calculate lift, drag, and performance based on wing configuration and flight conditions.

Instructions

Analyze wing aerodynamics using Vortex Lattice Method or simplified lifting line theory.

Args: wing_config: Wing configuration (span_m, chord_m, sweep_deg, etc.) flight_conditions: Flight conditions (airspeed_ms, altitude_m, alpha_deg) analysis_options: Optional analysis settings

Returns: Formatted string with aerodynamic analysis results

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wing_configYes
flight_conditionsYes
analysis_optionsNo

Implementation Reference

  • The primary handler function registered as the MCP tool 'wing_vlm_analysis'. It calls the core analysis logic and formats the output into a readable string with key metrics and full JSON data.
    def wing_vlm_analysis(
        wing_config: dict, flight_conditions: dict, analysis_options: dict | None = None
    ) -> str:
        """Analyze wing aerodynamics using Vortex Lattice Method or simplified lifting line theory.
    
        Args:
            wing_config: Wing configuration (span_m, chord_m, sweep_deg, etc.)
            flight_conditions: Flight conditions (airspeed_ms, altitude_m, alpha_deg)
            analysis_options: Optional analysis settings
    
        Returns:
            Formatted string with aerodynamic analysis results
        """
        try:
            from ..integrations.aero import wing_vlm_analysis as _wing_analysis
    
            result = _wing_analysis(wing_config, flight_conditions, analysis_options)
    
            # Format response
            result_lines = ["Wing Aerodynamic Analysis (VLM)", "=" * 50]
    
            # Wing configuration
            result_lines.extend(
                [
                    "Configuration:",
                    f"  Span: {wing_config.get('span_m', 0):.1f} m",
                    f"  Chord: {wing_config.get('chord_m', 0):.1f} m",
                    f"  Aspect Ratio: {result.get('aspect_ratio', 0):.1f}",
                    f"  Sweep: {wing_config.get('sweep_deg', 0):.1f}°",
                    "",
                ]
            )
    
            # Flight conditions
            result_lines.extend(
                [
                    "Flight Conditions:",
                    f"  Airspeed: {flight_conditions.get('airspeed_ms', 0):.1f} m/s",
                    f"  Altitude: {flight_conditions.get('altitude_m', 0):.0f} m",
                    f"  Angle of Attack: {flight_conditions.get('alpha_deg', 0):.1f}°",
                    "",
                ]
            )
    
            # Results
            result_lines.extend(
                [
                    "Aerodynamic Results:",
                    f"  Lift Coefficient: {result.get('cl', 0):.3f}",
                    f"  Drag Coefficient: {result.get('cd', 0):.4f}",
                    f"  L/D Ratio: {result.get('cl_cd_ratio', 0):.1f}",
                    f"  Lift (N): {result.get('lift_n', 0):.0f}",
                    f"  Drag (N): {result.get('drag_n', 0):.0f}",
                    "",
                ]
            )
    
            # Add JSON data
            json_data = json.dumps(result, indent=2)
            result_lines.extend(["JSON Data:", json_data])
    
            return "\n".join(result_lines)
    
        except ImportError:
            return "Wing analysis not available - install aerodynamics packages"
        except Exception as e:
            logger.error(f"Wing analysis error: {str(e)}", exc_info=True)
            return f"Wing analysis error: {str(e)}"
  • Registration of the wing_vlm_analysis tool with the FastMCP server instance.
    mcp.tool(wing_vlm_analysis)
  • Pydantic model defining the input WingGeometry schema used by the analysis functions.
    """Wing planform geometry definition."""
    
    span_m: float = Field(..., gt=0, description="Wing span in meters")
    chord_root_m: float = Field(..., gt=0, description="Root chord in meters")
    chord_tip_m: float = Field(..., gt=0, description="Tip chord in meters")
    sweep_deg: float = Field(
        0.0, ge=-45, le=45, description="Quarter-chord sweep in degrees"
    )
    dihedral_deg: float = Field(
        0.0, ge=-15, le=15, description="Dihedral angle in degrees"
    )
    twist_deg: float = Field(
        0.0, ge=-10, le=10, description="Geometric twist (tip relative to root)"
    )
    airfoil_root: str = Field("NACA2412", description="Root airfoil name")
    airfoil_tip: str = Field("NACA2412", description="Tip airfoil name")
  • Pydantic model for output WingAnalysisPoint, representing results at each angle of attack.
    class WingAnalysisPoint(BaseModel):
        """Wing analysis results at a single condition."""
    
        alpha_deg: float = Field(..., description="Wing angle of attack")
        CL: float = Field(..., description="Wing lift coefficient")
        CD: float = Field(..., description="Wing drag coefficient")
        CM: float = Field(..., description="Wing pitching moment coefficient")
        L_D_ratio: float = Field(..., description="Lift to drag ratio")
        span_efficiency: float | None = Field(None, description="Span efficiency factor")
  • Core helper function implementing the wing VLM analysis logic, dispatching to AeroSandbox VLM or simplified lifting-line method.
    def wing_vlm_analysis(
        geometry: WingGeometry,
        alpha_deg_list: list[float],
        mach: float = 0.2,
        reynolds: float | None = None,
    ) -> list[WingAnalysisPoint]:
        """
        Vortex Lattice Method wing analysis.
    
        Args:
            geometry: Wing planform geometry
            alpha_deg_list: List of angles of attack to analyze (degrees)
            mach: Mach number
            reynolds: Reynolds number (optional, used for airfoil data if available)
    
        Returns:
            List of WingAnalysisPoint objects with CL, CD, CM data
        """
        if AEROSANDBOX_AVAILABLE:
            try:
                # Use AeroSandbox VLM
                return _aerosandbox_wing_analysis(geometry, alpha_deg_list, mach, reynolds)
            except Exception:
                # Fall back to simple method
                pass
    
        # Use simple lifting line approximation
        return _simple_wing_analysis(geometry, alpha_deg_list, mach)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cheesejaguar/aerospace-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server