Finding a Program to Fit a Polynomial to Data

el_hijoeputa
Messages
19
Reaction score
0
Please tell me if some of you know of a way, or program that I can download or use to fit a given polynomial to a set of data.

I have done an experiment in which I varied two currents thru wires (Ix, Iy) and measured the Temperature at a given point (T). The polynomial is known from a model (I still don't know it for sure), but let's say that it is:

T = a+ b(Ix) + c(Iy) + d(Ix)^4 + e(Iy)^4

I need to obtain the value of this polynomial, because the current where measured (Ix from 0 to 8, Iy from 0 to 8), and I need values in the range of Ix=8, Iy=10 (Extrapolate).

Most of the programs I used for data manipulation fit polynomial for 2D curves (only one variable), not surfaces.
 
Physics news on Phys.org
I found a program that does it. DataFit, from http://www.curvefitting.com/

Now I only need to work on the model.

Where and what can I read to solve the problem of obtaining the temperature at a distance from a wire with a current passing thru it?
 


Well, you could try to use linear algebra... let's say you need to fit the points

(5,2,3)
(9,2,4)
(10,-3,7)
(-3,2,6)
(9,8,2)

Suppose your function is in the form

z = Ax + By + C

So, we have three variables, but 5 equations. If you consider the matrix

<br /> M = <br /> \begin{bmatrix}<br /> 5&amp;2&amp;1\\<br /> 9&amp;2&amp;1\\<br /> 10&amp;-3&amp;1\\<br /> -3&amp;2&amp;1\\<br /> 9&amp;8&amp;1<br /> \end{bmatrix}<br />

and the matrix

<br /> b = <br /> \begin{bmatrix}<br /> 3\\<br /> 4\\<br /> 7\\<br /> 6\\<br /> 2\\<br /> \end{bmatrix}<br />

you'll find that the equation

Ax = b

where

x = <br /> <br /> \begin{bmatrix}<br /> A\\<br /> B\\<br /> C\\<br /> \end{bmatrix}<br />

models the situation in terms of simultaneous equations which we are trying to solve. Now obviously, we can't find A,B,C such that all of these equations are satisfied. So, we will try to find the best values for A,B,C. This works if we solve

M^T M x = M^T b

Note that the left hand side yields a square matrix which is invertible while the right hand side yields a column vector. If we solve this, we get: A = -0.102656, B = -0.454035, C = 6.01481. Thus, this plane best models the given points: Ax + By + C = z, where I just stated the values for A, B, C. Now, a question you may have is, why did I multiply both sides by M transpose? This has to do with the projection of rowspaces onto other subspaces. Read a linear algebra book to find out why :P The cool part about this is you can extend the models to n dimensions and in addition, your models don't necessarily have to be lines, or planes. It could even be something like

z = Ax^23 - Be^x + C \sin x - D
 
##|\Psi|^2=\frac{1}{\sqrt{\pi b^2}}\exp(\frac{-(x-x_0)^2}{b^2}).## ##\braket{x}=\frac{1}{\sqrt{\pi b^2}}\int_{-\infty}^{\infty}dx\,x\exp(-\frac{(x-x_0)^2}{b^2}).## ##y=x-x_0 \quad x=y+x_0 \quad dy=dx.## The boundaries remain infinite, I believe. ##\frac{1}{\sqrt{\pi b^2}}\int_{-\infty}^{\infty}dy(y+x_0)\exp(\frac{-y^2}{b^2}).## ##\frac{2}{\sqrt{\pi b^2}}\int_0^{\infty}dy\,y\exp(\frac{-y^2}{b^2})+\frac{2x_0}{\sqrt{\pi b^2}}\int_0^{\infty}dy\,\exp(-\frac{y^2}{b^2}).## I then resolved the two...
Hello everyone, I’m considering a point charge q that oscillates harmonically about the origin along the z-axis, e.g. $$z_{q}(t)= A\sin(wt)$$ In a strongly simplified / quasi-instantaneous approximation I ignore retardation and take the electric field at the position ##r=(x,y,z)## simply to be the “Coulomb field at the charge’s instantaneous position”: $$E(r,t)=\frac{q}{4\pi\varepsilon_{0}}\frac{r-r_{q}(t)}{||r-r_{q}(t)||^{3}}$$ with $$r_{q}(t)=(0,0,z_{q}(t))$$ (I’m aware this isn’t...
It's given a gas of particles all identical which has T fixed and spin S. Let's ##g(\epsilon)## the density of orbital states and ##g(\epsilon) = g_0## for ##\forall \epsilon \in [\epsilon_0, \epsilon_1]##, zero otherwise. How to compute the number of accessible quantum states of one particle? This is my attempt, and I suspect that is not good. Let S=0 and then bosons in a system. Simply, if we have the density of orbitals we have to integrate ##g(\epsilon)## and we have...
Back
Top