Documentation
Go to AppSign InSign Up
    Getting Started
    • Introduction to Flux
    • What is Flux?
    • Quick Start
    • The Flux Method
    • Creating an Account
    • Flux for Organizations
    • Setting Up Your Browser
      • Mouse & Trackpad
      • Multi-Screen Operation
      • Keyboard Shortcuts
    • Your First PCB in Flux
      • DFM & Export
      • PCB Layout & Routing
      • Project Setup
      • Schematic
      • Export & Manufacturing
    • KiCAD to Flux
      • Layout
      • Parts & Libraries
      • Schematics
    • Eagle to Flux
    • EasyEDA to Flux
    • Upverter to Flux
    • Altium to Flux
    • Getting Help
    Tutorials
    • Tutorials
    • Getting Started With Flux
      • Customizing Flux
    • Flux Use Cases
      • AI Architecture Design
      • AI Component Research
      • AI Design Reviews
      • AI Testing & Debugging
      • AI Auto-Layout
      • Generative AI
    • Start Learning Flux, No Matter Your Skill Level
      • Advanced Designer
      • First Time Designer
      • Intermediate Designer
    • Power Regulator
      • 1 – Part Selection
      • 2 – PCB Layout
      • 2 – Schematics
    • Routing
      • High-speed Routing
      • High Density Designs (HDI)
      • Working with Polygons
    • Adding Components to the Library
      • Publishing Components to the Library
      • Creating Components from Scratch
      • Importing Components
      • Working with Footprints
      • Working with Symbols
    • What is a Module?
      • Module Design Best Practices
      • Creating Modules
      • Using Modules
    • Generic Components
      • Creating a generic part
    • Copper Fills Tutorial
      • Creating Copper Cutouts
    • Board Outline Shape and Size
    • The Toolbar
    • Using Layout Rules
    • Intro to collaboration
    • Embedding a Flux Project
    • Reviewing component updates
    • Version Control Deep Dive
    • Custom Shapes
    • AI-Assisted Design with Flux
    • PCB Design Reviews (DRC)
    • Component Placement
    • Component Procurement
    • Multi-Layer PCB Design
    • Working with Ground Signals
    • Reusing Projects
      • Useful links
    Reference
    • Flux Context Menu
    • Calculator Tool
    • Change Project Name
    • Code Tool
    • Convert to component
    • Flux ACUs
    • Overview
    • Data Portability
    • Delete & Archive Projects
    • Design Rule Check (DRC)
    • Expressions
    • File Tool
    • FMEA Report Generation
    • Gerber Exports
    • Help Tool
    • Special Part Types
    • JEP30 PartModel Import/Export
    • Knowledge Base
    • Library Tool
    • Managing Units
    • Measuring Distances
    • Model Selection
    • Nets and Traces
      • Curved Traces
      • Impedance Control
      • Trace Width
    • Object Types
      • AssetNode
      • ControlNode
      • ElementNode
      • ElementTerminalNode
      • OutputNode
      • PropertyNode
      • RouteNode
      • RouteTerminalNode
    • Pads & Holes
    • Passive Component Consolidation
    • Layout Rules Reference
      • Layout Rules List
      • Object-Specific Layout Rules
      • Selector-Based Layout Rules
      • Layout Rules Inheritance & Precedence
      • Layout Rules Modifiers
    • Polygons
    • Comments
    • Cursors
    • Forking & Cloning
    • Copper Fills
    • Importing Schematics
    • Importing Components
    • Schematic Inspector
      • Assets Panel
      • Pricing & Availability Panel
      • Properties Panel
      • Simulation Panel
    • The Library
    • Project Launcher
      • New Blank Project
    • Layout Object Tree
      • PCB Object Types
    • Schematic Object List
    • The PCB Editor
      • Locking
      • Layer View Control
      • Positioning & Routing
      • Selecting Objects
      • Stackup Editor
    • Permission Tiers
    • Preloaded Examples
    • The Profile Page
      • Featured Projects
    • The Schematic Editor
      • Positioning & Wiring
    • Global Search
    • Sharing & Permissions
    • History & Version Control
    • Silkscreen
    • Simulator Tool
    • Star a Project (Favorite)
    • Vias
      • Smart Vias
    Copilot
    • Copilot Overview
    • Model Selection
    • Flux ACUs
    • Knowledge Base
    • Flux Context Menu
    • Calculator Tool
    • Code Tool
    • File Tool
    • Help Tool
    • Library Tool
    • Simulator Tool
    • FMEA Report Generation
    • Passive Component Consolidation
    FAQ
    • Schematic Editor
    • General FAQs
    • Flux and AI FAQs
    • PCB Editor FAQs
    • Parts and Modules
    • Pricing
    • Private and public projects
    • Data security and IP protection
    • When things go wrong: Errors and how to handle them
      • Lost connection
    Legal
    • Terms of Service
    • Privacy Statement
    • Main Services Agreement
    • Subprocessors

Copilot

Calculator Tool

Copilot

Flux Calculator Tool


Flux includes a powerful calculator tool that allows you to evaluate mathematical expressions and perform engineering calculations directly from the chat interface. This tool helps you quickly solve equations without having to switch to a separate calculator application.

Overview

The calculator tool enables you to:

  • Evaluate mathematical expressions of varying complexity
  • Perform engineering calculations relevant to circuit design
  • Work with arrays and matrices for more complex operations
  • Get results in a clear, formatted output
  • Extract and evaluate equations from datasheets

How to Use the Calculator Tool

To evaluate mathematical expressions using Flux, use the @calculator tool in your query:

@calculator 2.2k * 0.01

@calculator 3.3V / 220ohm

@calculator sin(45 deg) * 5V

When you use the @calculator tool, Flux will:

  1. Parse the mathematical expression
  2. Check for any undefined variables or functions
  3. Evaluate the expression using the mathjs library
  4. Return the result in a formatted output

Supported Operations

The calculator tool supports a wide range of mathematical operations:

Basic Arithmetic

  • Addition, subtraction, multiplication, division
  • Exponentiation and square roots
  • Modulo and integer division

Trigonometric Functions

  • Sine, cosine, tangent (and their inverses)
  • Support for both radians and degrees (using deg suffix)

Logarithmic and Exponential Functions

  • Natural logarithm (ln) and base-10 logarithm (log10)
  • Exponential function (exp)

Engineering Functions

  • Unit conversions (e.g., ohms to kilohms)
  • Engineering notation (e.g., 1k = 1000)
  • Complex number operations

Matrix and Array Operations

  • Matrix creation and manipulation
  • Vector operations
  • Array indexing and slicing

Example Calculations

Here are some examples of how you can use the calculator tool:

Circuit Calculations

@calculator 5V / 1k # Calculate current through a resistor

@calculator 0.5 * 3.3V # Calculate voltage divider output

@calculator 1/(1/(10k) + 1/(22k)) # Calculate parallel resistance

Power and Energy Calculations

@calculator 12V * 0.5A # Calculate power

@calculator 3.7V * 2000mAh / 1000 # Calculate energy in watt-hours

@calculator 5V^2 / 100ohm # Calculate power using V²/R

Timing and Frequency Calculations

@calculator 1 / (2 * pi * 10k * 0.1uF) # Calculate RC filter cutoff frequency

@calculator 1 / (2 * 10k * 1nF) # Calculate time constant

@calculator 1 / 50MHz # Calculate period from frequency

Result Formatting

The calculator tool formats results based on the type of calculation:

Scalar Values

Simple numerical results are displayed with appropriate precision and units when applicable.

Arrays and Vectors

One-dimensional arrays are displayed in a tabular format with index and value columns.

Matrices

Two-dimensional arrays (matrices) are displayed in a tabular format with row indices and values.

Complex Numbers

Complex numbers are displayed in the form a + bi where a is the real part and b is the imaginary part.

Tips for Effective Calculations

To get the most out of the calculator tool:

  1. Use engineering notation - You can use suffixes like k, M, m, u, n, p (e.g., 10k for 10,000 or 1u for 0.000001).

  2. Include units for clarity - While not required for calculation, adding units like V, A, or ohm helps with readability.

  3. Use parentheses for complex expressions - Ensure correct order of operations by using parentheses in complex expressions.

  4. Break down complex calculations - For very complex calculations, consider breaking them into smaller steps.

Extracting Equations from Datasheets

A powerful feature of the calculator tool is its ability to extract and evaluate equations from datasheets:

  1. Attach a datasheet to your chat
  2. Use the @calculator tool to reference an equation in the datasheet
  3. Provide the values for the variables in the equation

For example:

@calculator From the attached datasheet, calculate the output voltage using the equation in Figure 3 with R1=10k and R2=5k

Limitations

While the calculator tool is powerful, it has some limitations to be aware of:

  • The tool cannot evaluate expressions with undefined variables
  • Very complex mathematical operations might require breaking down into simpler steps
  • The tool does not support solving equations (finding x where f(x) = 0)
  • Some specialized engineering functions might not be available
  • The tool does not maintain state between calculations

The calculator tool works well with other Flux capabilities:


Previous

Flux Context Menu

Next

Code Tool