Professional Documents
Culture Documents
Intro To Origin
Intro To Origin
Intro To Origin
to Origin
Written by Norbert Mulders and used with his permission
Origin is an enormously powerful piece of software used for data analysis. Many of its features will
initially appear obscure, but some of Origins basic features are easily understood, and are of great use
in introductory science courses.
This tutorial/assignment will give you an opportunity to develop basic Origin skills. Parts are based on a
much more extensive tutorial published by OriginLab. I have taken sections of that tutorial and added
some comments. Formally there are three groups of skills that you should master:
1. Working with data files (called workbooks in Origin)
Import data
Create new data
Modify data files
Export data
2. Making graphs
Graphing data in various formats
Adding data to graphs
Saving properly formatted graphs as template
Exporting graphs as figures for other documents
3. Using Origin to analyze problems
This often involves the use of the Differentiate and Integrate operations, as well as curve fitting.
However, it should be clear that one uses these skills in a combined operation. There is no graph
without data, and there is little point in data analysis if you cannot see the result (in the form of a
graph).
After mastering the basic skills, you should work through the section Doing Calculus with workbooks.
This section shows how typical scientists use a program like Origin to solve problems. Finally there is the
section Create an 8 layer multi-panel plot template. This section should teach you some more Origin
skills. For the moment you can regard this as optional.
Comments:
A. To use this method to work you must have created a new workbook first! If you have an already
existing workbook active, the imported data will override the old data. This is rarely desirable.
B. If instead of a workbook a graph is active, you can import data only through the Import Wizard.
The data will be plotted directly in the active graph. This can be quite confusing when the data
file contains more than one set of y-values.
C. You can plot data by highlighting columns. Origin will then automatically use the X column as
x-coordinate. This may not always be what you want. For example, you may have data for a
rolling object. The data may contain the position as a function of time, as well as the potential
and kinetic energy. This enables you to make a graph of Ekin as a function of time, but you could
also plot Ekin as a function of position. In a case like that it is more convenient to make the graph
by clicking on plot and selecting the type of graph you want to make. A panel, like the one
shown below, shows up. This allows you to select x and y columns as you see fit.
You do not want to do this for every graph that you make, so immediately save this format as
template using File:Save Template As. A panel comes up like this.
Select Symbol as the category, and SCATTER as the Template name, and override the existing
template. You can do something similar for the Line/LINE template.
Exporting a Graph
Normally, some of the graphs that you produce will be incorporated in a document. There are several
ways to do this, we will address just two. The most basic one is to export the graph as an image file.
What file format (image type) you choose will depend on the document you want to use it in. If you
want to incorporate the graph in a Word document or a Power Point presentation you are best of
selecting the Windows MetaFile format. This will produce a relatively small file with good graphics
quality. To make this option permanent, click on Dialog Theme and select Save as <Default>. You have
to tell Origin where and under what name to store the file. You may want to create a suitable directory
to save graphs. You can make the path the default path again by clicking on Dialog Theme and selecting
Save as <Default>.
The second option is to embed the graph in the target document. The simplest way to do this is to copy
the page which contains the graph (select the page, not the graph itself) and to paste it into the
document.
This embedded graph can be modified. Simply click on the graph and Origin opens. You have to
understand that the recipient of the document that you are assembling can also open the graph and
modify it. This is not always desirable. Furthermore, an embedded file is often significantly larger than a
simple Windows MetaFile.
5
Do the following:
1.
2.
3.
4.
5.
After convincing yourself that you generated the correct data, you can export the data.
6. With the workbook as active page, export the data using File:Export:ASCII to some data file.
7. Finally, create a workbook that contains values for sinh(x), cosh(x) and tanh(x) for the same
range of x values as the previous exercise. You can simply copy the first column of the previous
workbook and paste it into the new one. Then you add two more columns and set their values.
Finally, plot the three hyperbolic functions in a single graph. Export the data as well as the
graph.
Choice of Axes
It frequently happens that we would like to look at data that ranges over many orders of magnitude. We
will see that under those circumstances graphs with linear axes are not very convenient, and that we
should select logarithmic axes. The following should illustrate what these words mean.
1. Let us first generate x-values that span the range from 1 to something of the order of 109. We
want to distribute the x-values such that for every decade of data we have the same number of
points. Open a new workbook, and set the column values of the first (X) column using the
formula (10^0.1)^(i-1). Do this for i ranging from 1 to 100. Convince yourself that this produces
exactly ten x-values for every decade, starting with 1.
2. Now populate a number of columns with functions you are somewhat familiar with, such as
ln(x), x, x2, x5 and ex. Make a symbol/scatter plot for ln(x). You already see that all the data is
piled up on the left side of your graph, and it is difficult to see the details. Now add the data for
the function y = x (and make sure you rescale your graph so you can see all data. The ln(x) data is
now squeezed against the x-axes, and pretty much looks like zero.
3. To fix problems like this, select logarithmic axes. To do this double-click on one of the axes, and
in the panel that comes up select the scale tab. Click on the Type drop down menu. Change the
type from Linear to Log10. Do this for both axes. Now look at your graph again and be amazed.
All he data is nicely displayed and the form of the function can clearly be seen.
4. Now add the y = x2 and y = x5 functions. Note that on log-log plots these functions are straight
lines. Adjust the markings on your axes using again the scale tab and adjusting Increment. Verify
that for the power law functions the slope of the straight lines is equal to the power of the
function. The graph for y = x5 should go up by 5 decades in the y direction for every decade in
the x direction.
5. Just for fun, add y = ex and note how much more rapidly this function increases that the power
law functions.
6. Add the functions y = x0.1, y = x0.5 (the square root of x), and y = x1.5 to your work book. Make a
new graph that contains these functions, as well as ln(x). Convince yourself that 1) that also for
non-integer powers the slopes in a log-log plot are equal to the powers of the power law
functions, and 2) that even a function like y = x0.1 eventually wins over the ln(x).
8
F = mg + 12 C Av 2
(1.1)
The first term is due to gravity, the second term represents the friction from the air, which is
proportional to the velocity squared.
m is the mass of the sphere, 11.3 kg
C is a form factor, C = 0.47 for a sphere
A is the cross sectional area of the sphere, A = 3.1410-2 m2
is the density of air, 1.3 kg/m3
The acceleration of the sphere is then
a = g v2
(1.2)
with = AC / 2m = 8.5 10 4 m1 . The terminal velocity, when gravity and friction balance each other
and a = 0, is given by
vterm =
= 107 m/s
(1.3)
We drop the sphere from some height h0 and we would like to calculate h(t), v(t) and a(t). The problem
is that to find h(t) we need to know v(t). To get v(t) we need a(t), but a(t) is a function of the still
unknown v(t). What to do? (You may not be terrible familiar with the math that follows. Dont worry too
much about that. This is an exercise to show the power of Origin, not that of Calculus.)
We write eq. 1.2 as
dv
= g v2
dt
(1.4)
1
dv = dt
g v2
g v
dv =
dt
(1.5)
The integral on the left hand side is a function of v, while the integral on the right hand side of the
equation is just t. So we have a relation between t and v that reads t = f(v). We often write this simply as
t(v), just as we would have written v(t) for the velocity as a function of time. Now let us solve the
problem:
1. Start a new project
2. Fill the first column of Book1 with 108 values for v ranging from 0 to 107 m/s
3. Set the values of the second column equal to 1/a, i.e.,
2 1
(g v )
8. Click the Arrange button. The preview in the dialog redraws to show you a 2x4 arrangement.
9. Click OK.
Editing the Graph
The goal is to save this 8 panel graph as a template; i.e. a new plot type, so that it can be used again with
new similar data. Since the template will also save plot style information, let's customize the graph a bit
further.
Double-click on the X axis in layer 1. The X-Axis dialog opens.
Select the Grid Lines tab.
Check the Major Grids and Minor Grids checkboxes.
Set the Line Color for both Major and Minor grids to LT Gray.
Check the Apply To Grid Lines checkbox for This Layer.
Click OK
Select layer 1 by clicking inside it.
Right-click inside the layer and select Copy Format:All Style Formats. This will copy the style
formats of layer 1.
9. To apply formatting to all layers, right-click outside of any layer (make sure that no layer is
selected...one easy way to do that is to right-click in the gray area of the window, outside the
white printable part of page), and select Paste Format.
1.
2.
3.
4.
5.
6.
7.
8.
12
8. Highlight the entire worksheet of data. (Note that you can select an entire worksheet by placing
your cursor in the blank area in the upper left corner of the worksheet. When the cursor
becomes a downward pointing arrow, click once to select the entire worksheet.)
9. Select Plot:Template Library or click the Template Library button on the 2D Graphs toolbar.
10. Scroll down to the UserDefined category under Graph Template.
11. Select PAN8. (Note that the Preview window is not a preview of the new data that you are
plotting. It is an image of the graph when you saved your template.)
12. Click Plot.
13