SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-06-14 03:47:31

combeferre
Member
From: USA
Registered: 2012-06-14
Posts: 10

Hello #!

Hi there.

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. smile

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.

Offline

Be excellent to each other!

#2 2012-06-14 03:49:22

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 9,719
Website

Re: Hello #!

Welcome to CrunchBang and the Community combeferre, enjoy the show and the Banana Pudding!


VSIDO
If you build it, they will come...
Words That Build Or Destroy

Offline

#3 2012-06-14 03:54:25

cbdxs
#! Die Hard
Registered: 2011-08-03
Posts: 1,850

Re: Hello #!

Welcome to #!


叫我差不多先生。

Offline

#4 2012-06-14 04:15:10

mikecrosoft
#! Member
Registered: 2012-05-29
Posts: 68

Re: Hello #!

Hello everyone.   Welcome to #! forums; may I know if you have experience with sage, I got excite about the mathematician mention big_smile, 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).  big_smile

Offline

#5 2012-06-14 05:57:44

ivanovnegro
Ivan #000000
Registered: 2011-06-02
Posts: 5,264

Re: Hello #!

Welcome to #!.

A good choice for your new Thinkpad. smile

And my math is really bad. big_smile

Offline

#6 2012-06-14 08:38:35

vicshrike
#! by Default
From: thendoftheweb
Registered: 2009-02-13
Posts: 2,430

Re: Hello #!

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!

Offline

#7 2012-06-14 11:19:55

combeferre
Member
From: USA
Registered: 2012-06-14
Posts: 10

Re: Hello #!

Thanks all for the welcome.

mikecrosoft wrote:

may I know if you have experience with sage, I got excite about the mathematician mention big_smile, 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).  big_smile

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 smile How did you get the polynomial approximation?

Offline

#8 2012-06-14 18:18:51

mikecrosoft
#! Member
Registered: 2012-05-29
Posts: 68

Re: Hello #!

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 big_smile; 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 big_smile, 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 sad, but someday big_smile.

Edit: Ivanovnegro I'm also anything compared with math gods, I think I'm lacking god's touch. big_smile

Last edited by mikecrosoft (2012-06-15 00:09:20)

Offline

#9 2012-06-15 04:14:17

combeferre
Member
From: USA
Registered: 2012-06-14
Posts: 10

Re: Hello #!

(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:

http://en.wikipedia.org/wiki/Spline_interpolation

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:

http://www.sagenb.org/home/pub/868/

(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 wink

Offline

#10 2012-06-15 05:03:46

sqlpython
#! Die Hard
Registered: 2011-11-28
Posts: 824

Re: Hello #!

^ hmmm  just what I was thinking... wink

.... and Welcome!


OHCG #!, Wheezy,, Siduction-12, Bridge-Arch ,  Slackware & Sabayon X,

Offline

#11 2012-06-15 07:28:43

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 2,739

Re: Hello #!

i remember splines from playing Sim city 2000
now i have even less of an idea about what they are!
thanks combeferre and welcome!

Online

#12 2012-06-15 07:54:00

mariannemarlow
#! Die Hard
From: My flat, London, England
Registered: 2012-06-03
Posts: 2,195
Website

Re: Hello #!

Welcome Combreferre

smile


Between two evils, I always pick the one I never tried before ~ Mae West

Offline

#13 2012-06-15 15:54:41

mikecrosoft
#! Member
Registered: 2012-05-29
Posts: 68

Re: Hello #!

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 big_smile.   Wish you all a great day!

Edit: Here is the link to the new thread http://crunchbanglinux.org/forums/topic … s-science/

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo