Items tagged with fit fit Tagged Items Feed

I decided to convert an old LR question to Maple 15 syntax and update my Maple T.A. questions. I have it working in Maple, but in MTA I get an error: "java.io.IOException: Maple computation error", I've eliminated lines until I found out the error is when I use Fit to solve for the equation. What am I doing wrong?

Thanks, Stephen

I define 8 x values, and calculate 8 y values with random residuals. Then I solve using least squares.

$x1=180;

We have the data
X := Vector([seq(.1*j, j = 0 .. 16), 1.65], datatype = float):
Y := Vector([2.61, 2.62, 2.62, 2.62, 2.63, 2.63, 2.74, 2.98, 3.66,
 5.04, 7.52, 10.74, 12.62, 10.17, 5, 2.64, 11.5, 35.4], datatype = float):
and the model function of x with 5 parameters
F := a*cosh(b*x^c*sin(d*x^e)):
How to fit F to the data  up to the sum of the squared residuals being about 0.001?
Is such good fit possible with Maple at all? It is interesting that Mathcad (not MATLAB...

Hello,

I'm trying to fit a double-diode equation using Maple.  I can get an analytic form of the fitting function in my two variables V and J of the form V(J), but I want J(V), so I'm using fsolve to extract this.  I'm then trying to fit the resulting function to a set of experimental data, but I'm getting an error about writing to an rtable.  I've tested the function, and it gives me a numeric value if I give it numeric inputs.  Is there a way I can fit it?  Code is below:

Hallo,
I have to estimate a logistic growth function, with the functional form
f(t)=A/(B+exp(-k*t))
The dataset is given by


X:=[1950,1960,1970,1980,1990,2000,2010];

which describes the values of t
and by


Y:=[2.53,2.76,3.12,3.75,4.2,4.3,4.35];

which describes the values of f(t).
I now have to estimate the values of A,B and k.
I tried NonlinearFit by

with(Statistics):
NonlinearFit(A/(B+exp(-k*t)),X,Y,t);

I am trying to compute the diffusion coefficient from the diffusion equation. I can compute the analytical solution and evaluate it for the parameters I know and for the known time t to get this function:

f:=x->
646.0548255+(309.8026777+568.8289152*I)*((.8781989023+.4782956073*I)*ln(1.+(-.8781989023+I*((-1)*.4782956073))*exp(10000000*((-1)*9.013850411)*Dif+(61.46924721*I)*x))+(.8781989023+.4782956073*I)*ln(1.+(-.8781989023+I*((-1)*.4782956073...

HI,

 

I measured some points. This points are plotted in a graph. Now I want to make a fit on this points.

I now that the fit-function has to be like this:

F = A + B1 x e^(-t/C1) + B2 x e^(-t/C2)

Problem: how can I create a fitting function like that?

 

The best thing I found is the "spline"-fit, but it doesn't work properly. It has to be one lonely function, not a summary of several functions (like spline).

Hello everyone.

Now, I am studying nonlinear fitting method through help file of maple. Unfortunately, I'm not getting good fit using NonliearFit. The following is my psocedure:

> restart;
> with(Statistics);
> y := 1/(3.6+2.3*x)+17.6*exp(-0.2*x);
> fy := unapply(y, x);
> for x to 10 do fy(x) end do;
14.5791527795
11.9195840297
9.75432289049
7.98631476846
6.54090333018
5.35848939402
4.39086798669

Hello everyone

I have a function, constructed by numerically solving a set of differential equations.  I need to find a best fit for this function with an analitic model with two parameters. I tried to extract some points of this function and then using nonlinearfit:

xvalues:=Vector([seq(105 ..106,104);

yvalues:=Vector([seq(evalf(function),x=105 ..106,104)]);

with(Statistics):

I have a piecewise function which I want to curve fit automatically in Maple. The conditions are:

  • The new smooth curve must have the same area.
  • The new curve mus start and end at the same location.

An image of this is shown below. How can I do this in Maple?

Image Link: http://dump.omertabeyond.com/?di=1613174606062

Hi Experts,

Here is my File. I use the DirectSearch2 Library.

Searching the Minimum works fine. (800 sec on i7 PC)

But the Datafit runs endless.

I tried to make the fit with min SSE that works, but why does DataFit not succeed?

 

Thanks for answering.

Walter

GroundWater_Solution.mw

Hello,

I want to fit Data with a model that calculates the values by solving an ODE numerically.

solL:=dsolve({Lpde,ICS}, numeric, method=rkf45, parameters=[lambda[0],T[m]]);

Next, I created a procedure.

ans:=proc(p1,p2) solL(parameters=[p1,p2]); rhs(solL(3600)[2]); end proc;

This is giving a length L(t) depending on parameters lambda[0] and T[m]. I would like to fit this model with my data. These data are given for a fixed time...

Hi, I would like to fit my data with a physical model. Unfortunately, I have the model in the form of an ODE which can be solved numerically only. So made a procedure output as follows:

solL:=dsolve({Lpde,ICS}, numeric, method=rkf45, output=listprocedure, parameters=[lambda[0],T[m]]);

 

The coefficient of determination also known as R^2 tells how good a fit is. If R^2=1 the fit is perfect an if R^2=0 it's useless. But Maple don't have a native function to calculate R^2. I seached and found this: 
http://www.mapleprimes.com/questions/40171-Determining-An-Equations-Accuracy

But it only describe how to calculate R^2 on a 

There are two data txt files:x0-y0.txt and x1-y1.txt,every one has two columns.
So, two functions can be made from the data,named y0=y0(x0) and y1=y1(x1).
I just want (y0-y1)/y0 at the same x coordinate.
Because it's too difficult to get it directly,I choose the curve fit method.
First,I used the command CurveFitting[ThieleInterpolation] to get two functions.
And then pointplot the (y0-y1)/y0 at the same x0 coordinate.
Surprisingly,the plot is discontinued.

So Im doing a curve againist data plots for angular freq,

Ive reached the stage where im trying to evaluate the function,

ive put

>fit :=eval(f(x),R[2]);

 

where R[2] is the the values for the constants, in the function

F/sqrt(m^2*(omega^2-omega_0^2)^2+b^2*omega^2

which is also defined as f(x)

1 2 Page 1 of 2