## Items tagged with curvefitting

Hello,

How can I fit my equation with the experimental data given below?

My equation is:  y = A*y^3+B*x ,  where x is the independent variable,  and y is the dependent variable.
Also how can I determine A and B constants?
Thanks

Bengu

restart;
Xvals := [.53993447, .5599647, .57995479, .59995566, .61996118, .63994512, .65994136, .6799731, .69996782, .71997949, .73997422, .75995044, .77994976, .7999707, .81995146, .83995244, .85996729, .87994951, .8999458];
Yvals := [-.79625455, -.75585259, -.67800183, -.47955884, -.25493698, -0.65747361e-1, .10114507, .26994542, .41484068, .50621122, .60363251, .65510417, .7251356, .75804148, .76002419, .8030069, .82774732, .8429559, .8692888];
with(Statistics);
points := ScatterPlot(Xvals, Yvals);
PLOT(CURVES(Matrix(19, 2, {(1, 1) = .53993447, (1, 2) =

-.79625455, (2, 1) = .5599647, (2, 2) = -.75585259, (3, 1) =

.57995479, (3, 2) = -.67800183, (4, 1) = .59995566, (4, 2) =

-.47955884, (5, 1) = .61996118, (5, 2) = -.25493698, (6, 1)

= .63994512, (6, 2) = -0.65747361e-1, (7, 1) = .65994136,

(7, 2) = .10114507, (8, 1) = .6799731, (8, 2) = .26994542,

(9, 1) = .69996782, (9, 2) = .41484068, (10, 1) = .71997949,

(10, 2) = .50621122, (11, 1) = .73997422, (11, 2) =

.60363251, (12, 1) = .75995044, (12, 2) = .65510417, (13, 1)

= .77994976, (13, 2) = .7251356, (14, 1) = .7999707, (14, 2)

= .75804148, (15, 1) = .81995146, (15, 2) = .76002419, (16,

1) = .83995244, (16, 2) = .8030069, (17, 1) = .85996729,

(17, 2) = .82774732, (18, 1) = .87994951, (18, 2) =

.8429559, (19, 1) = .8999458, (19, 2) = .8692888}, datatype

= float[8]), COLOUR(RGB, 0., 0.054901961, 0.47058824),

STYLE(POINT)), AXESLABELS("", ""), VIEW(DEFAULT, DEFAULT))
with(plots);
display(points);

Statistics:-Fit(a*y^3+b*x, Xvals, Yvals, y);
3
HFloat(2.996866026020011) y  - HFloat(0.9272751314432008)
example("?");

## Calculate Error of parameter in a fit...

Hi all,

I tried to fit my data (x,y) with a model by using Minimize the Chisquare. By example the model is y=a*x+b, Chisquare is (y-yexp)^2. And I performed a function Minimize(Chisquare) to have a and b.

I need to extract the error of parameter like a±aerror, and b±berror.

Best regards,

## How do I integrate a large set of datapoints....

Hello!

I got a set of data imported from excel which is of the size 2001x2. I've use DataPlot to plot the graph of this data but I can't seem to find a way to integrate it. I've used BSplineCurve to make the discreate values continious but I cant seem to integrate this new curve. Can someone please give me a solution or an alternative way to find an approximative way to find the area under the curve.

Thanks

## Finding an unknown function from data...

I am trying to model a disease. The equation is as follows:

S*X - f(X,S,Sp) = 100

I have data for S, I have data for X and I have data for f(X,S,Sp) however I want to find an equation for f(X,S,Sp) that has the best fit with the data because I need to use it later on in my calculation. If anyone is intrested S is the sensitivity of the blood test, Sp is the specificity of the blood test. This means that X*(1-Sp) is the number of false positives.

I currently dont have access to Maple hence I am doing all my modeling in excel 2016. So I am severly limited because excel is useless at algebra.

Maple.xlsx

## Non/linear fit of near zero data points...

I have a data point set:

relativní_tlak:=<0.063018,0.078419,0.119628,0.159668,0.199865>:

I wanna make the least square fit with function in form of:

bet:=(x/(1-x))/((1/(a*b))+(((b-1)/(a*b))*x)):

also the command looks like:

I found out the least square fit is not correct using the near-zero values in 'ads_mnozstvi' vector (the parameters have no physical sense).

The correct a,b values can be obtained when 'ads_mnozstvi' values are multiplied by 1000. The correct a,b values thus are:

[1.56257913677048,108.232791649022]

Why Maple cannot make correct fit with near-zero values?

## why area2 has rootof?...

updated:

with(CurveFitting);
f := PolynomialInterpolation([[0, x0],[1, x1],[2, x2],[3, x3],[4, x4]], x);
f2 := solve(f=y,x);
area1 := int(f, x=0..1);
with(student):
area2 := trapezoid(f2[1], x = 0..1);
with(CurveFitting);
f := PolynomialInterpolation([[0, x0],[1, x1],[2, x2],[3, x3]], x);
f2 := solve(f=y,x);
area1 := int(f, x=0..1);
with(student):
area2 := trapezoid(f2[1], x = 0..1);

i use 5 points trapezoid got RootOf  in result,

only 4 points is acceptable

when i try 5 points, there is no problem, but when more points such as

30 points, got RootOf for c sharp code

moreover, i got a problem when i copy the area1 result into

visual studio c# code, it has error Integral Constant is too large

with(CurveFitting);
f := PolynomialInterpolation([[0, x0],[1, x1],[2, x2],[3, x3],[4, x4],[5, x5],[6, x6],[7, x7],[8, x8],[9, x9],[10, x10],[11, x11],[12, x12],[13, x13],[14, x14],[15, x15],[16, x16],[17, x17],[18, x18],[19, x19],[20, x20],[21, x21],[22, x22],[23, x23],[24, x24],[25, x25],[26, x26],[27, x27],[28, x28],[29, x29]], x);
f2 := solve(f=y,x);
area1 := int(f, y=0..1);
with(student):
area2 := trapezoid(f2[1], x = 0..1);
with(CodeGeneration):
CSharp(area1, resultname = "area1");
CSharp(area2, resultname = "area2");

i find area2 has

Warning, the function names {RootOf, Sum} are not recognized in the target language
Warning, precedence for Range unspecified
Warning, cannot translate range
area2 = RootOf((System.Double) (19276689540529530246975515949293568 * x3 - 2626509155780373903082144116707328 * x2 + 239680950855919251544490932629504 * x1 -

## Problem with equation...

Hi

In attached mw file I have a equation that "a" is in unknown parameter. X and Y are matrixes of data. How can I calculate the "a" parameter?

Best regard

question.mw

## CurveFitting for 101 points...

I have 101 point with very low value

and I'm trying to get the best curve that fits that points. I have tryed with a polynomial interpolator but the curve is not very good. I have also tried with an exponential but an error ocurrs.

Error, (in Statistics:-ExponentialFit) dependent values must evaluate to positive numbers

Can anyone help me? Any ideas? How can I find the best curve fitting?

Thanks.

## Aproximation of given data...

Given some points, how do I find the polynomial/exponential function best matches them?

points are:[[1030, 0], [380, 34], [270, 73], [240, 150], [85, 700], [22, 2000], [12, 5000]]

And here is a image too.

## How to obtain damping ratio of experimental data w...

Hi everybody,

I have some experimental data from an oscillating system (time domaine) and I would like to get an approximation of the damping ratio (zeta). I have already try to use the half-power band width method with the vibrationdata Matlab package designed by Tom Irvine. But I would like to double-check the result with another method.

I found several methods in this paper and I would like to try to do the curve fitting method with the Curve Fitting Toolbox of Maple or Matlab (R2014b) (2.2.2 Curve fitting in the paper). data.txt

It's the first I use this Toolbox with a custom equation, so, I do not really know how to do it with my sample data.

Can anybody help me with this ? I have attached the .txt file sample data to this post.

Cheers

## How to extract two sine waves in data?...

Hello everyone,

I have a set of data that I have imported in Maple.  When I plot the data, I can see that there are two sine waves in it.  It is a plot of radial velocity of a star versus time.  This is about a reflex motion of a star with an orbiting planet.  We will set that there is only one planet.

I would like to extract those two sine waves.  I am including that *.csv file that I imported in Maple that you can download at this address.

https://www.dropbox.com/s/4f4j5xm565je30x/Tyr_rv9_Maple.csv?dl=0

This is not for an exam but it is for a course in February and this will be very helpful and I want to share this file.  I can predict that there will be more than one planet but it is the idea that is important.

```--------------------------------------
Mario Lemelin```
```Maple 2015 Ubuntu 14.04 - 64 bitsMaple 2015 Win 10 Pro -  64 bits
messagerie : mario.lemelin@cgocable.ca
téléphone :  (819) 376-0987```

## Putting error bars on curve fitting graph...

I have used data and the curve fitting procedure to find a curve and I now have to put error bars on the graph to complete my task? I know that there is an errorplot function but I cant seem to find a way to do it with the curvefitting thing?

I have attached the whole worksheet, I hope someone can help! Thanks Detectors_Tutorial.mwDetectors_Tutorial.mw

Even if there was some method of exporting the graph to another medium that would also be very helpful

## How to solve system of BVPs...

Hi everyone

I'm trying to solve the following system of ODE equations for my end paper and since I'm new with maple I couldn't find a way to do it. Can anyone Plz help me? I need to fit a curve to the result and gain a symbolic equation.

Here are the equations I need to solve

d^2*Y(x)/dt^2 = 500000*Y(x)*exp(-10/T(x))+d*Y(x)/dt

d^2*T(x)/dt^2 = 10*(-100000*Y(x)*exp(-10/T(x)))+d*T(x)/dt

with the follwoing boundary conditions:

Y(0)=1 , Y'(0)=0, T(0)=0 , T'(0)=0

I need to plot Y and T and then find then do the curve fitting thing.

## Derivative of Spline at the nodes...

Hi!

This question is related to http://www.mapleprimes.com/questions/204419-Derivatives-Of-Splines-Are-Not-Defined and http://www.mapleprimes.com/questions/42114-Problem-With-Spline-Integrating , however I have not been able to apply the solutions given there to my problem.

I have a set of points given by

and certain function value points given by

where e1 is the function I am approximating.

Using

I come up with my piecewise function.

When I do diff(e4,x), however, the points at the nodes show "float(undefined) x=0.2..."(the node).

As it turns out, the value of the derivative on the left of the node is not equal to that of the right side by a factor of 10^(-7), in other words, numerically unimportant but high enough for maple to realise it is not the same number. How could I tell Maple that I am happy choosing, for example, the value given by the function on right side of the node?

I welcome any suggestions.

## Fitting a Curve (nonlinear fitting)...

Ok guys this is the problem i have a matrix wich is really the result of a semivariogram so it is like this
thi is my semivariogram so i have to find the best model and fit it to it, i can't just throw a polynomial it has to be
spherical= h:= C((3/2)*x/a-(1/2)*x^3/a^3)
expotencial=
Lineal= y:= p*x
or y:=p*x^a

so i want the maple to show me the variogram plot and the i select wich one of the models i will apply.
the problem is that i don't know how to apply the models so started something that could maybe lead to the values of C and A for the spherical and the xpotencial becouse the others too are easy.
------------------------------------------------------------------.--------------------------------------------------------
restart;
with(plots);
with(CurveFitting);
m3 := Matrix([[0, 0], [1, 2], [2, 5], [3, 7], [4, 10], [5, 14], [6, 15], [7, 15.4], [8, 15.8], [9, 16], [10, 16.4]]);
plot(m3);
Upsilon := C(1-exp(-x/a));
Upsilon := C((3/2)*x/a-(1/2)*x^3/a^3);
for C to 16 do
for a to 100 do
for x to 11 do
H := m3(x, 2);
R[C, a, x] := abs(Upsilon-H)
end do
end do
end do;
for r to 16 do
for j to 100 do
N[r, j] := sum(R[r, j, X], X = 1 .. 11);
if N[r, j] < 55 then
print(r, j)
end if
end do
end do;
k := 14*(3/2*((1/16)*xx)-(1/2)*xx^3/16^3);
multiple(plot, [m3, color = "Green"], [k, xx = 0 .. 11, color = "Blue"])
----------------------------------------------------------...................---------------------------------------
so in this code i rest the values of the model and the values of the matrix for differents C and a so i pick the min of the Sum to see wich C and a give me the min value but i didn't work quite well first is difficult to get the C and a and sometimes the new curve is just not similir to the semivariogram (Matrix) please help i tried
k := NonlinearFit(C((3/2)*x/a-(1/2)*x^3/a^3), X, Y, x)
and
k:=LeastSquares`(m3, v, curve = C*(1-exp(-x/a)))
but they don't let me because they aint linear on the parameters