Hi all,
I have two big data, including 1) force vs. time and 2) strain vs. time. Im currently trying to plot force vs strain to find out the relationship between these factors. However, since the interval size of the time between 1) and 2) are not exactly identical, im not able to simply plot force vs strain even though the initial and the terminated time are the same. So im wondering if there is any way to do it.
Thank you for your input and help in advance.
Regards,
Minki
I've attached the data i would like to solve.
Thanks
The force column is all zeros.
Were it not, you could interpolate time vs strain to get stress vs strain.
Last edited by shg; 08-30-2009 at 08:54 PM.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
Hi Shg,
Thank you for your input.
Firstly, the force column is not all zeros.
What do you mean by interpolating time vs strain to get stress vs strain?
I mainly would like to get the relationship between force and strain, not stress vs Strain.
Regards,
Minki
Look at column B, labeled "Force"Firstly, the force column is not all zeros.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
From B80 to B197, they are non-zero values.
Thanks
Check the file you uploaded; it only has data to row 565, and it's all zero.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
Hi Shg,
Please see the attached image file from the data uploaded.
Regards,
Suggest you download the file you uploaded and look at it.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
In the attachement . .
Autofiltering column-B for values greater than zero, shows B80:B197 to contains values greater than zero.
Weird.
Add this function to the workbook.
In C2 and copy down,Code:Private Sub dFrac(d As Double, r As Range, _ ByRef i As Long, ByRef dF As Double, _ iMatchType As Long) ' shg 1997-0606, 2009-0419 ' 2009-0604 added option for descending sort ' Returns an index to r in i and an interpolation fraction in dF ' r must be a 2+ element vector sorted a-/de-scending if iMatchType=1/-1 If iMatchType = 1 And d <= r(1).Value2 Or _ iMatchType = -1 And d >= r(1).Value2 Then i = 1 Else i = WorksheetFunction.Match(d, r.Value2, iMatchType) If i = r.Count Then i = r.Count - 1 End If dF = (d - r(i).Value2) / (r(i + 1).Value2 - r(i).Value2) End Sub Function LINTERP(x As Double, rX As Range, rY As Range) As Variant ' shg 1997-0606, 2009-0419 ' 2009-0604 added option for descending sort ' Linear interpolator / extrapolator ' Interpolates rX to return the value of y corresponding to the given x ' rX and rY must be equal-length vectors ' rX must be sorted ascending or decreasing Dim i As Long ' index to rY Dim dF As Double ' interpolation fraction Dim v As Variant ' for each/loop control variable For Each v In Array(rX, rY) If v.Areas.Count > 1 Then GoTo Oops If v.Rows.Count <> 1 And v.Columns.Count <> 1 Then GoTo Oops If WorksheetFunction.Count(v) <> v.Count Then GoTo Oops Next v If rX.Count < 2 Then GoTo Oops If rX.Count <> rY.Count Then GoTo Oops dFrac x, rX, i, dF, IIf(rX(rX.Count).Value2 > rX(1).Value2, 1, -1) LINTERP = rY(i).Value2 * (1 - dF) + rY(i + 1).Value2 * dF Exit Function Oops: LINTERP = CVErr(xlErrValue) End Function
=LINTERP(A3,$D$3:$D$337,$E$3:$E$337)
... then plot columns B & C
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
Hi Shg,
It works very well..
Thank you very much..
Regards,
Minki
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks