================ **Flux-density** ================ .. role:: red .. admonition:: Function: *b, b1, b2* = induc_xy(*x, y*) Returns the value and the components at the point x,y. **Parameter** | :red:`x` Coordinate 1 | :red:`y` Coordinate 2 **Return value:** Magnitude b and components b1 and b2 of the flux-density at (x,y) .. admonition:: Command: post_models("induct(x)", "B") Determines the distribution of flux-density along a specified path. The evaluation path can be specified as follows: 1. Straight or circular arc given by the points (x1, y1) and (x2, y2) in cartesian coordinates. In the cartesian coordinate system, the path is a straight line; in the polar coordinate system, a circular arc is defined in a mathematically positive direction. 2. Circle with centre at the point (x1, y1). 3. Circle with centre at the origin given by the air-gap radius stored in the model. The basic data of the model can be set via pre_models('basic_modpar'). This is done automatically for the parameter-based models (M-Models) available in FEMAG. According to the number of defined coordinate points, it is recognized which of these three cases is intended. In case 3, no coordinates need be specified. **Parameter** *[out]* :red:`b` is a freely-selectable variable identifier that returns the evaluation position and the flux-density components. **Example in cartesian coordinates:** :: m.coord_x1 = 38.254 -- Point coordinate x1 [mm] m.coord_y1 = 1.695 -- Point coordinate y1 [mm] m.coord_x2 = 32.548 -- Point coordinate x2 [mm] m.coord_y2 = 17.560 -- Point coordinate y2 [mm] post_models("induct(x)","b") N = table.getn(b) -- Number of elements in array ph1 = b[1] -- first position [mm] bn1 = b[2] -- first normal component of induction [T] bt1 = b[3] -- first tangential component of induction [T] ph2 = b[4] -- second position bn2 = b[5] -- second normal induction bt2 = b[6] -- second tangential induction ... **Example in polar coordinates: (r/phi system)** Model creation or prior flux-density evaluation must specify the basic model parameters that are stored in the model. This is done automatically for the parameter-based models (M-Models) available in FEMAG. :: m.fc_radius = 27 -- Radius air-gap center [mm] pre_models("basic_modpar"); The flux-density evaluation can be carried out below without further information. :: post_models("induct(x)","b") N = table.getn(b) -- Number of elements in array ph1 = b[1] -- first angular position [°] br1 = b[2] -- first radial component of induction [T] bp1 = b[3] -- first circumferential component of induction [T] ph2 = b[4] -- second position br2 = b[5] -- second radial induction bp2 = b[6] -- second circumferential induction ... Parameters defined in the script can be deleted by assigning nil. This is necessary in certain cases, e.g. if both coordinates m.coord_x1/y1 and m.coord_x2/y2 have already been defined, but for a further evaluation the path is specified as a circle with radius m.coord_x1/y1. The second point should then be :: m.coord_x2 = nil m.coord_y2 = nil to allow FEMAG to recognize that the path is now a circle. **Example of the output of the induction values to a file:** :: post_models("induct(x)","b") -- Calculate field distribution data=io.open("Ausgabe.csv","w+") -- Output in data file data:write("# phi [°], Br [T], Bph [T]") N = table.getn(b) -- Number of elements in array i = 1 repeat data:write(string.format("%g, %g, %g\n",b[i],b[i+1],b[i+2])) i = i+3 until i>=N io.close(data) -- Don't forget to close the file