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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 How to add input box into my fitting function?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
jsilverstein Posted - 10/10/2012 : 11:51:11 AM
Origin Ver. and Service Release (Select Help-->About Origin): 8.6 (64 bit)
Operating System: Windows 7


Hi all

I have a fitting function that requires user inputted data and currently I am changing the code each time, but I'd rather have a dialog box that prompts for the entry of these numbers each time the program runs. The trick is not having it inside the loop, where it'll repeat many times.

I'm looking for input boxes for w1, w2, and B

My code:

//----------------------------------------------------------
//
void _nlsfDiffusionRelaxation(
// Fit Parameter(s):
double D, double Fa, double Fb,
// Independent Variable(s):
double t,
// Dependent Variable(s):
double& An)
{
// Beginning of editable part
double w1;
double w2;
double B;
double A;

w1=1.549*10^-6;
w2=0.099;
B=7.934*10^-5;

double Sum;
Sum=0;
for(int n = 0; n < 50; n++)
{
A=(w1*t+w2*(1-exp(-B*t)));
Sum +=(((-1)^n)/(2*n+1)*exp(-(D*t*(((2*n+1)*PI)/(2*0.011)^2))));
An=Fa*(1-(4/PI)*Sum)+Fb*A;
}
// End of editable part
}


Thanks in advance
1   L A T E S T    R E P L I E S    (Newest First)
Penn Posted - 10/10/2012 : 11:49:58 PM
Hi,

For allowing user to input w1, w2 and B, the simple solution is to set these as fitting parameters, and then fix them with the desired values, that is to say, user can specify their values accordingly. Please see the following image on how to fix the values.



Penn

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000