DataTypeComparison » History » Version 1
Anil Prabhakar, 07/22/2013 11:55 AM
1 | 1 | Anil Prabhakar | h1. DataTypeComparison |
---|---|---|---|
2 | |||
3 | h2. *+Comparison of the results of simulating OOMMF problem with 'double' and 'float' for different control point specifications+* |
||
4 | |||
5 | *THE PROBLEM*: |
||
6 | |||
7 | The problem that was taken into contention for simulating had the following specifications: |
||
8 | |||
9 | 1) The geometry considered was the following: |
||
10 | |||
11 | !geometry.png! |
||
12 | |||
13 | 2) Initial Magnetization: initmag2.ovf |
||
14 | |||
15 | The problem which was simulated for obtaining the initial magnetization for this problem, had the following specifications: |
||
16 | |||
17 | Starting orienation: Q=89°, F=90° |
||
18 | Applied field: Bx=100 mT to 0 mT in steps of 25 mT,200 iterations at each step |
||
19 | Relaxation magnetization at Bx=0 mT, with max torque=10-4 |
||
20 | Precision: long double (default setting in 'app/mmsolve/fft.h' |
||
21 | No time control point specification was given. |
||
22 | The OMF file was converted to an OVF file using 'tclsh oommf.tcl avf2ovf <initmag2.omf >initmag2.ovf' |
||
23 | |||
24 | (3) Field Range: 0.0 0.0 0.0 0.0 0.0 0.0 1 -torque 1e-5 -time 1e-7 |
||
25 | |||
26 | This implies that 0 field was applied and the simulation was ended when either the torque at a step was less than 1E-5 or when the elapsed field time for the current field step reaches 1E-7 seconds. |
||
27 | |||
28 | These specification were changed for the different simulations |
||
29 | |||
30 | *Calculation of Metric* |
||
31 | |||
32 | The comparison of 2 simulations are done on the basis of their OVF files corresponding to a particular step. The OVF file has the magnetization vector values at all the points considered in the geometry of the sample. |
||
33 | |||
34 | The format of the OVF file can be understood from the following sample OVF file: |
||
35 | |||
36 | attachment:sampleOVF.txt |
||
37 | |||
38 | The metric which we have considered is the Euclidean Norm which is calculated in the following way: |
||
39 | |||
40 | Let one of the vectors be given by *X*=[x ~1~, x ~2~,...x ~M~] |
||
41 | |||
42 | Let the other vector be given by *Y*=[y ~1~, y ~2~,...y ~M~] |
||
43 | |||
44 | The Euclidean Norm is given by: [(x ~1~-y ~1~) ^2^+(x ~2~-y ~2~) ^2^+...(X ~M~-y ~M~) ^2^] ^1/2^ |
||
45 | |||
46 | *COMPARISON*: |
||
47 | |||
48 | |_.No. |_.Data Type |_. *M* ~i~ (x,y) |_. *m* x *h* |_ Iterations |_. max( *m* ~i~ - *m* ~0~ )|_.Time spent simulating |_. Figure |_. Comments | |
||
49 | | 1 | Double | *M* ~0~ | 1e-4 | | | | Reference| initmag2.ovf| |
||
50 | | 2 | Double | *M* ~1~ | | 10000| 1.62e-2 | 398.05 seconds | Figure 1 | The largest error is seen approximately at the coordinates (0.0, 1.0) and (1.0, 1.0), where, from the field plot we can see that,a discontinuity arises.| |
||
51 | | 3 | Float | *M* ~2~ | | 10000| 4..5e-3 | 372.54 seconds | Figure 2 | | |
||
52 | |||
53 | |||
54 | !double.png! |
||
55 | |||
56 | Figure 1: Magnetization and Euclidian Norm after simulating with double |
||
57 | with different time control points |
||
58 | |||
59 | !float.png! |
||
60 | |||
61 | Figure 2: Magnetization and Euclidean norm after simulating with double and float |
||
62 | with same control specifications. |