# Thread: Regression of series equation

1. ## Regression of series equation

Hello to everbody,
I wave an equation with datas and want to regress in non linear form with plot.
Would you help me to solve the equation bellow by any softwares, please?

The data, the equation and parameters are given bellow. I want to fit the data to non-linear equation to find D and k values.
I just need help.

Equation:
M(t)=Mo - (Mo - Ms)*Pi*8*R*Ms*D [Sum((k*R^2 + Pi^2*D n^2)*k*R^2*t -Pi^2*R^2*D n^2 - (Pi^2*R^2*D n^2*
Exp[-t*(k*R^2 + D*Pi^2 n^2)/R^2])/(k*R^2 + n^2*D*Pi^2)^2]

[Sum] goas from 1 to 1000

Ms=140
Mo=11.58
R=0.004

Variables and Data
t M(t)
0 11.58
30 72.61
60 97.89
90 106.05
120 109.63
150 117.02
180 119.57
210 125.99
240 129.56
270 132.85

2. Originally Posted by ayildirim
Hello to everbody,
I wave an equation with datas and want to regress in non linear form with plot.
Would you help me to solve the equation bellow by any softwares, please?

The data, the equation and parameters are given bellow. I want to fit the data to non-linear equation to find a and k values.
I just need help.

Equation:
M(t)=Mo - (Mo - Ms)*Pi*8*R*Ms*D [Sum((k*R^2 + Pi^2*D n^2)*k*R^2*t -Pi^2*R^2*D n^2 - (Pi^2*R^2*D n^2*
Exp[-t*(k*R^2 + D*Pi^2 n^2)/R^2])/(k*R^2 + n^2*D*Pi^2)^2]

[Sum] goas from 1 to 1000

Ms=140
Mo=11.58
R=0.004

Variables and Data
t M(t)
0 11.58
30 72.61
60 97.89
90 106.05
120 109.63
150 117.02
180 119.57
210 125.99
240 129.56
270 132.85
Try using the solver shipped with Excel.

CB

3. Originally Posted by ayildirim

Equation:
M(t)=Mo - (Mo - Ms)*Pi*8*R*Ms*D [Sum((k*R^2 + Pi^2*D n^2)*k*R^2*t -Pi^2*R^2*D n^2 - (Pi^2*R^2*D n^2*
Exp[-t*(k*R^2 + D*Pi^2 n^2)/R^2])/(k*R^2 + n^2*D*Pi^2)^2]

[Sum] goas from 1 to 1000

Ms=140
Mo=11.58
R=0.004

Variables and Data
t M(t)
0 11.58
30 72.61
60 97.89
90 106.05
120 109.63
150 117.02
180 119.57
210 125.99
240 129.56
270 132.85
You got undefined D and I don't see any a in there.

4. Here D and k are constans to be evaluated.

Equation:
M(t)=Mo - (Mo - Ms)*Pi*8*R*Ms*D [Sum((k*R^2 + Pi^2*D n^2)*k*R^2*t -Pi^2*R^2*D n^2 - (Pi^2*R^2*D n^2*
Exp[-t*(k*R^2 + D*Pi^2 n^2)/R^2])/(k*R^2 + n^2*D*Pi^2)^2]

[Sum] goas from 1 to 1000

Ms=140
Mo=11.58
R=0.004
Variables and Data
t M(t)
0 11.58
30 72.61
60 97.89
90 106.05
120 109.63
150 117.02
180 119.57
210 125.99
240 129.56
270 132.85

5. Hey is this it:

$\displaystyle M(t)=Mo-C_1\sum _{n=0}^{1000} k R^2 t \left(\pi ^2 d n^2+k R^2\right)-\frac{\pi ^2 D n^2 R^2 \exp \left(-\frac{t \left(\pi ^2 D n^2+k R^2\right)}{R^2}\right)}{\left(\pi ^2 D n^2+k R^2\right)^2}-\pi ^2 D n^2 R^2$

$\displaystyle C_1=\pi 8 D \text{Ms} R (\text{Mo}-\text{Ms})$

$\displaystyle Ms=140,\; Mo=11.58,\;R=0.004$

with D and k to be determined by the fit?

6. ## regression

My question on attacment.

7. Originally Posted by ayildirim
My question on attacment.
Ayildirim, that's harder to read than my equation above and also it looks to have another variable M_s or something other. Is the equation I posted the correct one and if not, what corrections have to be made.

8. In the equation that you send me, the division is only related to exp term. This is wrong. The division have to be for over all terms in Sum function.
Also the limits of sum function must be from 1 to 1000.

9. Ok, this is what I did then:

Using:

$\displaystyle M(t)=Mo-C_1\sum _{n=1}^{1000}$ $\displaystyle \frac{ k R^2 t \left(\pi ^2 d n^2+k R^2\right)-\pi ^2 d n^2 R^2 \exp \left(-\frac{t \left(\pi ^2 d n^2+k R^2\right)}{R^2}\right)-\pi ^2 d n^2+k R^2}{(\pi^2 d n^2+k R^2)^2}$

(changed D to d since D means derivative in Mathematica)

$\displaystyle C_1=\pi 8 d \text{Ms} R (\text{Mo}-\text{Ms})$

$\displaystyle Ms=140,\; Mo=11.58,\;R=0.004$

I wrote the following Mathematica code to try and fit the data to your expression. Unfortunately, Mathematica returns a negative value for d which quickly causes overflow with the sum (even with smaller upper limits on the sum overflow occurs):

Code:
vals={{0,11.58},{30,72.61},{60,97.89},
{90,106.05},{120,109.63},{150,117.02},
{180,119.57},{210,125.99},{240,129.56},
{270,132.85}};
lp = ListPlot[vals, PlotRange -> {{0, 200}, {0, 300}}]
coef = FindFit[vals, M[t], {d, k}, t]
p1 = Plot[f[t] /. coef, {t, 0, 3}]
Mathematica returns:

{d -> -1.84547*10^8, k -> 122.325}

Oh yeah, if the equation is still not correct, click on it. A small window will appear with the LaTex code I wrote to generate the math code. You can understand it. \frac means fraction in french brackets, power is ^, so forth. with the [tex] brackets starting and ending it. Try and cut and paste it into a new post and edit the code as you wish even if it comes out messy. It's a start and you should try posting in Latex so everything is neat, well defined and explicit so people will follow it easily.

10. ## regression of series equation

After Mo in the general equation (+) sign can be changed to (-) sign.
like this

M(t)=Mo+C1*.........................

11. Originally Posted by ayildirim
After Mo in the general equation (+) sign can be changed to (-) sign.
like this

M(t)=Mo+C1*.........................
Hey ayildirim. That doesn't help. Still getting either underflow or overflow depending on how many terms I use for the sum.