Skip to main content
Back to Prompt Library
implementation

Build the application

Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.

Linked challenge: Build an Electrodialysis Brine Concentration Energy Evaluator

Format
Code-aware
Lines
69
Sections
11
Linked challenge
Build an Electrodialysis Brine Concentration Energy Evaluator

Prompt source

Original prompt text with formatting preserved for inspection.

69 lines
11 sections
No variables
1 code block
## Build
Assess specific energy consumption and limiting current densities for electrodialysis brine concentrators using WaterTAP. Formulate operating voltages to maximize recovery without damaging ion-exchange membranes.

## User
Desalination plant efficiency engineers and environmental compliance officers

## Workflow
1. Ingest reverse osmosis brine feed concentrations, target discharge salinities, and local electricity tariffs.
2. Simulate electrodialysis cell pair stacks and limiting current density constraints via WaterTAP.
3. Optimize applied voltage and flow velocities to minimize levelized cost of water and energy footprint using DSPy.
4. Generate a dispatch setpoint schedule for electrodialysis array power supplies.

## Interface
Electrodialysis performance visualizer charting applied voltage versus stack specific energy consumption and salt removal rate.

## Data
Utilize WaterTAP electrodialysis (ED) unit model synthetic feed sets mapping RO brine concentration steps.
Starter examples below are synthetic. They are not downloaded records.

## Source
[WaterTAP treatment modeling](https://raw.githubusercontent.com/watertap-org/watertap/main/README.md)
Extracts electrodialysis mass transfer and power consumption modeling equations from the WaterTAP library.

## Tools
dspy, watertap, pandas.
DSPy optimizes prompt pipelines that formulate safe operating voltages minimizing electrodialysis energy footprints within physical limits.
Local or hosted LLM supporting structured DSPy program signatures and numeric constraint checks.

## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

## Acceptance
- Calculates electrodialysis energy consumption using WaterTAP membrane transport equations.
- Flags configurations where the required voltage breaches the limiting current density of the membranes.
- Exports a structured parameter file detailing safe operating voltages.

## Starter Examples
```json
[
  {
    "input": {
      "feed_flow_m3_h": 150,
      "feed_salinity_g_l": 65,
      "target_product_g_l": 120,
      "tariff_usd_kwh": 0.08,
      "membrane_area_m2": 450
    },
    "expected_output": {
      "feasible": true,
      "optimal_voltage_v": 1.2,
      "limiting_current_exceeded": false,
      "specific_energy_kwh_m3": 7.4,
      "estimated_op_cost_usd_h": 88.8,
      "note": "Normalized simplified synthetic app record."
    }
  },
  {
    "input": {
      "feed_flow_m3_h": 200,
      "feed_salinity_g_l": 70,
      "target_product_g_l": 150,
      "tariff_usd_kwh": 0.12,
      "membrane_area_m2": 450
    },
    "expected_output": {
      "feasible": false,
      "optimal_voltage_v": 2.1,
      "limiting_current_exceeded": true,
      "specific_energy_kwh_m3": 14.5,
      "estimated_op_cost_usd_h": 348,
      "note": "Membrane damage risk; simplified synthetic app record."
    }
  }
]
```

## Safety
Provides advisory operating voltages; physical electrodialysis power supply controls remain under hardware interlocks.
Use mock external writes. Require human review before any real deployment.

Adaptation plan

Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.

Keep stable

Hold the task contract and output shape stable so generated implementations remain comparable.

Tune next

Update libraries, interfaces, and environment assumptions to match the stack you actually run.

Verify after

Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.