Construction of a master curve

Hello everybody,
I have different curves presenting the shear modulus vs angular frequency of a polymer solution measured at different concentrations.
I would like to generate a master curve of the storage modulus vs angular frequency.
Basically, I need to determine the horizontal and vertical shifts in order to superpose all the curve and construct a master curve. I want to automatize the process, instead of shifting the data by hand.

GraphA shows the originlal curves for all concentrations. The aim is to superpose all curves on the red one which is the reference curve. GraphB shows the result when shifting the data by hand.

I want to determine the horizontal and vertical shifts for each concentrations minimizing the error using least square.
Does someone have any idea of an Igor script ?

Many thanks
GraphA.png GraphB.png
To be able to automatically solve for the desired offsets you need to pose this as an optimization problem. For example, you can define a function that computes some distance measure between data points using two offset parameters. A minimum of the function would give you the desired offsets. An alternative and simpler approach may be to compute a line fit to each one of your curves and then compute the offset based on the distance of the line fit to that of the "master" curve.

A.G.
WaveMetrics, Inc.
Quote:
I want to determine the horizontal and vertical shifts for each concentrations minimizing the error using least square.

AG is right that this would an optimization problem, and it might be solved using the Optimize operation. But to do that, you have to figure out what quantity to maximize or minimize. Saying "minimizing the error" is a bit ambiguous. Perhaps in the process of trying to describe to us what that means you will figure out what it means :)

The obvious thing would be minimizing the "distance" between the curves, but the short one on the right seems to have a large number of ways to overlay it on the long one on the left, while keeping some definition of "distance" nearly constant.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
If you decide to keep doing it by hand, Igor has a pretty nifty feature that could help. If you click and hold on one of your graph traces for about a second, it becomes moveable so that you can drag it on top of the other traces by effectively adding a x and/or y offset. Holding shift makes it move in only x or y. It's a lot easier than adding offsets by trial and error in either the trace appearance or source data.
johnweeks wrote:
Quote:
I want to determine the horizontal and vertical shifts for each concentrations minimizing the error using least square.

AG is right that this would an optimization problem, and it might be solved using the Optimize operation. But to do that, you have to figure out what quantity to maximize or minimize. Saying "minimizing the error" is a bit ambiguous. Perhaps in the process of trying to describe to us what that means you will figure out what it means :)

The obvious thing would be minimizing the "distance" between the curves, but the short one on the right seems to have a large number of ways to overlay it on the long one on the left, while keeping some definition of "distance" nearly constant.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com

Thank you all for your answers.
My first idea for this optimization problem was to use my reference cruve as [x_0(i),y_0(i)]. For the curve [x_1(i),y_1(i)] I need to translate , I can create a rescale curve using two variables a and b to obtain [a*x_1(i),b*y_1(i)]. Then I can interpolate on the x_0(i) and obtain a new ensemble [x_0(i),y'_1(i)]. From this point i can create a number : c=Sum on all i (y'_1(i)-y_0(i))² and the final objectif is to choose a and b in order to minimize this sum.
I don't know if this explanation will help you understanding my problem.
Quote:
I can create a rescale curve using two variables a and b to obtain [a*x_1(i),b*y_1(i)]

Are you sure you want multiplication? Think about the small trace on the far right- to move it over to the large trace on the far left (I presume that is your reference curve) you will wind up greatly contracting the X range of the trace on the right. Perhaps you meant to use subtraction?
Quote:
Then I can interpolate on the x_0(i) and obtain a new ensemble [x_0(i),y'_1(i)]. From this point i can create a number : c=Sum on all i (y'_1(i)-y_0(i))² and the final objectif is to choose a and b in order to minimize this sum.

Down-sampling the large curve on the left to match the number of points in the trace on the right might be appropriate. I suspect that this approach will result in basically centering the moving trace on top of the reference curve. Is centering what you want? That won't necessarily find the position where the slopes match best.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
I immediately thought ... Fit the discreet points of each curve using a 3rd or 4th order polynomial function and do the matrix math to normalize the fitting constants.

But then I realized, I am still a novice at MatrixOP. :-)

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
jjweimer wrote:

But then I realized, I am still a novice at MatrixOP. :-)


Alas no MatrixOP in this problem.

I'm also not sure why you'd want to fit a 3 or 4 degree polynomial to this data. My own $0.02 is to run a number of line fits which give you two parameters each for computing the necessary shifts.

A.G.

Igor wrote:
jjweimer wrote:

But then I realized, I am still a novice at MatrixOP. :-)


Alas no MatrixOP in this problem.

I'm also not sure why you'd want to fit a 3 or 4 degree polynomial to this data. My own $0.02 is to run a number of line fits which give you two parameters each for computing the necessary shifts.


I guess the polynomial was an "in my head" transformation of the straight lines on the log-log plot.

Would you suggest two log-log straight lines for each curve, one at the top-right slope and one at the left-bottom slope?

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
jjweimer wrote:

Would you suggest two log-log straight lines for each curve, one at the top-right slope and one at the left-bottom slope?

I'm not a big fan of log-log plots because they provide a convenience that also helps you forget that you are transforming the data. This application is a perfect example.

My own preference would be to transform the data first and then use StatsLinearRegression with /PAIR in order to account for the log in the x-direction.

A.G.