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
 Quick Check function error
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

LCG

Canada
9 Posts

Posted - 12/06/2012 :  6:43:55 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

I've programmed this in OriginLab9.0 and I'm getting an error in the quick check that says :" "for (H" is not a valid Equation. The left hand side of '=' should be a variable."

I'm not sure how to fix that because I'm not sure what it means.
Here's the entire function body. Thanks for any help.

A=Ki*Kg;

B=Ki+Kg+Ki*Kg*It+Ki*Kg*x-Ki*Kg*Ht;

C=1+Ki*It+Kg*x-(Ki+Kg)*Ht;

D=-Ht;

for (H=Ht, step=1; abs(step)>1E-15; H=H-step){

step=(a*H*H*H+b*H*H+c*H+d)/(3*a*H*H+2*b*H+c);};

y=Ei +((Ki*H*Ehi-Ki*H*Ei) / (1+Ki*H))

Sam Fang

293 Posts

Posted - 12/07/2012 :  12:46:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You should choose LabTalk Script instead of Equations in Function Type of Name and Type page. Equations doesn't support for script.

Sam
OriginLab Technical Services
Go to Top of Page

LCG

Canada
9 Posts

Posted - 12/07/2012 :  8:19:19 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you Sam for answering. I've changed to labscript and I had to change something in my equation, so now it's

A=Ki*Kg;

B=Ki+Kg+Ki*Kg*It+Ki*Kg*x-Ki*Kg*Ht;

C=1+Ki*It+Kg*x-(Ki+Kg)*Ht;

D=-Ht;

for (H=Ht, step=1; abs(step)>1E-15; H=H-step) {

step=(a*H*H*H+b*H*H+c*H+d) / (3*a*H*H+2*B*H+c) ; } ;

y=It *(Ei+Ehi*Ki*H)/ (1+Ki*H)

Where Ki,Kg,Ei,Ehi are parameters and It and Ht are constants but now I'm getting this error when I do the quick check.

y = 0 (Variable(s) "Ehi,y,Ei" not used)

Thank you again for your help.


quote:
Originally posted by Sam Fang

You should choose LabTalk Script instead of Equations in Function Type of Name and Type page. Equations doesn't support for script.

Sam
OriginLab Technical Services

Go to Top of Page

Sam Fang

293 Posts

Posted - 12/08/2012 :  02:56:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It seems there is a redundant semicolon in your script:
-----------------------------

for (H=Ht, step=1; abs(step)>1E-15; H=H-step) {

step=(a*H*H*H+b*H*H+c*H+d) / (3*a*H*H+2*B*H+c) ; } ;

------------------------------

It should be changed as:
-----------------------------

for (H=Ht, step=1; abs(step)>1E-15; H=H-step) {

step=(a*H*H*H+b*H*H+c*H+d) / (3*a*H*H+2*B*H+c) ; }

------------------------------

Sam
OriginLab Technical Services

Edited by - Sam Fang on 12/08/2012 02:59:25 AM
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