Jump to content

Shadow

Senior Members
  • Posts

    615
  • Joined

  • Last visited

Everything posted by Shadow

  1. Probably a stupid question, but have you looked at the "number three" article on wiki? Also khaled, just at a glance you're missing the "address-of" operators that should precede the variable names in printf. Not that it makes any difference.
  2. I was suspicious with your "Summation problem" post and this time I'll ask; is this homework?
  3. I can't see a two anywhere. If you mean the two ones, don't forget that the minus sign will flip the signs inside the parenthesis, so [math](n- (i+1)+1)[/math] will become [math](n - i - 1+1)[/math]. And yes, my mistake; it should be [math] \sum_{i=j}^{k} c = (k-j+1)\cdot c [/math].
  4. We won't do your homework for you. What have you come up with so far?
  5. Assuming that n, m are constants: [math]\sum_{j=i+1}^n \frac{1}{m} = (n- (i+1)+1) \cdot \frac{1}{m} = \frac{n-i}{m}[/math] [math]\frac{1}{n}\sum_{i=1}^{n}(1 + \sum_{j=i+1}^n \frac{1}{m}) =\frac{1}{n} \sum_{i=1}^{n}(1 + \frac{n-i}{m}) = [/math] [math] = \frac{1}{n} \cdot n \cdot (1 + \frac{n-i}{m}) = 1 + \frac{1}{n} \frac{n(n-i)}{m} = 1 + \frac{1}{nm} \cdot n(n-i) = [/math] [math] = 1 + \frac{1}{mn} \sum_{i = 1}^{n} (n-i)[/math] Don't know why you would want to simplify only partially though; the above result can still be simplified to [math]\frac{m+n-i}{m}[/math]. Basically all of the simplification made use of the fact that [math]\sum_{i=j}^{k} c = (j-k+1)\cdot c[/math] where [math] c \in \mathbb{R}[/math].
  6. Or just solve it as you would a normal equation with absolute values, but you'll end up having to solve four different quadratic equations.
  7. Okay, I figured both problems out. The "weakness" of the second wave still doesn't quite make sense (to be more exact, I know the cause, I just don't know why that would affect the plot the way it does), but I'm pretty sure it has more to do with the implementation of the rendering routines Mathematica uses than with something mathematical. It was caused by the fact that even though the parameter [math]t[/math] is an angle, I let it run from -60 to 60 when I render the plot (see the code snippet in the OP). When I change it to run from 0 to [math]2\pi[/math] (or 0 to [math]\pi[/math], which can be enough in certain circumstances, I'll explain in a bit) it works fine, and also takes a lot less time to render, which is great. The "animation problem" was caused by something similar; the parameter [math]c[/math] plays the role of distance from the origin of the first wave; however, I also run it from -60 to 60. There were a couple of consequences that stemmed from the fact that I let [math]c[/math] be negative; one, for every point [math]P[/math] on the xy plane that was rendered, with polar coordinates [math][c, t][/math], where c is the distance from the origin and t the polar angle, the point [math]P'[-c, t][/math] or equivalently [math]P'[c, t + \pi][/math] was rendered (the equivalent points in Cartesian coordinates would be [math]P[x, y][/math], [math]P'[-x, -y][/math]). This is what allows me to only let [math]t[/math] run from 0 to [math]\pi[/math]. The second impact was the fact that while [math]\cos(x)[/math] is an even function (ie. [math]\cos(x) = \cos(-x)[/math], thus the fact that I let [math]c[/math] be negative had absolutely no impact), [math]\cos(x-a), a \in \mathbb{R}[/math] isn't. The easiest way to understand what happened is if we think of rendering the plot as taking the plot of [math]f(x) = \cos(x)[/math], placing it perpendicularly to the xy plane and rotating it around the z-axis. Once we start to animate the plot, we can think of it as animating the 2D plot of cosine and then rotating it around the z-axis. Since part of the plot is moving towards the origin and part is moving away, after rotating we get what looks like two waves traversing back and forth, even though it's actually (or can be though of as) a plot of two superimposed waves, one moving towards the center and one away from it. The solution is to plot [math]\cos(|c|-a)[/math] or to restrict [math]c[/math] to [math]\mathbb{R}_0^+[/math], in which case we mustn't forget to change [math]t[/math] accordingly, otherwise we'll only get half a plot. I'm not sure if this made much sense, it's a little difficult to explain using nothing but written word. But in any case, my problem is solved. Thanks for the effort everyone.
  8. Xitten, #1: The wave I am trying to create will be a circular one, ie. no like what you get on the beach but what you get when you throw a stone in water. Thus, it's x and y coordinates must form a circle, and the parametric equation of a circle is [math]x = r \cdot \cos(\phi), [/math] [math]y = r \cdot \sin(\phi)[/math]. I can't explain why this is so in a proper and understandable way, other than what I said in the previous sentences, so you either have to arrive at the same conclusion using your own intuition or just accept it as a fact. If I understood it correctly, your equation ([math] z_{xy} = \cos \left ( \sqrt{(\Delta x)^2 + (\Delta y)^2} \right ) \cdot \cos \left ( t \right ) [/math]) is the equation of a wave that stands still and oscillates in place (a standing wave). What I'm looking for is the equation for a wave that moves away from its source, like when you throw a rock into water, a travelling wave. Michael: I'm not even attempting to animate the plot of two waves; for now I'm only trying to animate a single wave, with no success so far. Why does it behave like a wave in a circular container? Also, I don't need it to expand infinitely, just for as far as the plot is rendered. Xitten, #2: I'm pretty sure what you posted is way more complicated then what I'm looking for. I don't want the wave to decay, I don't want it to start in any specific phase; I don't care about any of that. All I want it to do is make it move. I studied the final equations for a while, and came to the conclusion that they are exactly what I have; you have the square root in your equations, which is [math]c[/math] in my equations (since I'm basically using polar coordinates), to which you add a number dependent only on time (yes, a, or the "animation parameter" as I called it before, is time), which is what I tried doing with [math]\cos(c-a)[/math], and failed. And then you multiply all that with a decreasing function which guarantees the wave's amplitude will decrease with the distance from it's origin, which is irrelevant to me for the time being. Just to clarify, this is what I'm trying to get (not the reflecting from the walls or the decreasing amplitude, just the movement outwards from the source):
  9. Hey all, I've recently been attempting to use an animated 3D plot generated in Mathematica to model the interference of two waves. Since I couldn't think of a different way to do this, I used a parametric plot with the [math]x[/math] and [math]y[/math] coordinates equal to those on a circle: [math]x = c \cdot \cos(t)[/math] [math]y = c \cdot \sin(t)[/math] As for the z coordinate, I make the z-coordinate in point [math]P[/math] of each wave separately equal to [math]\cos(|PS|)[/math], where [math]S[/math] is the source of the wave. This means that at every point P the z-coordinate of the resulting interference pattern should be equal to [math]\cos(|PS|) + \cos(|PS'|)[/math]. In the picture above, [math]c[/math] and [math]t[/math] are the parameters used in the parametric equations for [math]x[/math] and [math]y[/math]. Also, just for the sake of getting it working in a simplified version, I assume [math]S'_x = 0[/math] and I didn't realize that until after I finished making the picture. Sorry for the confusion. This means that the z-coordinate should be equal to [math]\cos© + \cos(x)[/math] and using the law of cosine (I emphasize, [math]S'_x = 0[/math]), [math]x = \sqrt{a^2 + c^2 - 2\cdot a \cdot c \cdot \cos(\frac{\pi}{2} - t)} = \sqrt{a^2 + c^2 + 2\cdot a \cdot c \cdot \sin(t)}[/math] So, unless I am mistaken, the parametric equations for the interference pattern should be [math]x = c \cdot \cos(t)[/math] [math]y = c \cdot \sin(t)[/math] [math]z = \cos© + \cos(\sqrt{a^2 + c^2 + 2\cdot a \cdot c \cdot \sin(t)})[/math]. Unfortunately, when I generate the corresponding plot, this is what I get: The second wave is much weaker that the one centered at [0; 0]. Why is that? Am I doing something wrong, or is it a fault of Mathematica's plotting routines? Here's the source I'm using to generate the plot: length[a_, c_, t_] := Sqrt[a^2 + c^2 + 2*a*c*Sin[t]] distance[x_, y_] := Sqrt[x^2 + y^2] x = 9*Pi; y = 0; ParametricPlot3D[{c*Cos[t], c*Sin[t], Cos[c] + Cos[length[distance[x, y], c, t]]}, {c, -60, 60}, {t, -60, 60}, Mesh -> None, PerformanceGoal -> "Quality", PlotPoints -> 160] Thanks in advance for any help. Also, even though it's one problem ahead of the one I have yet to solve, I attempted to make an animated plot of a wave centered at [0, 0] dispersing outward (like a rock falling into water). I would have though that the correct parametric equations for this would be [math]x = c \cdot \cos(t)[/math] [math]y = c \cdot \sin(t)[/math] [math]z = \cos(c - a)[/math], where a is the "animation parameter" (its value changes linearly as the animation progresses). Instead of getting what I was looking for, I get this strange thing where at first it's a plot of a normal wave, then as the animation goes on each maximum splits itself into half's, with one going towards the source of the wave and the other moving away from it. They then "collide" with half's from surrounding maximums, and form one larger one, over and over again. Here's a list of plot's to help illustrate things better, although I'm not sure it'll help that much (click for normal version): Any idea why this is happening, and what I have to do to get a normal wave propagating outward? Thanks again. EDIT: I think I'm starting to see why [math]\cos(x-a)[/math] won't work, but I still don't have a solution as to what will.
  10. Also, I believe the process would be a lot less messy if you rewrote [math]\frac{\mbox{d} \ln(\frac{kx}{x+1})}{\mbox{d} \ln(x)}[/math] as [math]\frac{\mbox{d} \ln(\frac{kx}{x+1})}{\mbox{d }x} \cdot \frac{1}{\frac{\mbox{d} \ln(x)}{\mbox{d} x}}[/math]
  11. Shouldn't this be [math]y=\frac{k x}{1+x}=k-\frac{k}{1+x}=k \left( 1-\frac{1}{1+x} \right)[/math]? Which means that the correct answer would be [math]\frac {x}{x+1}[/math].
  12. Jesus, now I feel really stupid...
  13. The operation is called summation, and the method to calculate the general formula has been known for some time, although I confess I'm not sure if I'd be up to discovering it on my own. Have a look here to check your answer. Also, posting the same topic thrice won't help you at all; on the contrary, you risk getting banned for spam. So don't.
  14. Shadow

    Textbooks

    It probably won't be as good and as thorough as a real textbook, but it'll definitely give you a head start; try Khan Academy.
  15. I'm assuming order doesn't matter. First, read about combinations. Also have a look here, I think it explains the concepts behind combinations nicely. Once you've done that, try solving it on your own. If you still need help, I'll be happy to point you in the right direction.
  16. [math]\phi_m[/math] is the mean latitude, which is defined in the section "Nomenclature of the article I link to. As for the "moving on an X/Y plane", I don't understand what you're saying. On a plane, [math]x' = x + \Delta x[/math] and [math]y' = y + \Delta y[/math]. If anything, it should be [math]x' = x + cos(a)[/math] and [math]y' = y + sin(a)[/math], since (one of) the definitions of those trigonometric functions has to do with the respective coordinated involved. But even then, I have no idea what sin(a) or cos(a) has to do with movement on a " X/Y plane", unless you're using polar coordinates for some reason (and even then it would be incorrect).
  17. I don't know if it contains the answer to your question, but you ought to take a look at this.
  18. Here is a quick LaTeX tutorial that should get you well on the way to writing readable equations:
  19. At the risk of sounding ignorant, I must ask, why should [math]c^{2n}-b^{2n}[/math] be divisible by [math]a^{n}[/math]?
  20. First, read up on the Rule of product. It is also possible to explain the answer using recursion, but I'm pretty sure the former will be easier to understand. So, we have four letters, and every letter can be in either of two states (capital, or not). Using the rule of product, we have [math] 2*2*2*2 = 2^4 = 16[/math] different combinations. If you want the number of combinations when you're allowed to swap the positions of letters (ie. BaCD), think of it this way: we have four places, and we want to place one of four letters in each spot in such a way that we only use every letter once. So, how many letters can we place in the first spot? Four of course. How many in the second? Three, because we already used one up in the first spot. Using this method and the rule of product, we have 4*3*2*1 = 4! = 24 ways of ordering the letters (4! is read as "four factorial", you can read about the factorial here). Now, again using the rule of product, we combine this result with the 16 ways to change the "capitalness" of the letters, which leaves us with the final answer, [math]24*16 = 384[/math]. Hope this helped. PS.: For some reason, putting "4!" in the math tags gives a LaTeX error, anyone know why?
  21. My apologies, "firmly separated" was a poor choice of words; "distinguished between" is what I meant, meaning you can't treat a temporal dimension the same way you would treat a spatial one. To explain my question in a better way; imagine a glass sphere with a single point painted somewhere on it. Now, imagine shining a bright light through the sphere as you rotate it (around one of its axes of symmetry, like the Earth for example) and looking at the shadow it casts on a wall or piece of paper (or in other words, project it into 2D). You would see a single point that's moving* back and forth along a segment (provided that the axis of rotation doesn't change). This means that motion on a segment in 2D can be modeled as rotation around a fixed axis in 3D, yes? Here I'm taking a leap of faith, and assuming that any motion in 2D can be modeled in this way by rotating a different "shape" and/or changing the size of the shape and/or the axis of rotation. What I'm asking is, can the same thing be done with 4D and 3D, ie. could we model motion along a segment in 3D using rotation in 4D? *This is assuming that the point is not positioned such that a plane tangent to the sphere in that point is also normal to the plane we project onto.
  22. I know that time is considered to be the fourth dimension, but (and here I'm not sure if it's just because of my interpretation of the texts I've read), I've always distinguished between spatial and temporal dimensions. Time is a temporal dimension, and our "3D" is made out of three spatial dimensions. Since I've found the same argument made on Wikipedia, and while I know it's not considered a reliable source, in this case I think it's safe to assume that it's a correct one. What I'm asking is if displacement in space and time, as in a temporal dimension, can be explained/represented/modeled as rotation in the fourth spatial dimension, the same way the example I gave represents displacement in 2D using rotation in 3D. The only part that contradicts this view is that you would have to have some kind of "time" that would allow rotation in 4D, if you understand what I mean, which would lead to an infinite number of dimensions each allowing motion in the one before, which is probably one of the reasons spatial and temporal dimensions are so firmly separated. The more I think about it, the more convinced I am that the answer is no, you cannot model time as rotation in the fourth spatial dimension. But I just want to be sure, or to be more exact would like to know if (one of) the reason(s) for this is the one I gave at the end of the previous paragraph. And regardless, all this is assuming that motion in 3D can indeed be modeled as rotation in 4D, which I'm still not sure is true.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.