Testwiki:Reference desk/Archives/Mathematics/2010 October 1

From testwiki
Revision as of 16:47, 9 March 2023 by imported>MalnadachBot (Fixed Lint errors. (Task 12))
(diff) ← Older revision | Latest revision (diff) | Newer revision β†’ (diff)
Jump to navigation Jump to search

Template:Error:not substituted

{| width = "100%"

|- ! colspan="3" align="center" | Mathematics desk |- ! width="20%" align="left" | < September 30 ! width="25%" align="center"|<< Sep | October | Nov >> ! width="20%" align="right" |Current desk > |}

Welcome to the Wikipedia Mathematics Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


October 1

Transforming 3 points to a new coordinate plane in 3D Cartesian space

Template:Resolved

Hello,

I've inherited some C code that, among other things, takes three points specified in one 3D Cartesian coordinate system and (indirectly) converts their coordinates to a new coordinate system. For the first two points, the process by which this is done is quite clear. However, for the third point, I can't seem to figure out how the expressions used to determine the X and Y coordinates of the point were derived. Although I could just assume that the code is working fine and move on, I'd like to understand the logic behind the calculations.

I've included the expressions used to determine the coordinates of the three points in the new coordinate system below. In terms of notation, I refer to the points as P1, P2, and P3; the subscripts denote the coordinate (x, y, or z) and the coordinate system (O = old, N = new). For (hopefully) added clarify, I've made the coordinates specified in the old coordinate system red and those in the new coordinate system blue. The coordinates in the old coordinate system are known prior to these computations.


Point 1

𝑃1xN=0

𝑃1yN=0

𝑃1zN=0


This simply indicates that point 1 is the origin of the new coordinate system.


Point 2

𝑃2xN=(𝑃2xO𝑃1xO)2+(𝑃2yO𝑃1yO)2+(𝑃2zO𝑃1zO)2

𝑃2yN=0

𝑃2zN=0


This is also straight-forward: the intent is clearly for point 2 to lie on the x axis of the new coordinate system and its position on the x axis to be the magnitude of the vector connecting point 1 and point 2 in the original coordinate system (i.e. the distance between them).


Point 3

𝑃3xN=((𝑃3xO𝑃1xO)(𝑃2xO𝑃1xO)+(𝑃3yO𝑃1yO)(𝑃2yO𝑃1yO)+(𝑃3zO𝑃1zO)(𝑃2zO𝑃1zO)𝑃2xN)

𝑃3yN=(𝑃3xO𝑃1xO)2+(𝑃3yO𝑃1yO)2+(𝑃3zO𝑃1zO)2(𝑃3xN)2

𝑃3zN=0


This where things get a bit confusing (for me, at least). Since the new Z coordinate for point 3 is set to zero, clearly points 1, 2, and 3 are being used to define the XY plane of the new coordinate system. Points 1 and 2 have already defined the X axis, so point 3 is then being used to define the orientation of the XY plane overall.

However, I can't figure out how the expressions for 𝑃3xN and 𝑃3yN were derived. Logically, I'd imagine that the expression for 𝑃3xN must represent some sort of projection of point 3 onto the line formed by point 1 and 2, but it's been a long time since I've done projections in 3D and unfortunately the form of this expression doesn't look familiar to me. I'm also unclear on what the expression for 𝑃3yN is getting at; it's very close to simply being the magnitude of the line connecting points 1 and 3, but then there's the presence of the additional (𝑃3xN)2 term to be accounted for.

So, if anyone who has more familiarity with 3D coordinate transformations off the top of their head than I do has a possible explanation of how the expressions for 𝑃3xN and 𝑃3yN were derived, I'd be most appreciative!

Thanks,

Hiram J. Hackenbacker (talk) 00:56, 1 October 2010 (UTC)

P3xN is the length of the projection of the vector from P1O to P3O to the vector from P1O to P2O. That is P3xN = (P3O - P1O).(P2O - P1O)/||P2O - P1O||, where that "." denotes the dot product (see vector projection). They take advantage of the fact that ||P2O - P1O|| has already been calculated, since it's P2xN. P3yN is then just chosen in such a way to ensure that ||P3N|| = ||P3O - P1O|| since those need to be equal. Rckrone (talk) 03:48, 1 October 2010 (UTC)
Thanks, Rckrone - that clears it up. Hiram J. Hackenbacker (talk) 11:56, 1 October 2010 (UTC)

PoincarΓ©-Hopf Theorem

Assume that M is a compact, orientable, smooth manifold. Does the PoincarΓ©-Hopf theorem tell us that a smooth vector field on M will have at most Ο‡(M) zeros? If not then can someone give a counter example, e.g. a smooth vector field on the torus with two zeros: one with index βˆ’1 and one with index +1. β€” Fly by Night (talk) 09:29, 1 October 2010 (UTC)

No it doesn't mean that (that would be the converse). I can't think at the moment of an example exactly like you say, but here's the standard example of a vector field on the torus with four zeros: Stand the torus up on vertically on its end, and dump syrup on the top of it. The syrup will flow down the torus, and use this flow to define a vector field. This will have four zeros: one at the top (source), one at the bottom (sink), and one at each of the top and bottom of the inner circle (saddles). So there's 4 zeros, of index +1, +1, -1, -1. (This example, with a good picture, is in Guillemin + Pollack's Differential Topology.) You can probably tweak this to make it have 2 zeros. Staecker (talk) 11:53, 1 October 2010 (UTC)

basic combinatorics

Template:Resolved I am trying to deduce a formula for the number of partitions of an integer, say f(n) where order of the integers dont matter. For example 4 can be written in 8 ways: 4, 2+2, 1+3, 3+1, 1+1+1+1, 1+2+1, 2+1+1, 1+1+2, so f(4)=8. This is how I proceeded: First I already had a proof of this statement: If A is the set {(x1,...xk):x1+...+xk=n,nN} then A has cardinality (n+k1k1). Since we basically need to count the number of elements in the set {(x1,...xk):x1+...+xk=n,1kn}, so this number is k=1n(k+n1k1). How can I simplify this to get 2n1 which is supposed to be the answer. Or is there an easier way find f(n)? Thanks. Also regarding the fact of which I already have a proof of, namely, A has cardinality (n+k1k1), the proof I have relies on an argument of making bars in between blanks, and actually deals with making selections with repetitions. Is there a wikipedia article about this technique. Thanks-Shahab (talk) 11:14, 1 October 2010 (UTC)

First see Bell number. Then see Multiset#Multiset_coefficients and stars and bars (probability). Bo Jacoby (talk) 11:20, 1 October 2010 (UTC).
I have read them, thanks. "Stars and bars" answers my second question completely. But I am still at a loss for showing k=1n(k+n1k1)=2n1 to answer my original question. Also I am not sure why you linked Bell numbers.-Shahab (talk) 11:50, 1 October 2010 (UTC)
The arrangements that you are counting are called compositions. Since each of your xi must be at least 1, the cardinality of A, the compositions of n with k parts, is in fact
(n1k1)
It is true that
k=1n(n1k1)=2n1
but a simpler way to count the total number of compositions of n is given in Composition (number theory)#Number of compositions. Gandalf61 (talk) 11:52, 1 October 2010 (UTC)
Thanks a ton!-Shahab (talk) 12:12, 1 October 2010 (UTC)

using CAS to find the catenary parameter a that will give us a curve that will pass through a given point

I want to find the equation of a catenary curve that will pass through the origin and a given (x,y) and (-x,y).

I see that a catenary is described by y=a*cosh(x/a). Since I want my curve to pass through the origin I will just subtract a to move it down to zero at x=0 so my new equation becomes y=a*cosh(x/a)-a. I figure that I can just solve for a in terms of the other variables but when I try to use a CAS (like ti-89 and wolframalpha) I get strange results. If i substitute actual values for x and y I can get a correct approximate numerical result but I cannot get a general equation of a in terms of x and y.

I am expecting that there can only be one value of a to satisfy a given (x,y) but apparently I am wrong. I have tried restricting the domains of a,x and y positive numbers less than infinity but I still can't work it out. Why can't I get a simple single result for a? Thanks so much. --- Diletante (talk) 20:41, 1 October 2010 (UTC)

I think a numerical solution is the best you can hope for since there isn't a way to solve for a with standard functions. The good news is that it's pretty easy reduce the problem to finding the inverse of a single function, namely (1/x)(cosh x -1).--RDBury (talk) 04:27, 2 October 2010 (UTC)
Set α=1/a. Then your equation y=a*cosh(x/a)−a is written cosh(xα)−yα−1=0. The left hand side is a nice entire function of α, and the equation is solved by a root-finding algorithm. Bo Jacoby (talk) 10:48, 2 October 2010 (UTC). The uninteresting solution α=0 is removed by division: y+cosh(xα)1α=0, and the series expansion is y+x22!α+x44!α3+=0. The first approximation α=2yx2 is improved by Newton's method. Bo Jacoby (talk) 21:54, 2 October 2010 (UTC).

Thanks for the good answers. I will be honest and say that all this is a little bit beyond my ability to understand, but I am going to try my best to remember what I learned about approximation in cal 2 and read the articles Bo Jacoby linked. Thanks alot everyone! -- Diletante (talk) 02:08, 3 October 2010 (UTC)

Your premise is correct: Given x0 and y, there is a unique value a for which y=a*cosh(x/a)-a. There is thus a function f(x,y) which gives for any values of x and y the corresponding value of a. However, just because the function exists doesn't mean it can be described in a nice "traditional" form, and indeed this function cannot. What you do next depends on your application. If you just want to be able to take numerical values of x, y and get a, I understand your calculator can already do this for you. You can also find a formula which gives an approximate answer. For example, if x is much larger than y, then acosh(x/a)ax22a+x424a3, and you can solve that to find an approximate formula for a. -- Meni Rosenfeld (talk) 10:03, 3 October 2010 (UTC)
Ok I hope you all will indulge me for a little bit longer. I see that we can do a taylor series to approximate my f(x)=y. I see that we can solve the 2nd order taylor approximation to get a=2y/x^2. What i do not understand is how I can solve for a for greater orders of the taylor approximation (like the last approximation Meni gave). I take it that this is why Bo Jacoby suggested using the first approximation as a starting point to use newton's method, but I don't understand what that really means. Will newtons method allow me to write a better approximation of a algebraically, or just help me find a numerical result? In short, how can I write an approximation that is a little better than a=2y/x^2? -- 21:32, 3 October 2010 (UTC)
Newton's method is just for numerical results.
To solve the approximation I gave, you can use the method to solve cubic equations. But there's a better way to approach this.
Following RDBury's suggestion, we let g(b)=coshb1b. We can show that f(x,y)=xg1(y/x). Then we just need to find an approximation for g1. The series expansion of g is g(b)=b2+b324+b5720+, and with some algebraic manipulations we can find as many terms as we want of the expansion g1(c)=2c2c33+26c545+. Plugging this in, we can find f(x,y)=x22y+y64y345x2+.
Again, this is good for small y. You can also find an approximation good for large y. Also, for any given y/x, you can numerically find the value and derivatives of g around that point, and from that find an expression for the values of f around it (so you can get, for example, a formula which is good when y5x). -- Meni Rosenfeld (talk) 08:56, 4 October 2010 (UTC)
You want to find the value of α for which f(α) = 0, where f(α) = cosh(xα)1αyα β‰ˆ x22αy. A first approximation is α1 = 2yx2. The derivative is, according to the quotient rule, f(α) = xαsinh(xα)cosh(xα)+1α2. Newton's method is not just for numerical results. The second Newton approximation is α2 = α1f(α1)f(α1) = α1f(α1)f(α1)f(α1) or
α2=xα1sinh(xα1)cosh(xα1)+1α1cosh(xα1)1yα1α1xα1sinh(xα1)cosh(xα1)+1α12 =α1xα1sinh(xα1)2cosh(xα1)+2+yα1xα1sinh(xα1)cosh(xα1)+1
This approximation α2 is a little better than α1 = 2yx2. Don't forget that a=1α. So:
a1=x22y
a2=x24y2yxsinh(2yx)cosh(2yx)+1yx(sinh(2yx)+yx)cosh(2yx)+1
Bo Jacoby (talk) 13:19, 5 October 2010 (UTC).