Displaying Planar Vector Magnetic Field Using Light Illumination Model Zhao Yu, Chai Jianyun (Department of Electrical Engineering and Applied Electronic Technology, Tsinghua University, Beijing 100084, China) is used to display the light illumination model of magnetic field. The basic idea is to create appropriate material colors and normal vectors for each pixel on the flux tube image, then apply light source illumination, and use the Phong illumination model to draw an image of the magnetic field. This image represents a three-dimensional magnetic flux tube image, which can well express the direction and strength of the magnetic field vector at the same time. The method realizes dense sampling of the magnetic field in the field, and the generated magnetic field image has high speed and high quality, and the performance of the gray image to the vector magnetic field is remarkably improved.
Vector field visualization is an important research topic in the field of scientific visualization. Traditionally, vector field information (direction and magnitude) is often mapped to specific geometric models such as points, lines, faces, and bodies, and then the distribution of vector fields is represented by computer graphics that plot these geometric models. For example, we use a short vector icon on a magnetic or magnetic line to visually describe the magnetic field around the current. The vector field display method based on geometric model is simple, intuitive and versatile; however, there are some innate shortcomings. These methods are generally sparse sampling of the vector field, and can only represent the nature of some local points or online vector fields, and it is difficult to reflect the continuity of the vector field. Because dense sampling is bound to cause confusion between the elements in the displayed image.
In order to maximize the reflection of vector field information in a limited image space, a method of displaying a vector field spatial distribution using a texture image has been developed in recent years. This method directly maps the vector field information to the color values ​​of the individual pixels on the target image, and the samples have the continuity of the image space. The texture image shows the direction and magnitude of the vector field through an ordered arrangement of colors. For example, the spot noise method (Spotnoi-es) and the line integral convolution method (LIC) use the direction information of the field vector to convolve a white noise background image along an oriented ellipse or curve segment to obtain a field vector. The texture image of the direction. This improved method also includes the amplitude information of the field vector into the convolution process, but its display effect is not ideal.
For the display problem of the plane magnetic field, the concept of the magnetic flux tube can be utilized to generate a texture image of the magnetic field. Unlike the point noise method and the LIC method, this method requires neither a white noise background image nor any convolution operation. There is a simple mapping between the magnetic field and the texture image. The width and tangential direction of the flux tube in the image directly correspond to the magnitude and direction of the vector field.
Comparing the above two typical vector field display methods, it can be seen that the geometric model-based method is easy to apply the graphic techniques such as material color and illumination to enhance the visual effect of the image; while the texture image can more fully reflect the information of the vector field. In this paper, taking the plane magnetic field as an example, the concept of magnetic flux tube and concave-convex mapping is used to establish the light illumination model of the magnetic field. This method combines the advantages of the foregoing method, and can obtain a vivid display effect similar to the three-dimensional relief.
Next, we will first briefly introduce the concept of magnetic flux tube and its texture image generation method - "sinusoidal modulation potential map"; then explain the magnetic flux tube illumination model based on bump mapping, discuss the influence of model and light source parameters on image effects We will also give an algorithm and application examples for drawing magnetic field texture images based on light illumination models, and summarize the characteristics and limitations of this method.
1 Planar magnetic field potential map modulated by sinusoidal function According to Maxwell's equation, the magnetic field is a non-scattering vector field.
The magnetic induction B can be expressed by the rotation of the vector magnetic position A. For planar magnetic field problems, vector magnetic bits only have spatial components that are perpendicular to the field plane. And on this plane, the tangential direction of the A line is always consistent with the direction of the magnetic induction.
The texture image of the flux tube can be directly generated from the sinusoidal modulation potential map. The basic process is: making the planar field space and image space Chai Jianyun (196-), male, Zhejiang, associate professor, Ph.D., research direction for electromagnetic field calculation and visualization , special motors and their control, systems. ,.
One-to-one correspondence, then the potential function A is segmentally mapped to the gray value of the image pixel according to its value range. If the same mapping relationship is used for each segmentation interval of A, a periodic mapping function for A is obtained. A grayscale image drawn in this way is called a potential function of a periodic function modulation. If the periodic function is taken as a sinusoidal function, it is called a sinusoidal modulation potential map (SMP).
An SMP map showing the magnetic field distribution around an infinitely long current carrying wire and a sinusoidal modulation function from potential to gray are shown. Where g is the gray level on the pixel in the SMP diagram; gmx is the grayscale variation amplitude; Amx and Amin are respectively the maximum value of the vector potential A in the field and the most geometrically known as the geometric texture mapping (Bumpmap~) Ping).
The virtual normal vector at any point on the magnetic field plane is determined by two angles a and ,, where a is the azimuth of the virtual normal vector on the magnetic field plane, 0 is its elevation angle, see (a). Our idea is to use the direction of the magnetic field vector and the information of the flux tube to determine these two angles, respectively.
(1) The direction in which the magnetic field vector is rotated by 90 degrees counterclockwise is taken as the direction of the orientation vector Nxy of the virtual normal vector. In the case of the vector magnetic small value; the potential period T is an adjustable amount controlled by the observer, and in the case of the bit A, the tangential direction of the A line is the magnetic field. The physical meaning is that each flux tube flows through. Magnetic flux. In the direction of the actual amount. Therefore, the direction of Nxy should be the same as the gradient direction of A, and can also be interactively communicated between the positioning potentials Amax and Amin, that is, the number of the measuring tubes n. From which: T = outside the function curve The angle between the normal direction and the horizontal line is taken as the elevation angle of the virtual normal vector, see (b). However, it should be noted that the gray level here should be understood as the distance away from the magnetic field plane, that is, the height z. The expression of the sinusoidal modulation function curve is assumed to be: 2 the light illumination model of the plane vector magnetic field 2.1 the light illumination model called the light illumination model, ie It is a set of mathematical formulas for calculating the brightness and color of light at any point on the scene according to the laws of optical physics. In the actual calculation of the widely used simple local Phong illumination model, we only need to find the normal vector, the incident ray direction vector, the line of sight vector and the specular reflection direction vector at each visible point on the surface of the scene, then we can calculate each The brightness at the visible point.
2.2 Concave-convex mapping of plane magnetic field The plane magnetic field is distributed on a plane. This plane has only a single normal vector in geometry. Therefore, the direct application of the Phong model does not enhance the display effect of the magnetic field image. However, if you can provide a set of virtual normal vectors for this plane, and this set of virtual normal vectors contains the information of the magnetic field vector, and then apply the Phong model, then a new vector magnetic field display method can be obtained. Here, the magnetic field vector information is converted into a plane virtual normal vector, where a and b are constant coefficients; for the modulation angular frequency, depending on the potential period T, *=not T; + is the phase angle. It is easy to derive. On the function plane (A, z), the magnetic potential gradient of the 2.3 plane vector magnetic field uses the light illumination model to display the plane vector magnetic field. The key is to calculate the virtual normal vector at each pixel in the image. For the plane magnetic field problem with closed analytical solution, the gradient of vector magnetic potential can be directly obtained, and then the virtual normal vector can be calculated. However, for the discrete solution of the magnetic field obtained by numerical solution, such as finite element method, it needs to be point by point. The process 9 is called the bump mapping. The leakage value is the gradient value of the magnetic field. Ved. Take the triangle unit as an example. If we know the coordinates and magnetic position values ​​of each node of a unit, it is not difficult to calculate the magnetic level gradient value in the unit. We define the weight gradient of the magnetic potential gradient on a node to the surrounding unit's magnetic potential gradient, and the weighting coefficient is proportional to the opening angle of the element to the node. After finding the magnetic potential gradient on all nodes, we can linearly interpolate the magnetic potential and magnetic potential gradient at any point in the cell based on the magnetic potential and magnetic potential gradient on the cell node.
2.4 Control parameters of light illumination model From the above description, we can see that the main parameters affecting the planar magnetic field illumination model include the incident ray direction vector, the modulation function amplitude b and the potential period T. The light illumination model shows the plane vector magnetic field map has Some properties similar to the plane magnetic field potential map modulated by a sinusoidal function. First, it represents the image of a continuous, smooth magnetic flux tube. The tangential direction of the flux tube is the direction of the magnetic field vector, and the width of the flux tube is inversely proportional to the average magnetic induction intensity of the adjacent field. Since the fluxes flowing through all the flux tubes are the same, we can visually observe the strength of the magnetic induction from the differences and changes in the widths of the individual flux tubes on the image. Secondly, we can appropriately select the magnetic flux T in the flux tube so that the width of the flux tube becomes narrow enough in the field where the magnetic density is high, so that the direction of the magnetic field vector can be observed more clearly. The duality of the direction and width of the flux tube makes it possible to obtain complete information on the direction of the magnetic field vector and the magnitude of the field strength on its display image.
But unlike the plane magnetic field potential map, in the light illumination model, we can adjust the amplitude of the modulation function to change the minimum value of the elevation angle in the virtual normal vector. The larger the amplitude of the modulation function is, the smaller the minimum value of the elevation angle in the virtual normal vector is, and the three-dimensional image of the flux tube becomes more prominent. In addition, in the light illumination model, we can also change the direction of the incident light in real time through an interactive method to obtain a continuously changing magnetic field image animation, thereby deepening the observer's understanding of the magnetic field structure.
In drawing, if full color resources are allowed, we can also map the magnetic induction values ​​of the points in the magnetic field to the corresponding reflection coefficients that produce different diffuse and specular reflection effects on the red, green and blue components of the incident light. This will make the image of the flux tube more vivid and vivid.
3 Algorithm Implementation 3.1 Basic Drawing Algorithm Drawing a basic algorithm for displaying a plane magnetic field map using a light illumination model can be summarized as the following seven steps: a two-dimensional affine transformation is generally selected, which includes translation, rotation and scaling transformation. Selecting the parameters of the appropriate sinusoidal modulation function as a potential-Frequency vector mapping function; selecting a pixel from the pixel points that have not been drawn on the target image, and mapping the point to the field space using a spatial mapping function; The result of magnetic position analysis formula or numerical calculation, calculation or interpolation to obtain the potential value and potential gradient value at the point; using the concave-convex mapping function of the magnetic field, the position potential value and the potential gradient value on the field point are calculated. A virtual normal vector at a pixel; using the virtual normal vector of the point, the gray value of the pixel is obtained according to the light illumination model; and whether there are any pixels that have not been drawn on the target image.
If so, go back to step 3; otherwise, end.
3.2 Scanning line drawing algorithm of finite element analysis results For the magnetic field data obtained by using the first-order linear element finite element method, it is possible to use the fast shading processing techniques such as Gouraud shading or Phong shading processing (normal vector interpolation shading). At the same time, in order to reduce the calculation amount of the light luminance interpolation in the drawing process and shorten the drawing time, a scanning line amount algorithm with a faster drawing speed can also be used.
4 Example verification shows the magnetic field distribution around the infinitely long current-carrying lines of two circular sections displayed by the light illumination model. The currents in the two current-carrying lines are equal in magnitude and opposite in direction. From this figure, the relationship between the â—Ž-image space and the field space between the two wires can be clearly seen from the three-dimensional embossed magnetic flux tube. bShinglUtifC=Um; the central region expands divergent patterns outward. In the central region, the magnetic induction intensity is high, the width of the flux tube is narrow, and its brightness changes drastically.
In the edge region, where the magnetic induction is low, the flux tube becomes wider and the light-dark transition becomes gentler.
The finite element analysis results of the no-load magnetic field of a permanent magnet synchronous motor are shown. The first-order triangular element is used in the finite element calculation, such as (a). Using the scan line algorithm described in the previous section, the magnetic field diagram of the motor in (b) is plotted.
(a) Field segmentation of no-load magnetic field of permanent magnet synchronous motor. Based on the gradation potential map of sinusoidal function modulation, a light for displaying magnetic field is proposed based on the concept of magnetic flux tube and concave-convex mapping. Lighting model.
This method combines the advantages of the two typical methods of displaying the magnetic field commonly used geometric modeling method and texture image method, realizes the dense sampling of the magnetic field in the field, can obtain the display effect of the magnetic flux tube similar to the three-dimensional relief, and significantly improve the gray The ability of the image to express the vector magnetic field, and the observer's ability to interact with the magnetic field.
In the future work, you can also make full use of today's powerful graphics acceleration hardware, such as OpenGL 3D graphics library, through which strong observers can observe the interaction of magnetic field processes. In addition, the transparency can be further considered in the algorithm, giving the observer a more vivid 3D flux tube image.
Virtual Studio Video Production
Virtual Studio Video Production,Media Processor,Virtual Press Center,Campus Tv Studio System
SZ REACH TECH,.CO LTD , https://www.szreachtech.com