Professional Documents
Culture Documents
The Evolution of Conned Ferro Uids: Timothy Green, Queens' College November 28, 2008
The Evolution of Conned Ferro Uids: Timothy Green, Queens' College November 28, 2008
The Evolution of Conned Ferro Uids: Timothy Green, Queens' College November 28, 2008
uids
Timothy Green, Queens' college
Abstract
Ferro
uid droplets are examined in conditions such that they are conned to move in a plane with a magnetic
eld perpendicular. It is found that the dynamics of the droplets are roughly in agreement with the dynamics
as proposed by Langer et. al [3]. It is suggested that a correction could be made to the force equations to
account for 'sticking' or static friction of the
uid, which seems to be the dominant eect causing disagreement
between experiment and theory. It is also found that, in most circumstances, the trend to equilibrium of the
droplet perimeter could be described by a rst order rate equation.
Ferro
uids are
uids made up of small magnetic par- The method used to create the ferro
uid samples was
ticles suspended by brownian motion in a surcant. to take the two clean glass slides, put a small amount
They become strongly magnetized when in a mag- of water on the lower slide in the holder, inject a small
netic eld, undergoing complex dipole interactions as amount of ferro
uid with a hypodermic needle into
well as the surface tension forces normally present in the water and then place the other glass slide over
a
uid. the top.
For the purposes of this experiment, we are only con- The holder and sample were then placed between the
cerned with ferro
uids conned between two glass electromagets, the video recording started, and then
plates with a magnetic eld perpendicular to the the magnetic eld turned on to the level required.
plates. Langer [3] demonstrated that the dynamics of The video was then stopped when there were no more
a viscous ferro
uid conned between two plates with a observable changes in the ferro
uid.
perpendicular magnetic eld could be modelled purely This was repeated for varying eld strengths (see ta-
by the state of the
uid droplet boundary. ble 1) and varying holder sizes (see table 2 for plate
The aim of this paper is to test the validity of these separations used).
equations of motion, as described in the theory sec-
tion, by comparing them to actual behaviour of fer-
ro
uids. 2.3 Calibration
1
2
A Electromagnet
Glass
plates
Gap for fluid
Height h
Electromagnet
35
30 0.2560 0.0500
25 0.3454 0.1394
20
15 Table 2: Holder size to plate separation h
10
5
0
0 500 1000 1500 2000 Potential function Phi
Current / mA 2.5
phi(xi)
Current / mA Field / Gauss 1
400 10 77.9 6:5
500 10 96.2 6:5 0.5
Table 1: Electromagnet current to eld strength in Figure 3: Boundary segment to segment potential
Gauss, as determined by gure 2 function, equation 3
"0 =
L + "f (1) is a uniform pressure force along the boundary that
ensures the constancy of the droplet area.
Where L is the length of the perimeter and "f is the
magnetic dipole contribution for that arrangement.
4 Results
I I
= hE
2
1 ds0 t^ t^0 (R=h)g
8 fA 2 (2)
0
"f ds
The videos of the evolving droplets for every plate sep-
aration and eld strength used were processed frame
p by frame to isolate the edges of the main droplet and
( ) = sinh 1 (1= ) + 1 + 2 (3) then recover a loop of vertices around the edge of the
droplet, as shown in gure 4. As can be seen, the al-
Where h is the plate separation, E0 = 4M0 = 4H , gorithm was largely successful, though did sometimes
A is the area within the boundary, and R is the dis- miss very thin arms such as in the bottom right frame.
tance between the two line segments. ( ) is the seg- Open loops were merged with each other to give a sin-
ment to segment potential function and is plotted in gle main loop, which was then written to le.
gure 3.
Using these and converting the force into a velocity
by assuming dominant dissapation by viscosity (ab- 5 Discussion
sorbed into the equations by a change in time coordi-
nate, such that the time evolution isn't directly com-
parable to experiment but should be self consistant), The loops as processed from the video frames were
the normal velocity U of a position s (with curvature then analysed to get the normal velocities of the ver-
) on the boundary is: tices along the boundary. Projecting each vertex
along its normal onto the loop of the next frame will
recover this, with small errors due to vertices not co-
inciding between frames exactly.
U (s) = U0 (s) + (4)
I
U0 (s) =
E2 ^ t^[p(1 + (h=R)2 )
+ 02 ds0 R
8 1] In
(5) addition to this, a simulation was written using the
equations 4 to 6. Taking the loop from 2.5s into the
= 1I dsU0 (s)
video as the starting conditions, the simulation was
(6) advanced for 5000 frames at constant delta.
L
1 1
250 250
0.8 0.8
200 200
0.6 0.6
150 150
0.4 0.4
100 100
0.2 0.2
50 50
0 0
-0.2 0 -0.2 0
-0.2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 -0.2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6
1 1
250 250
0.8 0.8
200 200
0.6 0.6
150 150
0.4 0.4
100 100
0.2 0.2
50 50
0 0
-0.2 0 -0.2 0
-0.2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 -0.2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6
Figure 4: A demonstration of the outline nding algorithm, showing the video frames (inverted intensity) and
discovered outlines. Scale units are in cm.
0.0002 cating that the strong noise in the rms normal velocity
is a local eect and doesn't change the overall dynam-
Mean U
-0.0002 gets the results broadly right but often reaches equi-
librium at a dierent time to the experimental results,
and underestimates the nal perimeter in most cases.
-0.0004
Figure 6: Comparison of simulated rms normal velocity against experimentally determined normal velocity
6e-06 0.0008
0.0006
4e-06
0.0004
2e-06 0.0002
0 0
0 0.0001 0.0002 0.0003 0.0004 0.0005 20 40 60 80 100 120 140
Figure 7: Comparison of simulated rms normal velocity against experimentally determined normal velocity
Simulated perimeter vs. time for h = 0.136mm Experimental perimeter vs. time for h = 0.136mm
4.5 4.5
400mA 400mA
4 500mA 4 500mA
3.5 600mA 3.5 600mA
700mA 700mA
3 800mA 3 800mA
2.5 2.5
2 2
1.5 1.5
1 1
0.5 0.5
0 0
0.0e+00
5.0e-05
1.0e-04
1.5e-04
2.0e-04
2.5e-04
3.0e-04
3.5e-04
4.0e-04
4.5e-04
5.0e-04 0.0e+00 5.0e+01 1.0e+02 1.5e+02 2.0e+02
Simulated perimeter vs. time for h = 0.166mm Experimental perimeter vs. time for h = 0.166mm
3 3
400mA 400mA
500mA 500mA
2.5 600mA 2.5 600mA
700mA 700mA
2 2 800mA
1.5 1.5
1 1
0.5 0.5
0 0
0 5e-050.0001
0.00015
0.0002
0.00025
0.0003
0.00035
0.0004
0.00045
0.0005 0 50 100 150 200
Simulated perimeter vs. time for h = 0.438mm Experimental perimeter vs. time for h = 0.438mm
3 3
400mA 400mA
500mA 500mA
2.5 600mA 2.5 600mA
700mA 700mA
2 800mA 2 800mA
1.5 1.5
1 1
0.5 0.5
0 0
0.0e+00
5.0e-05
1.0e-04
1.5e-04
2.0e-04
2.5e-04
3.0e-04
3.5e-04
4.0e-04
4.5e-04
5.0e-04 0.0e+00
2.0e+01
4.0e+01
6.0e+01
8.0e+01
1.0e+02
1.2e+02
1.4e+02
1.6e+02
1.8e+02
Figure 8: Comparison of simulated perimeter growth against experimentally determined perimeter growth
Simulated perimeter vs. time for h = 0.500mm Experimental perimeter vs. time for h = 0.500mm
3 3
400mA 400mA
500mA 500mA
2.5 600mA 2.5 600mA
700mA 700mA
2 800mA 2 800mA
1.5 1.5
1 1
0.5 0.5
0 0
0.0e+00
5.0e-05
1.0e-04
1.5e-04
2.0e-04
2.5e-04
3.0e-04
3.5e-04
4.0e-04
4.5e-04
5.0e-04 0.0e+002.0e+014.0e+016.0e+018.0e+011.0e+021.2e+021.4e+02
Simulated perimeter vs. time for h = 1.394mm Experimental perimeter vs. time for h = 1.394mm
1.8 1.8
400mA 400mA
1.6 500mA 1.6 500mA
1.4 600mA 600mA
700mA 1.4 700mA
1.2 800mA
1.2
1
1
0.8
0.8
0.6
0.4 0.6
0.2 0.4
0 0.2
0.0e+00
5.0e-05
1.0e-04
1.5e-04
2.0e-04
2.5e-04
3.0e-04
3.5e-04
4.0e-04
4.5e-04
5.0e-04 0.0e+00 2.0e+01 4.0e+01 6.0e+01 8.0e+01 1.0e+02
Figure 9: Comparison of simulated perimeter growth against experimentally determined perimeter growth
250
0.136mm
0.166mm
0.438mm
0.500mm
200 1.394mm
Experimental equilibrium time / s
150
100
50
0
0.0e+00 5.0e-05 1.0e-04 1.5e-04 2.0e-04 2.5e-04 3.0e-04 3.5e-04 4.0e-04 4.5e-04
Simulated equilibrium time / arbitrary time
Figure 10: Comparison of time to equilibrium in the experiment and simulation. There is a rough linear trend
apparent, as expected if the simulation is to replicate the dynamics to equilibrium
250
0.136mm
0.166mm
0.438mm
200 0.500m
1.394mm
0.136mm fit
0.166mm fit
150 0.438mm fit
Equilibrium time
0.500mm fit
1.394 fit
100
50
-50
4.0e+02 4.5e+02 5.0e+02 5.5e+02 6.0e+02 6.5e+02 7.0e+02 7.5e+02 8.0e+02
Current / mA
Figure 11: Time to equilibrium in the experiment versus the current in the electromagnet, with trendlines for
each plate separation h
0.00045
0.136mm
0.166mm
0.0004 0.438mm
0.500mm
0.00035 1.394mm
0.136mm fit
0.0003 0.166mm fit
0.438mm fit
Equilibrium time
0.500mm fit
0.00025 1.394 fit
0.0002
0.00015
0.0001
5e-05
-5e-05
4.0e+02 4.5e+02 5.0e+02 5.5e+02 6.0e+02 6.5e+02 7.0e+02 7.5e+02 8.0e+02
Current / mA
Figure 12: Time to equilibrium in the simulation versus the current in the electromagnet, with trendlines for
each plate separation h
250
400mA
500mA
600mA
700mA
200 800mA
Equilibrium time
150
100
50
0
0.0e+00 2.0e-01 4.0e-01 6.0e-01 8.0e-01 1.0e+00 1.2e+00 1.4e+00
Plate separation / mm
Figure 13: Time to equilibrium in the experiment versus the plate separation h
0.00045
400mA
500mA
0.0004 600mA
700mA
0.00035 800mA
0.0003
Equilibrium time
0.00025
0.0002
0.00015
0.0001
5e-05
0
0.0e+00 2.0e-01 4.0e-01 6.0e-01 8.0e-01 1.0e+00 1.2e+00 1.4e+00
Plate separation / mm
Figure 14: Time to equilibrium in the simulation versus the plate separation h
2 1.2
1.8 1.1
1.6
1
1.4
Perimeter / cm
Perimeter / cm
0.9
1.2
0.8
1
0.7
0.8
0.6
0.6
0.4 0.5
0.2 0.4
0 0.3
0 5e-05 0.0001 0.00015 0.0002 0.00025 0.0003 0.00035 0.0004 0.00045 0.0005 0 5e-05 0.0001 0.00015 0.0002 0.00025 0.0003 0.00035 0.0004 0.00045 0.0005
t t
0.37
2
0.36
Perimeter / cm
Perimeter / cm
1.5
0.35
0.34
1
0.33
0.5
0.32
0.31 0
0 5e-05 0.0001 0.00015 0.0002 0.00025 0.0003 0.00035 0.0004 0.00045 0.0005 0 20 40 60 80 100 120 140 160
t t
Figure 15: Demonstration of ts of equation 7 to perimeter growth in three simulations and one experiment
ples of tting this behaviour to the perimeter vs. time gests that the resulting rough structure of the droplet
is shown in gure 15. As you can see, it ts well for in terms of arms is relatively stable for given starting
the top two examples, but poorly for the third trend. conditions, as suggested in Langer 1992's examination
This could be due to a more complex interaction that of the growth rates of modes by varying bond num-
only becomes apparent for larger h, das h = 1:394mm ber (a expression of the ratio between magnetization,
does t the trend L(t) = a be (tc) to a higher ac- 2 2
plate separation and surface tension Nbo = 2M
0 h ).
curacy.
The t parameter c, which may be considered the rate
of convergence, is shown in gure 16 plotted against 6 Conclusion
current and plate separation. This might be expected
to give similar results to gures 12 and 14 - though
there is signicant variation. This may be due to dif- The experiment and theoretical simulation largely
culties in tting properly, especially as the model agree for equilibrium dynamics and the overall struc-
doesn't account for the start of the destabilization, ture of the droplets formed, but fail to precisely repli-
only the trend to equilibrium. cate the results found. We might not expect precise
agreement due to the unstable nature of the dynam-
ics, but a number of issues such as the 'sticking' of
5.3 Comparison of actual shapes ver- the boundaries and the failure for the simulation to
sus simulated theory
develop the small, fast arms seen in experiments in-
dicate that experiment does deviate from theory.
As a nal part we can look at the theoretical predic- One possible modication would be a non-linear law
tions of the shapes evolved versus the experimental on the boundary force (velocity) that reduced the ef-
shapes in order to determine where the two might di- fectiveness for lower forces in moving the boundary,
verge. Figures 17 to 21 in Appendix A show the video for example U = F 1:5 . This might be tuned by look-
captures initial state, nal state, and the simulated - ing at a distribution of the normal velocities found
nal state when started from the same initial state with from the experimental videos, and determining if a
the experimentally measured conditions (H , h, etc.). population of a particular normal velocity has been
shifted to a lower range compared to the simulation.
It's apparent that the simulated nal states share
many features with the experimental nal states, such It's also been shown that the trend to equilibrium
as the number and positions of arms and the widths could be described by a rst order rate equation,
of arms. This can be explained as the initial desta- though further investigation into this would likely
bilizations progressing in the same way for both ex- need a theoretical model for the trend to equilibrium.
periment and theory, and the resulting force balance
being similar. However, it is also apparent that the In addition, the image recognition could be improved
simulation gives much smoother and bulbous ended to ensure that all of the droplets are recognized (an
droplets compared to experiment. The experimental increase in camera resolution would help here, espe-
data tends to show the main boundaries not moving cially with the boundaries of small droplets only a few
much, and smaller arms punching out and travelling pixels across) and the force code improved to consider
a long distance, while the simulated data shows the loop to loop interactions - which may be a small fac-
main boundaries smoothly deforming inwards as the tor, though likely not signicant for the results found
arms grow outwards. This could be due to a static here as the major deviations are still visible in frames
frictional adhesion of the
uid to the slides, prevent- only containing as single droplet, it will be important
ing movement below a certain force limit, or the is- for situations such as more complex labyrinths.
sues involved in moving the
uid bulk around the
droplet. This is particually apparent in gure 17 for Another possible eect would be the dissolving of
h = 0:136mm, showing the simulated droplets col- some of the ferro
uid into the water, changing the sur-
lapsing inwards into complex patterns while the ex- face tension and so the energy balance, though that
perimental droplets staying stubbornly very similar - would likely exhibit itself in higher boundary forces
especially at low elds, perhaps due to the smaller and the droplets moving quicker than expected. One
plate separation causing greatest adhesion. nal eect that might be considered is a cuto in the
assumption of 2D movement for droplets which are
A number of the simulations failed to run, particually very small compared to the plate separation. This
for the highest eld (800mA), mainly due to numeri- has largely been avoided in this investigation by us-
cal instability for larger forces. Despite this, a trend ing droplets on a similar order of size to the plate
can be seen that the simulation is more successful for separation.
higher eld strengths, suggesting that it is an issue
of overcoming the adhesion forces, though still fails We have shown that even the dynamics of a complex
to replicate the long arms often created. It also sug- non-linear system such as the conned ferro
uid can
35000 35000
30000 30000
25000 25000
20000 20000
c
c
15000 15000
10000 10000
5000 5000
0 0
400 450 500 550 600 650 700 750 800 0 0.2 0.4 0.6 0.8 1 1.2 1.4
Current / mA h / mm
Figure 16: Plots of t parameter c, the rate of convergence, to the simulation perimeter growth
7 Acknowledgements
8 References
References
9 Appendix A
0.5 0.65
’dyn_test/0.013600-400.000000’ ’dyn_test/0.013600-500.000000’
’loops/0.013600-400.000000-5’ ’loops/0.013600-500.000000-5’
0.48 ’loops/0.013600-400.000000-268’ ’loops/0.013600-500.000000-165’
0.6
0.46
0.55
0.44
0.5
0.42
0.4 0.45
0.38
0.4
0.36
0.35
0.34
0.3
0.32
0.3 0.25
0.6 0.65 0.7 0.75 0.8 0.85 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 1.05
0.75 1
’dyn_test/0.013600-600.000000’ ’dyn_test/0.013600-700.000000’
’loops/0.013600-600.000000-5’ ’loops/0.013600-700.000000-5’
’loops/0.013600-600.000000-330’ ’loops/0.013600-700.000000-226’
0.7 0.9
0.65 0.8
0.6 0.7
0.55 0.6
0.5 0.5
0.45 0.4
0.4 0.3
0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65
0.9
’dyn_test/0.013600-800.000000’
’loops/0.013600-800.000000-5’
’loops/0.013600-800.000000-171’
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8
Figure 17: Comparison of initial and nal video frames and nal simulation state (as started from the initial
video frame) for h = 0:136mm. Simulated nal state is shown with a solid line.
0.52 0.5
’dyn_test/0.016600-400.000000’ ’dyn_test/0.016600-500.000000’
’loops/0.016600-400.000000-5’ ’loops/0.016600-500.000000-5’
’loops/0.016600-400.000000-479’ ’loops/0.016600-500.000000-371’
0.5
0.45
0.48
0.4
0.46
0.44 0.35
0.42
0.3
0.4
0.25
0.38
0.36 0.2
0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1 0.5 0.55 0.6 0.65 0.7 0.75 0.8
0.7 0.55
’dyn_test/0.016600-600.000000’ ’dyn_test/0.016600-700.000000’
’loops/0.016600-600.000000-5’ ’loops/0.016600-700.000000-5’
0.65 ’loops/0.016600-600.000000-640’ ’loops/0.016600-700.000000-223’
0.5
0.6
0.45
0.55
0.4
0.5
0.45 0.35
0.4
0.3
0.35
0.25
0.3
0.2
0.25
0.2 0.15
0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6
0.7
’loops/0.016600-800.000000-5’
’loops/0.016600-800.000000-141’
0.65
0.6
0.55
0.5
0.45
0.4
0.35
0.3
0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65
Figure 18: Comparison of initial and nal video frames and nal simulation state (as started from the initial
video frame) for h = 0:166mm. Simulated nal state is shown with a solid line.
0.75 0.35
’dyn_test/0.043800-400.000000’ ’dyn_test/0.043800-500.000000’
’loops/0.043800-400.000000-5’ ’loops/0.043800-500.000000-5’
’loops/0.043800-400.000000-172’ ’loops/0.043800-500.000000-178’
0.7
0.3
0.65
0.25
0.6
0.2
0.55
0.15
0.5
0.1
0.45
0.05
0.4
0.35 0
0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.65 0.7 0.75 0.8 0.85 0.9
0.6 0.75
’dyn_test/0.043800-600.000000’ ’dyn_test/0.043800-700.000000’
’loops/0.043800-600.000000-5’ ’loops/0.043800-700.000000-5’
’loops/0.043800-600.000000-129’ ’loops/0.043800-700.000000-159’
0.55 0.7
0.5 0.65
0.45 0.6
0.4 0.55
0.35 0.5
0.3 0.45
0.25 0.4
0.2 0.35
0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8
0.85
’dyn_test/0.043800-800.000000’
’loops/0.043800-800.000000-5’
’loops/0.043800-800.000000-160’
0.8
0.75
0.7
0.65
0.6
0.55
0.5
0.45
0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
Figure 19: Comparison of initial and nal video frames and nal simulation state (as started from the initial
video frame) for h = 0:438mm. Simulated nal state is shown with a solid line.
0.65 0.65
’dyn_test/0.050000-400.000000’ ’dyn_test/0.050000-500.000000’
’loops/0.050000-400.000000-5’ ’loops/0.050000-500.000000-5’
’loops/0.050000-400.000000-276’ ’loops/0.050000-500.000000-239’
0.6 0.6
0.55
0.55
0.5
0.5
0.45
0.45
0.4
0.4
0.35
0.35
0.3
0.3 0.25
0.25 0.2
0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7
1 0.6
’dyn_test/0.050000-600.000000’ ’dyn_test/0.050000-700.000000’
’loops/0.050000-600.000000-5’ ’loops/0.050000-700.000000-5’
’loops/0.050000-600.000000-153’ ’loops/0.050000-700.000000-218’
0.55
0.9
0.5
0.8
0.45
0.7
0.4
0.6
0.35
0.5
0.3
0.4 0.25
0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 1.05 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75
0.58
’dyn_test/0.050000-800.000000’
’loops/0.050000-800.000000-5’
’loops/0.050000-800.000000-176’
0.56
0.54
0.52
0.5
0.48
0.46
0.44
0.42
0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86
Figure 20: Comparison of initial and nal video frames and nal simulation state (as started from the initial
video frame) for h = 0:500mm. Simulated nal state is shown with a solid line.
0.55 0.85
’dyn_test/0.139400-400.000000’ ’dyn_test/0.139400-500.000000’
’loops/0.139400-400.000000-5’ ’loops/0.139400-500.000000-5’
’loops/0.139400-400.000000-234’ ’loops/0.139400-500.000000-272’
0.5 0.8
0.45 0.75
0.4 0.7
0.35 0.65
0.3 0.6
0.25 0.55
0.2 0.5
0.15 0.45
0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 0.940.960.98 1 1.021.041.061.081.1
0.55
’dyn_test/0.139400-700.000000’
’loops/0.139400-700.000000-5’
’loops/0.139400-700.000000-114’
0.5
0.5 0.45
’dyn_test/0.139400-600.000000’
0.45 ’loops/0.139400-600.000000-5’
’loops/0.139400-600.000000-108’
0.4
0.4
0.35
0.3
0.25 0.35
0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2
0.3
0.25
0.76 0.78 0.8 0.82 0.84 0.86 0.88
0.75
’loops/0.139400-800.000000-5’
’loops/0.139400-800.000000-109’
0.7
0.65
0.6
0.55
0.5
0.45
0.4
0.35
0.3
0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9
Figure 21: Comparison of initial and nal video frames and nal simulation state (as started from the initial
video frame) for h = 1:394mm. Simulated nal state is shown with a solid line.
\\jag84a.quns.cam.ac.uk\offloader\e1\code\loops.h 1
#pragma once
#include <vector>
#include "util.h"
struct experiment_config
{
double dx; // Pixel -> cm
double dy;
double temp;
double current;
int bpp;
};
struct vertex
{
point p;
point t;
double kappa;
double s;
double U0_m;
double U0_st;
double U;
};
std::vector<point> points;
// Smooth points
for(int i=0; i < points_in.size(); ++i)
{
// points.push_back(point((points_in[wrap(i-1, points_in.size())].x + points_in[i].x
+ points_in[wrap(i+1, points_in.size())].x) / 3.0,
// (points_in[wrap(i-1, points_in.size())].y + points_in[i].y + points_in[wrap(i+
1, points_in.size())].y) / 3.0));
points.push_back(points_in[i]);
}
// First order
for(int i=0; i < points.size(); ++i)
{
xp[i] = (points[wrap(i+1, points.size())].x - points[wrap(i-1, points.size())].x)
/ (s[wrap(i-1, points.size())] + s[i]);
yp[i] = (points[wrap(i+1, points.size())].y - points[wrap(i-1, points.size())].y)
/ (s[wrap(i-1, points.size())] + s[i]);
}
\\jag84a.quns.cam.ac.uk\offloader\e1\code\loops.h 2
// Second order
for(int i=0; i < points.size(); ++i)
{
xpp[i] = (xp[wrap(i+1, points.size())] - xp[wrap(i-1, points.size())]) / (s[wrap(i
-1, points.size())] + s[i]);
ypp[i] = (yp[wrap(i+1, points.size())] - yp[wrap(i-1, points.size())]) / (s[wrap(i
-1, points.size())] + s[i]);
}
// Line curvature
for(int i=0; i < points.size(); ++i)
{
kappa[i] = (xp[i] * ypp[i] - yp[i] * xpp[i]) / pow(xp[i]*xp[i] + yp[i]*yp[i], 1.5)
;
delete[] xp;
delete[] xpp;
delete[] yp;
delete[] ypp;
}
t[i].x = dx / mag;
t[i].y = dy / mag;
}
//f[i].x = 0.0;
//f[i].y = 0.0;
U0_m[i] = 0.0;
\\jag84a.quns.cam.ac.uk\offloader\e1\code\loops.h 3
y, 2.0));
//printf("Trying R=%e...",R);
if(R == 0.0)
continue;
// Energy
double ds_ids_j = ds_i * (s[j] + s[wrap(j-1, loop.size())]) / 2.0;
// Force
point Rv = point((loop[j].x - loop[i].x)/R, (loop[j].y - loop[i].y)/R);
}
}
}
//printf("Blah");
void calc_forces(std::vector<point> loop, double *U, double* U0, double* U0_st, double*
U0_m, point *tan, experiment_config &config, double fudge, double fudge2, double &
length, double *s)
{
double *k = new double[loop.size()]; // curvature of element
length = 0.0;
Pi /= length;
delete[] k;
}