# Limoncello Calculator Method

This document summarizes the public recipe model used by the Limoncello Calculator at <https://limoncello.nu/>.

## Purpose

The calculator computes a limoncello recipe when the user knows only some values. A user can enter any combination of:

- total batch volume
- base alcohol strength
- target alcohol strength
- base alcohol volume
- water volume
- sugar amount
- lemon zest amount

At least one value must remain empty so the constraint solver can solve for it.

## Bressanini Ratios

The calculator uses these target ratios:

- 40 g lemon zest per 100 g pure alcohol
- 50 g sugar per 100 g pure alcohol
- short maceration, usually 24-72 hours, to reduce bitterness

## Internal Units

The model uses metric units internally:

- volume in milliliters
- mass in grams
- alcohol strength as percent by volume

The UI can display metric, US customary, or UK imperial units. Display conversions do not change the underlying recipe constraints.

## Constraint Model

The model solves these relationships:

- `alcohol volume + water volume + dissolved sugar volume contribution = total batch volume`
- `base alcohol strength and alcohol volume determine target alcohol strength`
- `sugar amount follows 50 g per 100 g pure alcohol`
- `lemon zest follows 40 g per 100 g pure alcohol`

The calculator approximates dissolved sugar volume contribution as 0.6 ml per gram of sugar.

## Default Example

With no user inputs, the model currently produces a small default batch:

- total volume: 250 ml
- target strength: 20% vol
- base alcohol: 40% vol
- base alcohol volume: 125 ml
- water: 114 ml
- sugar: 19 g
- lemon zest: 15 g
- pure alcohol: 39 g

## Privacy

The MiniZinc solver runs locally in the browser using WebAssembly. Recipe values do not need to be sent to a server for calculation.
