I'm a linux-curious mathematician. My old laptop (running Ubuntu 10.04) is on its last legs, and will soon be replaced by a new(ish) Thinkpad. I've been looking around for a new distro to put on it, as I don't really like the path Ubuntu has gone down lately, and so here I am.
I've already learned a lot from poking about in these forums and playing with the live cd, so my thanks to all of you who make this place a great resource. Nice to be here.
Welcome to #!
Hello everyone. Welcome to #! forums; may I know if you have experience with sage, I got excite about the mathematician mention , I would also like to talk someday about how to fit a spline equation to a set of coordinates describing an airfoil cross section (I got a polynomial equation fitting for this set some time ago but there is no practical application for such equation, except for numerical computations).
Welcome to #! combeferre, you have made a great choice of next distro. It is really a wonderful piece of work, and the community here is fantastic. Have fun while #!ifying your life.
#!, all else is but a shadow!
May the Kernel be with you!
Thanks all for the welcome.
may I know if you have experience with sage, I got excite about the mathematician mention , I would also like to talk someday about how to fit a spline equation to a set of coordinates describing an airfoil cross section (I got a polynomial equation fitting for this set some time ago but there is no practical application for such equation, except for numerical computations).
Hi mikecrosoft. My only sage experience is a couple of hours' tinkering, a few years back. I don't use computers much in my research, but I do hope one day to learn how to use sage to make graphics for teaching. Have you used it much?
About the spline interpolation: I'm afraid that's also something I have virtually no experience with (I lean more towards the pure aka useless end of the mathematical spectrum). But I'd be happy to learn How did you get the polynomial approximation?
Hello everyone. I have experience using Mathematica and I'm learning Sage now but I still haven found the way to achive some tasks that I can easiIy make on the former. I'm remembering much more better now and still looking for the mentioned calculations file ; but I did the following 1) scan physical object leads to a point cloud; 2) there is no point in having such a big matrix for a constant cross section object, therefore we simplify it by transposing it and removing the column of the cartesian coordinates for the main axis and transpose it back; 3) now we have a 2D point cloud but some point are describing almost the same spatial location and we can still slim it more, so we set a spatial proximity criterion and make a loop that calculates the euclidean distance between near points and write those spacial locations to a matix bypassing the coordinates that satisfy the proximity criterion; 4) now the matrix is very nice but it has a small problem from origin, measurement accuracy (low enough with sofisticated scanners but still there,around 4x10^-6 m + the big human error), so we fit a smooth curve to the set (I fitted a cubic spline to the set http://reference.wolfram.com/mathematic … ction.html; the problem is that the program never gives you the expression and this is were the analytical solution power of human mind is needed , still not enough mathematics in my brain to meet this and I need some guidance about recommended literature or any possible help); 5) with the wrapped obtained equation we can now iterate the function to obtain the desired spatial resolution for the discrete limit curve of the crosswise section of the geometry; 6) goal is reached from a reverse enginnering point of view but it is still lacking the beauty of an analytical solution, still no luck for me , but someday .
Edit: Ivanovnegro I'm also anything compared with math gods, I think I'm lacking god's touch.
Last edited by mikecrosoft (2012-06-15 00:09:20)
(My apologies to the mods if this forum is not the right place for this post.)
@mikecrosoft: So I've had a quick look at these cubic splines, and it seems to me (in my utter ignorance) that the explanation given on this wikipedia page is a pretty good introduction:
That page gives the useful formulas, and their derivation. If you're just wanting to understand and apply the algorithm, here's a quick summary. (Sorry if this is too basic for your needs. In particular, I'm not sure I understood step 5) in your description, so here I'm only talking about step 4).)
First the basic idea:
Each "spline" is a cubic curve connecting two adjacent points in your data set. In order to specify a cubic polynomial, you need 4 numbers (i.e., the coefficients of the three powers of x, and the constant term). Since you know that your cubic has to pass through the two given points, that already gives you two out of four numbers. If you also specify the slope of the curve at each of those points, that gives you the four numbers.
Unfortunately, when you're doing the interpolation, you don't know in advance what the slopes are going to be: so the whole problem consists in finding those slopes (these are the variables called k_i on the wikipedia page). If you're interpolating between n+1 points, then you need to find n+1 slopes. To find them, you need to come up with n+1 linear equations relating the slopes.
You get these equations by insisting that the second derivatives of the splines should also match up at the joins. This gives you n-1 equations (one for each point, except the two end-points). Once you choose values for the second derivative at the end points (traditionally zero for "natural splines", ie the curve becomes a straight line at the endpoints), then you have your n+1 linear equations. Unless you were incredibly unlucky in your data points, these equations will have a unique solution, giving you the slopes, and from there you recover the equations of the splines.
All this is assuming you're using cubic splines. A similar method would work for higher-degree polynomials as well, you'd just need to identify the higher derivatives.
How to compute cubic splines:
You have n+1 data points:
(x_0,y_0), (x_1, y_1), ... , (x_n, y_n).
Let k_i denote the slope of the curve at the point (x_i, y_i). These k_i are the variables you want to find.
To find the k_i, you solve the system of n+1 linear equations consisting of the n-1 equations of the form (15) (I'm using the equation numbers from the wikipedia article), along with the two equations (16) and (17). If you want to choose values other than zero for the second derivatives at the end points, you just replace (16) and (17) by the pair of equations immediately above them, changing the right-hand sides from 0 to your chosen value.
Then get sage (or whatever) to solve these linear equations for k_i. Plug the solutions back into equations (10) and (11) to find a_i and b_i, and then plug those into (9) to get the equations of the splines.
It seems like this might not be too hard to implement. If you don't have the time or patience, it also looks like somebody's already written a program:
(I've not really looked at the code, so I don't know if this is the same algorithm as the one I described, but in any case it looks like this will give you the equations of the splines.)
Here endeth the lesson
^ hmmm just what I was thinking...
.... and Welcome!
OHCG #!, Wheezy,, Siduction-12, Bridge-Arch , Slackware & Sabayon X,
Hello everyone. You're right maybe this is not the right forums, I'll create a new thread at the general chat forum; I doesn't even thought about that, sorry guys . Wish you all a great day!
Edit: Here is the link to the new thread http://crunchbanglinux.org/forums/topic … s-science/