Fine Tuning

In the preceding example, the material properties were constant within one boundary. Now we will modify the value of charge density rho to be a variable of x and y in the space between the outer boundary and the solenoid. We can give an expression for rho, instead of a constant.

Moreover, let us remove the mesh inside the solenoid core because we are not interested in the filed pattern inside the core (besides, it is too small for us to see any pattern).

Here is the modified segment of the old input file.

# modified boundaries
2
# outer boundary
# with variable rho
4 1 1 1 0.1*(x+y) 
0
1
2
3
# solenoid core
# with no triangles
4 0 10 1  0
4
5
6
7

Here is the new contour plot.

Figure 2.3. Modified Solenoid

Example

You will see the skewed contours due to internal charge distribution. Moreover, the mesh will not contain any triangles inside the solenoid core.

Any expression of x and y can be given for rho. Please refer Table 2.1, “Expressions” for ways to construct expressions. Also refer the manual page pdnmesh_input(5) for further information. For instance, you can construct expressions such as (x+y), (x^2+y^2)/10 etc., to define material properties.

Table 2.1. Expressions

ExpressionExplanation
xX coordinate
yY coordinate
+addition
-subtraction
*multiplication
^power
sin()sine function
cos()cosine function
log()natural logarithm
step()step function
abs()absolute value

By reading this chapter you might have realized that creating an input file is a tedious task. In Chapter 3, Converting DXF Files, we will see a way to speed thing up.