# Field Line Profile (`field.lineProfile`)

[Component reference](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/) · [繁體中文](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/commands/field-lineProfile/)

**Menu:** none (Quick Open, the CLI, Python and MCP) · **Runs as:** a job, with progress and Cancel

> Preview: turn on Preview features in Edit › Preferences › Simulation, or run `preview.set {"enabled":true}`. Its replies carry `preview: true` and a note.

## What it does

Preview. Solves the model as magnetics.fieldSolve meshes it (magnetostatic, linear materials) with the currents given, all at once, and reads the field along a line: B and H at evenly spaced points (H from each region's μr; a point outside the mesh has region null and zero field), the flux across the line per metre of depth and through the model's depth (positive with the normal to the right of travel; null when an end lies outside the mesh), and ∫H·dl along the path, exact for the element field (a closed path gives the ampere-turns it encloses, Ampère's law). The CSV is in SI units (m, T, A/m). Changes nothing.

## Parameters

- `design`: object? (a magnetics.design reply, or its best design)
- `sketch`: object? (instead of design: the planar drawing magnetics.fieldSolve takes, in mm; field.lineProfile, field.regionTable and field.calculator also take an axisymmetric (r, z) section, axisymmetric: true with no depthMm, revolved a full turn, its magnets' direction \[r, z\] in the section)
- `muR`: number? (design only)
- `clearanceMm`: number=0.1 (design only)
- `elementMm`: number? (largest element in the core and the windings, 0.01 to 50 mm)
- `currents`: object? ({circuit: amperes}; default 1 A in every circuit; a circuit left out carries none)
- `magnets`: \[{region:str (the name of a region of the drawing that is not a coil; with a design, \\"centre-leg gap\\" draws the centre leg's gap as its own region, a slot the magnet fills, refused for a ring or a gapless design),direction:\[x,y\] (the magnetization direction, any length; \[r, z\] in an axisymmetric section),temperatureC:number,grade:str (a built-in grade: Arnold N35, Arnold N42, Arnold N42H or Arnold N42UH, sintered NdFeB, each from its Arnold Magnetic Technologies data sheet) | {name:str,source:str (the data sheet the values come from: document, revision, table),recoilMuR:number (≥ 1),points:\[{temperatureC,brT (remanence),hcjAPerM (intrinsic coercivity),hkAPerM (knee field, H\_k ≤ H\_cJ)}\] (1 to 64, rising temperature)}}\]? (permanent magnets, at most 64: each region becomes a magnet on its recoil line B = μ0 μrec H + Br at the temperature, Br, H\_cJ and H\_k linear between the sheet's points and the nearest point outside them with an outsideMaterialData warning; any other grade's values are the caller's, and the grade must name its sheet; demagCurve:\[\[H,B\]\]? (field.lineProfile, field.regionTable, magnetics.fieldFluxMap, magnetics.fieldSolve {dimension: 3} and field.force {dimension: 3} only, every other command refuses it: the grade's normal demagnetization curve at temperatureC from the same data sheet, A/m and T, 2 to 200 points from \[0, Br\] with H and B both falling through the knee, its Br within 1 % of the grade's; the magnet is then solved by Newton's method on it, a reverse field along the magnetization on the curve and a forward or crosswise one on the recoil line, reversibly, with Br from the curve))
- `from`: \[x,y\] (mm)
- `to`: \[x,y\] (mm)
- `points`: int=101 (2 to 10000, both ends included)
- `path`: \[\[x,y\]\]? (mm, a polyline for ∫H·dl; default the line from→to; repeat the first point to close it)
- `csvPath`: str? (the .csv file to write, through the host's file service)

## Reply

- currents
- points:\[{sMm,xMm,yMm,region,bT,bxT,byT,hAPerM,hxAPerM,hyAPerM}\]
- peakBT
- flux:{wbPerM,wb}|null (axisymmetric: wb through the surface the line sweeps round the axis, the full turn, and wbPerM null)
- mmf:{a,lengthMm,insideMm,closed}
- csv
- path
- written
- model
- notes
- preview
- previewNote
