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
 Plotting function defined by worksheet
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

cvhorie

United Kingdom
32 Posts

Posted - 09/09/2009 :  04:23:00 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release 8, sr 6
Operating System: XP SP3

I am transferring from Excel, with a steep learning curve.
I wish to plot the following function (for glass transition temperature), with the parameters, p1-3 specified in a worksheet. I shall want to layer multiple plots by varying the parameters for different materials.
y=(0.00048*x*p1+p2*(1-x)*p3)/(0.00048*x+p2*(1-x))

How do I read a parameter from a worksheet into a function?
It would be nice to be able to copy the function down a line and have the parameters change automatically, as Excel does. Does Origin do this?

Thank you

Velson Horie

Sam Fang

293 Posts

Posted - 09/09/2009 :  06:17:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can put the parameters in a worksheet.
And create a new worksheet to specify the points from the function. Define a column for X values in the worksheet, and select the second column, from Main Menu, Select: Column: Set Column Values.
Type the following scripts to define the range of the parameter columns in the bottom "Before Formula Scripts" Listbox of the opened "Set Values" Dialog.

    range aa=1!;      //Define the range of parameters' worksheet.
    range p1=%(aa)1;  //Assume p1 is stored in first column
    range p2=%(aa)2;  //Assume p2 is stored in second column
    range p3=%(aa)3;  //Assume p3 is stored in third column


Then on the top Listbox, you can specify your function to create Y values. Definition for your function is as follows.

     (0.00048*Col(A)*p1[1]+p2[1]*(1-Col(A))*p3[1])/(0.00048*Col(A)+p2[1]*(1-Col(A)));


The above script creates Y values for the first row of Parameters' worksheet. Y values can be updated automatically as the first row's values of Parameters' worksheet change.
You can add more columns to create Y values for other rows of Parameters' worksheet, and use these Y values to create multiple plots.



Sam
OriginLab Technical Services

Edited by - Sam Fang on 09/09/2009 9:30:04 PM
Go to Top of Page

cvhorie

United Kingdom
32 Posts

Posted - 09/09/2009 :  2:17:17 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you for this lead which provides a solution to getting a curve.

However, I was hoping to create mathematical curves, rather than a succession of joined up points (which I can do in Excel). Function Graph implies that this is possible.

Is there a way to do this?

Thank you

Velson Horie
Go to Top of Page

Sam Fang

293 Posts

Posted - 09/10/2009 :  06:40:46 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply

    You can refer to this web page:
    http://wiki.originlab.com/~originla/howto/index.php?title=Tutorial:Plot_Functions_with_Parameters_Defined_in_a_Worksheet
    It introduces how to plot functions with parameters in a worksheet.


Sam
OriginLab Technical Services

Edited by - Sam Fang on 09/10/2009 06:41:55 AM
Go to Top of Page

cvhorie

United Kingdom
32 Posts

Posted - 09/10/2009 :  11:32:24 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Do you know, it looks as though it might have been written just for me?!

Thank you

Velson Horie

Velson Horie
Go to Top of Page

cvhorie

United Kingdom
32 Posts

Posted - 09/11/2009 :  07:01:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Points on this
1. In order to change Set Values previously set, one has to delete the existing column, then save a new set of Scripts.

2. Unfortunately when opening the new function box then typing in the function string, the set values (which I named by descriptive terms - a hangover from Pascal) dialog box closes. It would be useful to have the Set value box open.

Velson Horie
Go to Top of Page

Sam Fang

293 Posts

Posted - 09/13/2009 :  10:13:15 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Is Set Values that you mentioned the Set Values Dialog?
You need not delete the exsisting column to change the set. You can select the column, and right-click, in the context menu, Select: Set Column Values and Set Values Dialog is opend. You can change your previous scripts.
You can also click the green icon on the top right corner of the column (If you select "Auto" in Recalculate Combo Box of Set Values Dialog). And Select: Change Parameters to open Set Values Dialog.

Sam
OriginLab Technical Services

Edited by - Sam Fang on 09/13/2009 10:14:44 PM
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