The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 how to relate two graphs w/ common y-axis
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

bquach17

USA
4 Posts

Posted - 10/31/2001 :  8:31:52 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have one graph of pressure vs. capacitance. The second graph is voltage vs. capacitance. I want to get a graph of pressure vs. voltage, but capacitance data pts do not match up so they must be interpreted from linear graphs. Can I do this w/ Origin 6?

Any help is much appreciated (I've been trying for hours now).

bquach17

USA
4 Posts

Posted - 11/01/2001 :  6:43:44 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I can do a polynomial fit for both but don't know how the invert the polynomial V(C) to C(V). Any ideas? Is there an add-on that would do it?
Go to Top of Page

bquach17

USA
4 Posts

Posted - 11/01/2001 :  6:48:47 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I've also tried swaping the axes for one graph but then an accurate curve cannot be fitted to it.
Go to Top of Page

easwar

USA
1964 Posts

Posted - 11/01/2001 :  9:08:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

There is an easier way to do this, that does not involve fitting but uses Origin's ability to interpolate datasets on the fly.

And it is a lot easier if you start by first flipping the x,y relationship of your data. Let us assume that you then have a worksheet named "Data1" with four columns A(X1), B(Y1), C(X2), D(Y2) where the columns in your case correspond to capacitance, pressure, capacitance and voltage respectively. Here the X variables are capacitance in both case and the Y variables are pressure and voltage, and further the two capacitance columns do not contain the same values.

Now add two more columns to your worksheet with the following designations: E(X3), F(Y3)
Bring up the script window (menu item Window|Script Window), and type the following, hitting return after each line.

data1_e = data1_b
data1_f = data1_d(data1_a)

The first line just copies over the first Y variable as your new X variable, which in your case is the pressure. The second line instructs Origin to compute the values of the 2nd Y variable (voltage) using the X values that correspond to the first variable (pressure). The last two columns will now have the relationship between pressure and voltage that you are looking for.

Note that in the second line of script, the () in the right hand side is what tells Origin to interpolate the values. To further illustrate this ability of Origin to perform linear interpolations between given points to obtain values at unknown points, consider the following data:
A(X)--- B(Y)
1 --- 2
2 --- 4
3 --- 6
4 --- 8
5 --- 10
( the "---" is just to show the numbers apart in this posting...you just enter 1 thru 5 in col A and 2 thru 10 in col B).

If you now type the following in the script window
data1_b[1] =
you will get
DATA1_B[1]=2
whereas if you type
data1_b(1.5)=
you will get
DATA1_B(1.5)=3
which Origin obtains by performing a linear interpolation.


Easwar
OriginLab.

Edited by - easwar on 11/01/2001 21:33:35
Go to Top of Page

bquach17

USA
4 Posts

Posted - 11/03/2001 :  11:44:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
easwar,

THANK YOU SO MUCH! That worked like a charm. THANK YOU THANK YOU THANK YOU! This is great. Thanks for the detailed instructions! :)

-brian
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000