MPD78
09-01-2009, 10:04 AM
Hello all,
Is there a way to modify quadrature.h in order to numericaly integrate this data?
Here is my raw data.
% A T1 T2
0.00 1125.00 1550.00
10.00 1055.43 1515.14
20.00 980.17 1477.44
30.00 898.77 1436.66
40.00 810.71 1392.55
50.00 715.46 1344.83
60.00 612.44 1293.21
70.00 500.99 1237.38
80.00 380.44 1176.99
90.00 250.05 1111.66
100.00 109.00 1041.00
What I want to do is integrate T1 vs %A and integrate T2 vs %A and then subtract the two areas to obtain the area between the two curves. Very simple problem.
My approach would be to load the two temperatures T1 and T2 into an array and load the %A into an array and then perform the integration.
My problem is this.
How do you read data of this type into the routines in quadrature.h? Also, I am assuming that Trapzd would be perfect for this job. Am I correct in that assumption?
Any help would be greatly appreciated.
Thanks
Matt D.
Is there a way to modify quadrature.h in order to numericaly integrate this data?
Here is my raw data.
% A T1 T2
0.00 1125.00 1550.00
10.00 1055.43 1515.14
20.00 980.17 1477.44
30.00 898.77 1436.66
40.00 810.71 1392.55
50.00 715.46 1344.83
60.00 612.44 1293.21
70.00 500.99 1237.38
80.00 380.44 1176.99
90.00 250.05 1111.66
100.00 109.00 1041.00
What I want to do is integrate T1 vs %A and integrate T2 vs %A and then subtract the two areas to obtain the area between the two curves. Very simple problem.
My approach would be to load the two temperatures T1 and T2 into an array and load the %A into an array and then perform the integration.
My problem is this.
How do you read data of this type into the routines in quadrature.h? Also, I am assuming that Trapzd would be perfect for this job. Am I correct in that assumption?
Any help would be greatly appreciated.
Thanks
Matt D.