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
 Trigger Auto-Recalculate on change of "Parameters"
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ChronoJon

2 Posts

Posted - 02/08/2016 :  09:02:11 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,
using the Set Column Values dialog I have set the following:
Col(permReg)=
outY


Recalculate:
Auto


Before Formula Scripts
range inY = Col(perm);
dataset outY;//range outY = Col(permReg); //range outY = [??]!tmpOutY;
range T = Col(TSmooth);
const nWindow = %(wcol(_ThisColNum)[P1]$); //query parameter row of column permReg
const zeroFix = 1;

// use of x-function smooth
// http://www.originlab.de/doc/X-Function/ref/smooth
smooth -r 0
	iy:=(,inY )
	oy:=(,outY)
	method:=le
	polyorder:=3
	prop:=0
	npts:=nWindow
	boundary:=none;

outY *= T_REF/T;

if (zeroFix > 0)
{
	const minY = min(outY);
	outY -= minY;
}


T_REF is a project variable set by typing T_REF=273.15 in the command window.

  • (1) I want to use the parameter row to select the window size of the smoothing function, which is working. But auto-recalculate doesn't work, when I change the parameter value. Either, I have to change a value in col(TSmooth) or otherwise have to run the command run -auf 0 0 to trigger all calculations on the sheet. Can I do something to change this behaviour?

  • (2) On a side note: I tried setting the output as range outY = Col(permReg);, which would sometimes lock the permReg column despite the -r 0 attribute (of course, I had set the column value set to empty). Why is that?

  • (3) Another side note: range outY = [??]!tmpOutY; would sometimes add rows at the bottom and I would like to know why and how it differs from my final solution of dataset outY;, which produces the desired behaviour.


Thanks in advance! I am quite new to Origin and tried looking the answers up in the help but were unable to answer these questions myself.

Origin Ver. and Service Release (Select Help-->About Origin): b9.2.257 (64x)
Operating System: Win7 64x

Hideo Fujii

USA
1582 Posts

Posted - 02/08/2016 :  10:00:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi ChronoJon,

I haven't followed all your procedure and code, but as far as I have tried a small experiment, the
Recalculation mechanism worked fine as far as the parameter row to be referred to is NOT in the
subject column of the Set Column Value tool itself
. For example, when I have columns A and B in the
worksheet, and the following formula and the Before Formula Scripts for the column B's Set Column
Values dialog:
col(B)=
  col(A)+pp
Before Formula Scripts:
  pp=value(col(A)[P]$);
the recalculation with these settings is proceeded when I change the parameter value at the parameter
header row in Column A. In other words, the following doesn't work because the parameter is
in the same target column:
pp=value(col(B)[P]$);

I think it's a situation to prevent the self-referencing. So, please check the column of your parameter row.

Hope this gives you some hint.

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 02/08/2016 10:07:49 AM
Go to Top of Page

ChronoJon

2 Posts

Posted - 02/09/2016 :  01:59:50 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for the reply!
I also realized that, since I have multiple columns (Col(TSmooth) is also being smoothed) where a function like this is implemented. Changes in the parameter row would trigger recalculations in columns depending on this column. I could just add an additional column for each column I use like this, but it would be a bit combersome. Maybe it is not so bad, if I used a separate worksheet, with one column for each column using this type of function. Still, I would have liked, if there was a workaround for this.

Maybe you can also help with my understanding of the difference in creating loose datasets in dataset outY; and range outY = [??]!tmpOutY; and why using the smooth function sometimes locks the target column despite using the -r 0 attribute?
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