T O P I C R E V I E W |
GoldenTooth |
Posted - 04/09/2019 : 07:42:11 AM Origin Ver. OriginPro 2019 (64-bit) and OriginPro 7.5 Operating System:Windows 10 Pro
Hi, I am using two Origin versions. Few years ago I developed several fitting funcs on my OriginPro 7.5. You may find an example of function enclosed to the post as .png image. I have tried today to import my functions to newly installed OriginPro 2019 but they are not working properly. Builder compiles created funcs (attached image) but unfortunatelly I am not able to simulate or fit data points. I received message "Function contains multiple independent and dependent variables and can not do sim.". I tried to rewrite and change the code and I realized that the problem is related to more then one dependent variable that I used in the func. The point is that in some developed in the past funcs I am not able to reduce the number of dependent variables to one. Am I doing something wrong? Can someone help me wit that issue?
|
2 L A T E S T R E P L I E S (Newest First) |
GoldenTooth |
Posted - 04/09/2019 : 11:05:24 AM Thanks a lot. I've made it as you suggested and I moved the declaration of the other variables to the function as follows:
void _nlsfstep_3( // Fit Parameter(s): double fd1, double sig1, double fd2, double sig2, double fd3, double sig3, double ix2, double ix3, // Independent Variable(s): double x, // Dependent Variable(s): double& y) { // Beginning of editable part double t1,t2,t3,R1,R2,R3; t1=fd1*(1-exp(-sig1*x)); t2=(fd2-fd1)*(1-exp(-sig2*(x-ix2))); t3=(fd3-fd2)*(1-exp(-sig3*(x-ix3))); if (t1<0) R1=0; else R1=t1; if (t2<0) R2=0; else R2=t2; if (t3<0) R3=0; else R3=t3; y=R1+R2+R3;
Works great! Thanks once again! |
YimingChen |
Posted - 04/09/2019 : 10:33:31 AM Hi,
In the definition of your function, you only need one dependent variable which is y. Please quit code builder, and go to previous page in Fitting Function Builder dialog, set Dependent Variables to y. See if it's the issue. Thanks.
James |
|
|