Tuesday, February 16, 2021

Simulating and Visualizing 3D Sine Waves and Interference Using Blender - An Antenna Array Factor Example

Complex equations make it hard to understand how a behavior of a system changes with different design. Visualizing the result of design changes helps develop insight and can lead to better designs. Matlab, Python, and other tools are typically used to do this kind of exploration. However, other tools can also be very useful. 

Blender is used to visualize scientific results from simulations and scripts like shown here. Surprisingly, it can also be used to simulate and gain insight into real physical systems. The animation below shows a visualization of the interactions that contribute to the 'Array Factor' for an array of antennas as the spacing between 5 elements varies. Because of how optimized Blender is for rendering and geometry, this animation can be interacted and rendered in real time. The way this is generated is to used the 'shaders' in Blender to calculate the array factor. 


Discussion

The array factor for an antenna is defined as 


This calculation describes how the radiation from an antenna is scaled when it is part of a phased array. A key aspect is that by putting antennas in arrays, the radiation becomes stronger in some directions and weaker in others. This equation describes how the waves from each antenna are combined. 
This equation uses complex numbers, can be seen differently using Euler's formula
By expanding the AF equation, it becomes evident that this can be simulated using a repeating wave. This is where Blender can be used.

In Blender, there is high performance, highly optimized code used to texture the geometry. This is referred to as shaders. There are standard shaders and it is even possible to write customer shaders in OSL. Shaders can be defined as functions of x,y,z in space along with inputs from geometry and other attributes in the Blender mode.

By using the shader logic its possible to solve for the interference patterns in array antennas and visualize the results.

References


Tools


Details

The first step is defining sinusoidal waves that are a function of the origin of each antenna. This is done using the wave texture configured for spherical waves. The 'Vector' input locates the wave in space.




This wave texture is generated for each antenna in the array. In this example, there are 5 antennas, so there are 5 wave textures used.


To tie this into the antennas, the coordinates from each antenna are introduced into the shader using a texture coordinate from the antenna object. This way, if the antenna moves, then the origin of each wave moves.



This logic describes the radiation anywhere in the model. It is just a matter of assigning it to a volume or surface to visualize. This requires converting the output of the sine waves into a color, then defining how it is used to color a surface.



Putting all of this together, the antennas can be positioned anywhere, and the resulting interference pattern of the waves will be quickly and correctly calculated, then visualized. The array factor for two different antenna arrays are shown below. 




Additional detail and rendering options can be found in this stack exchange answer - https://blender.stackexchange.com/questions/213194/i-need-to-simulate-the-interference-of-two-sinewaves/213260#213260




No comments:

Post a Comment