# Phase Diagram Lever Rule Calculator AI Agent Connect

> Phase Diagram Lever Rule Calculator MCP gives your AI client the math needed for binary phase diagram analysis. It handles the heavy lifting of determining stable phases, finding tie-line endpoints, and calculating mass or volume fractions at specific temperatures and alloy compositions.

## Overview
- **Category:** engineering
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_WQR0rWE724GuVj7iEkjeOzzfun32hOQT5AF1a0yR/ai-agent-connect
- **Tags:** metallurgy, thermodynamics, phase-diagram, lever-rule, alloy-analysis

## Description

You can stop manually calculating tie-line geometry and phase boundaries. This MCP gives your agent the ability to perform complex thermodynamic calculations for binary systems. When you're working with alloy compositions and temperature variables, your AI client can now identify stable phases and their exact properties without you having to do the arithmetic. It handles the math for mass fractions using the lever rule and provides the specific composition limits for any phase at a given temperature. Whether you're checking if a composition is physically valid or need the exact coordinates for a tie-line, this tool provides the data your agent needs to assist with materials science workflows.

## Tools

### get_phase_boundaries
Use this to pull the specific composition limits for a single phase at a set temperature.

### validate_composition_range
This tool checks if a composition value is physically valid within a 0 to 1.0 range for the binary system.

### query_phase_equilibrium
This tool identifies stable phases and their properties based on a specific temperature and composition.

### calculate_tie_line_geometry
This tool computes the exact coordinates for tie-line endpoints and the relative distances required for lever rule calculations.

## Prompt Examples

**Prompt:** 
```
What are the stable phases and mass fractions for an alloy with 0.4 composition at 1200K?
```

**Response:** 
```
At 1200K and 0.4 composition, the stable phases are Liquid and Alpha, with mass fractions of 0.6 for Liquid and 0.4 for Alpha.
```

**Prompt:** 
```
Find the composition range for the Beta phase at 800K.
```

**Response:** 
```
At 800K, the Beta phase is stable within the composition range of 0.75 to 0.92.
```

**Prompt:** 
```
Calculate the mass fractions for a tie-line with boundaries at 0.2 and 0.6 for an alloy at 0.3 composition.
```

**Response:** 
```
For a tie-line between 0.2 and 0.6 at an alloy composition of 0.3, the mass fraction of the phase at 0.2 is 0.75 and the mass fraction of the phase at 0.6 is 0.25.
```

## Capabilities

### Phase Identification
Your agent identifies which phases are stable at specific temperatures and compositions.

### Lever Rule Math
The MCP calculates mass and volume fractions using tie-line geometry.

### Boundary Detection
Your AI client finds the composition limits for any phase in the system.

### Composition Validation
The tool verifies if a composition is within the valid 0 to 1.0 range.

## Use Cases

### Alloy Composition Analysis
Determine the mass fractions of different phases in a binary alloy at a specific temperature.

### Phase Stability Checks
Check which phases are stable for a given composition to avoid unintended phase transformations.

### Tie-line Calculations
Calculate the exact geometry of tie-lines to find phase compositions.

### Boundary Mapping
Find the composition limits for a specific phase to define its stability field.

## Benefits

- Eliminates manual lever rule arithmetic.
- Provides exact tie-line coordinates for precise modeling.
- Validates composition ranges to prevent impossible inputs.
- Automates phase boundary lookups at specific temperatures.

## How It Works

Connect your AI client to Vinkius to access these thermodynamic tools instantly.

1. Connect your MCP-compatible client to Vinkius.
2. Provide the temperature and composition to your agent.
3. The agent calls the necessary tool to query equilibrium or geometry.
4. The MCP returns the calculated phase data or coordinates.
5. Your agent presents the final mass fractions or phase limits.

## Frequently Asked Questions

**What can this MCP calculate?**
It calculates stable phases, phase compositions, mass fractions, and tie-line geometry for binary phase diagrams.

**Which AI clients can use this MCP?**
Any MCP-compatible client like Claude, Cursor, Windsurf, or VS Code can use this tool once connected through Vinkius.

**Does it support mass fraction calculations?**
Yes, it uses the calculate_tie_line_geometry tool to perform precise lever rule calculations for mass fractions.

**How does it handle composition validation?**
The validate_composition_range tool ensures that any provided composition is within the valid 0 to 1.0 range for the binary system.

**Can I find phase limits at specific temperatures?**
Yes, the get_phase_boundaries tool retrieves the composition limits for a specific phase at a given temperature.

**How do I find the mass fraction of a phase?**
You can use the `query_phase_equilibrium` tool with the desired alloy composition and temperature to retrieve the mass fractions directly.

**Can I calculate volume fractions?**
Yes, if you provide the phase densities in the `phaseDensities` parameter when calling `query_phase_equilibrium`, the tool will return the volume fractions.

**What happens if the temperature is outside the diagram range?**
The tool will return an 'out_of_bounds' status if the temperature or composition falls outside the defined coordinate range of the phase diagram.
