I'm using Origin to average 10 magnetic hysteresis loops, but because the center of the loop has multiple y values for each x (for the two legs of the loop) the averaging is coming out really strange. Is there an easy way to do this?
Can you specify what do you mean by 'strange'? If I understood you correctly, at the moment you are getting an average of all the up- and down- branches of the hysteresis loop, right?
The only problem with the separation in the ascending and the descending branch is the lack of automation. If one has many loops, then one can predefine the bin size for the x-axis (the field) and run a for-to-next loop through the whole loop.
For the separation I recommend writing a small Matlab program that follows the field column and breaks up the data to sections whenever a change in direction occurs. For example: Loop through N steps and at step n check
Amir's approach here sounds the most logical, especially if you have a different number of points for each loop. Personally I would have taken a fixed number of points per loop using the 'driven field' method and then used Sigmaplot to get a mean average frim the x and y data sets, this takes out any anomalous points that could exist in one or two data sets.
A relatively easy way is to average each branch (descending and ascending, respectively) separately. In the graph window, go to menu Layer Content. There, in the Edit Range menu, change the range from 1 to max/2 points for each of the 10 curves, and then average (Analysis/Mathematics/Average multiple curves). Save the averaged descending curve. Repeat the same for the ascending one starting from max/2 to max. This procedure shoud take you less than 5-10 min. Hope it helps, Julian Geshev
From the technical point of view the Amir's approach looks optimal. However, I do not understand the reason for measuring several hysteresis loops and averaging them. For any stable compound and constant experimental conditions you should get stable results, without need of averaging them. If not, you should check the experiment itself.
Thank you all for the suggestions. I did end up breaking the loops into ascending and descending portions...in the future I may change our routine to make this a bit easier.
As far as why we need to average multiple loops: this particular compound has a very weak magnetization and we're looking for small changes in saturation with applied electric field, so we need to average the loops.
Once more, if you follow the Christofer Quinn's procedure and fix number of points, then you have field values in e.g. col(a) and moment values corresponding to the given field value in the same row of the following columns. Then you don't need to separate the loop branches, only open a new column and by right click select "set column values", where you determine the average value (1/10*(col(b)+col(c)+col(d)......+col(k) )). You get directly the average values for all the field values of the loop. You don't need to write this definition next time, only copy it from an older worksheet.
I guess I still do not understand why your averaging the hysteresis loops. Very weak magnetization and small changes in saturation? Are you getting a lot of noise in your measurements that your trying to average out? What instrument are you using for hysteresis measurements? If your using a SQUID magnetometer, it is designed to measure very small magnetic moments (10^-8 emu). Even then, if your still getting noise, it could mean a measurement procedure problem. For example, if you are taking measurements with a drop in temperature, then the magnetization 'noise' could be a result of your sample not in thermal equilibrium with the environment. Hence you need to wait longer at each temperature. If you are using a Quantum Design MPMS, the controlling software has a command called 'multimeasure'. It permits the collection of many datapoints under one applied field value, removes outliers and averages the others for you. You have total control over how many measurements, how many outliers to throw out, etc. It also records two datafiles, one with the averaged value only, and a second with ALL of the datapoints taken.
The best way is to separate total hysteresis points of individual loops (H= 0 -> H_max->0-> -H_max->0->H_max) in 20 columns. If your field steps are identical then average all the ten corresponding magnetization values.
The first thing you can do is try to unify the origins, it should match if parts of zero to saturation magnetization and then built the continuous cycle. The unifying the centers would be more convenient. Now, if they are not centered: are you sure that there is the phenomenon of exchange bias in your sample?, And not just a measurement error?
What the people are usually doing in a noisy experiments is to take careful measurements. The time constant of order of 100s or even 200s in (paleo)magnetic measurements is quite often. Then you need no averaging at all. On the other hand, if you suspect unstable measurements then they may have a cause like "exchange bias" and its "training effect" (horizontal shifts of hysteresis loop) or "reptation" (vertical shift). Both those shifts are nonlinear functions of time. And one more effect: the loops are different when taken at different field sweeps: the faster the field changes the higher the observed coercivity. There is also a thing called "magnetic viscosity" which may also affect your results, especially when the exciting field sweep is not constant (or you have different waiting times between change from field going up to field going down).
All of you loops should match, unless you have exchange bias within your sample. Obviously on the first run you will also get an initial curve which shouldn't appear in subsequent runs unless you completely demagnetise the sample again. Have you thought about calculating dM/dH measurements for your curves, as the differential is not affected by where the centre of the loop is, but only upon the change in magnetisation with field. This should allow direct comparison of each loop differentially and should give a clearer picture.