hello i'm not sire of what they do and I don't have the source I see just that they wrote y= f(x) 3rd order [image: image.png]
using p = cheb.Chebyshev.fit(x, y, 3 , window=[.......]) I see that if I change the upper value of the window I can reach similar solution but I don't understand the criteria of changing. Any help is very appreciated Regards Luca Il giorno lun 25 mar 2024 alle ore 20:43 Andrea Gavana < [email protected]> ha scritto: > On Mon, 25 Mar 2024 at 20:09, Charles R Harris <[email protected]> > wrote: > >> >> >> On Mon, Mar 25, 2024 at 11:28 AM Luca Bertolotti < >> [email protected]> wrote: >> >>> Hello >>> in a vb program they use 3rd degree approx and get this value including >>> displacement:(SC) >>> [image: image.png] >>> >>> Ii think that i'm doing the same with numpy but I get different value >>> does anyone can help me please >>> >>> radious = [1821, 1284, 957, 603,450, 245] >>> y = [6722, 6940, 7227, 7864,8472, 10458] >>> p = np.polyfit(radious, y, 3,) >>> t = np.polyval(p, radious) >>> [ 6703.33694696 7061.23784145 7051.49974149 7838.84623289 >>> 8654.47847319 10373.60076402] >>> You can see polyval is difference from the sc. of the table >>> Any help is really appreciated >>> >> >> What is sc? >> > > > At the beginning I thought it was the difference between the fitted y and > the measured y, but of course that is not the case. > > For what is worth, doing it in Excel using LINEST: > > *=LINEST(A2:A7, B2:B7^{1,2,3})* > > And then back-calculating the results of the fit I get this for the > "fitted" y: > > 6703.34, 7061.24, 7051.50, 7838.85, 8654.48, 10373.60 > > Which are indeed the same numbers obtained by numpy polyfit. Also get the > same if you use the automatic line fitting in an Excel graph. > > Not that I trust Excel with anything, it was just for fun. > > Not entirely clear what the OP is doing with VB, but either we are missing > a crucial piece of information or the VB code is incorrect. > > Andrea. > > _______________________________________________ > NumPy-Discussion mailing list -- [email protected] > To unsubscribe send an email to [email protected] > https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ > Member address: [email protected] >
_______________________________________________ NumPy-Discussion mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ Member address: [email protected]
