[proFit-list] Plugin Problems

pro Fit Support profit at quansoft.com
Tue Jul 28 23:17:26 CDT 2009


Dear Dirk

I have been away for holidays, so please apologize my belated reply.

Anyway, the problem you are facing is due to an issue with pro Fit  
6.1. The function for which you are calling SetFunctionParam does not  
have an x-value. In that case, pro Fit assumes that the first input of  
the function is the "default" input, and SetFunctionParam does, under  
some situations, not work properly when called to change the value of  
the default input. For them moment, as a work-around, add the  
statement "x := x;" to the beginning of your function, which will  
trick pro Fit into believing that your function does have an x-value.

The issue will be fixed in the next release.

Best regards

Kurt Sutter


On 9 Jul 2009, at 3:43, Dirk Fröhling wrote:

> Dear Kurt,
>
> I tracked the problem down to a call of "SetFunctionParam".
>
> To use my ODE Module plugin, the user has to provide a function  
> called "derivs" which calculates the derivatives of dependent  
> variables at a given time. The function expects the time, the  
> variable values and delivers the derivatives. Example declaration:
>
> function derivs(t, y1, y2, y3, y4, dydt1, dydt2, dydt3, dydt4:  
> extended);
>
> From ODEModule, I call the function like
>
> 	SetFunctionParam(DefName, 1, x);
> 	for (i = 1; i <= N; i++)
> 		SetFunctionParam(DefName, i+1, y[i]);
> 	for (i = 1; i <= N; i++)
> 		SetFunctionParam(DefName, i+N+1, dydx[i]);
>
> 	t = CallFunction(DefName, 0);
>
> 	for (i = 1; i <= N; i++) {
> 		dydx[i] = GetFunctionParam(DefName, i+N+1);
> 	}
>
>
> DefName is a Str255, i is short, x, y[i] and dydx[i] are double  
> values. N is four in this example.
>
> Like I said, it works with pro Fit 6.0.6, but with 6.1.10 on Intel,  
> it doesn't. And I get the "ODE Module: Bad parameter value for this  
> function." message.
>
> If I comment out the SetFunctionParam() calls, it "works" in a way  
> that it doesn't behave like I described below, e.g. plot all the  
> curves in one window without title etc.
>
> Could this be a pro Fit problem with callback functions that use  
> double/extended values?
>
> Best regards,
>
> Dirk
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://quantum-soft.com/pipermail/profit-list_quantum-soft.com/attachments/20090729/c9c891d3/attachment.html>


More information about the proFit-list mailing list