Carl Love

Carl Love

28100 Reputation

25 Badges

13 years, 103 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@bordplate To return the portion under the sqrt to 1/r + 1/mu, follow the commands given by Preben with expand(%).

The code formatting in your post is unusual (with the quotation marks) and thus difficult to read. I need to see how the code appears in your worksheet. Please upload your worksheet by using green uparrow in the editor. If you get an error message, make the post anyway. I may still be able to download it.

To summarize the mathematical point that I'm trying to make in a single sentence:

The ODE a*diff(y(t),t$2) + b*diff(y(t),t) + c*y(t) = (d+e*t)*exp(f*t) (a, b, c, d, e, f all complex constants, a<>0, e<>0, f<>0) will have a term of the form t^2*exp(f*t) in its solution only if a*f^2 + b*f + c = 0.

Until you can account for that, the physics are irrelevant.

@tsunamiBTP

I'm just a private citizen who posts here on MaplePrimes. Anyone else who's reading this is welcome to jump in. The counter says that 30 people have read this thread so far. I only understand the mathematics of solving constant-coefficient linear IVPs with polynomial and exponential forcing functions by the Laplace transform method and the method of undetermined coefficients; I don't understand the physics involved in your situtation. Nonetheless, the IVP problem that you present is purely symbolic mathemathics, and it should be possible to solve it without making any reference to the physics.

Here is a worksheet illustrating the situation that I'm talking about. Note that there's a t^2 term in the first solution and no t^2 term in the second solution. Yet the second solution was supposed to be a generalization of the first.

Download Laplace.mw

@emendes Yes, you got that right. I don't have the time to go into details right now, but see what you can learn from the help pages ?Grid. You do not need to address things to specific cores; that part is handled behind the scenes by the package. I find that the easiest way is to set things up as if they were going to be done with a seq command, and then replace it with Grid:-Seq. That's all there is to it! If you have a situation where the input to one command doesn't depend on the output of another, then this is almost always very easy to do.

@KCPower Suppose that you need to sum the first 1000 integers. The symbolic approach is to first derive a formula for the sum of the first n integers and then substitute n=1000. The formula is n*(n+1)/2. The numeric approach is the straightforward addition of the 1000 numbers. If you were doing the problem without a computer, then the symbolic approach would be better if you knew how to derive the formula.

But you do have a computer. In Maple, the symbolic approach would be

eval(sum(k, k= 1..n), n= 1000),

and the numeric approach would be

add(k, k= 1..1000).

The latter is many times faster than the former! But, obviously there is some n above which the symbolic approach is faster. Deciding when to switch between symbolics and numerics is often the key to efficient programs.

@tsunamiBTP I didn't say that either Z = tau was a special case; I said that either Z = -1/tau was a special case. Your failure to make the distinction between the two is a bad sign.

Now I suppose that you'll say that neither Z can equal -1/tau either. But then why is there a t^2*exp(-t/tau) term in your particular solution? I believe that such a term can only occur if Z[1] or Z[2] equals -1/tau.

@KCPower Wow, you learn Maple quickly!

There are only two things to improve that I see immediatey:

  • When symbolic summation isn't possible, but regular addition is, use add instead of sum. The syntax is the same, so just change sum to add.
  • Factor sqrt(2) outside the sum and make it sqrt(2.).

I don't have time right now, but it'd be worth thinking about the "big picture". Is there any part of the computation that's being redone unnecessarily? Are there parts that can be done symbolically so that the numeric part becomes simply substituting for a parameter?

@tsunamiBTP You are trying to do everything with generic coefficients. I don't know why you'd want to do this: It seems like a lot of tedious work to obtain a not very interesting result. Yet, I don't think that you've made it tedious enough: There are numerous special cases that need to be handled. Consider your partial fraction decomposition. It is only valid if Z[1] <> Z[2]. So you need to handle Z[1] = Z[2] as a special case. Then in the undetermined coefficients, there are special cases that ensue if Z[1] or Z[2] or both are equal to -1/tau.

@Matt C Anderson It's true. Let n, x, y be positive integers. If x*y = n, then there are three possibilities:

  • x < sqrt(n), y > sqrt(n)
  • x > sqrt(n), y < sqrt(n)
  • x = y = sqrt(n)

Furthermore, y is uniquely determined by x, so the divisors can be put into pairs, except for the x = y = sqrt(n) case.

Compare with:

select(n-> numtheory:-tau(n)::odd, {$1..1000});

@Christopher2222 Isn't bookmarking handled much more elegantly by your web browser?

@acer A sans-serif font is more-tiring to read for regular-sized main-body text. This is well known among font experts. (How many professionally printed books have you ever seen in a sans-serif font?) This is something that not even StackExchange always gets right: math.stackexchange.com uses a good serifed font, whereas stackoverflow.com does not. Serifs were invented for a reason; they're not just decoration.

The previous version of MaplePrimes also used a sans-serif font, but I think that it's now been changed to a worse one. You may be able to use your browser settings to override MaplePrimes font selection. I've already done this in FireFox. Here's how: Options => Content => Fonts & Colors => Advanced, then uncheck "Allow pages to choose their own fonts..."

Your code is difficult to work with. Please redo it without using the same letter A in both cases. The second case overwrites the first. Then I can't compare the two sets of coefficients at the end.

Also, you claim that these sets of coefficients are different. Yes, they appear different, but are you sure that they're truly different? I'm not saying that they're the same. I just want to know what makes you so sure that they're different. Can you provide numeric values of the parameters that prove that they're different?

@tsunamiBTP The bug that you encountered---that files with certain special characters in the name can't be uploaded---also existed in the prior version of MaplePrimes. Unfortunately, the error message only says something akin to "Error, couldn't upload file."

First 373 374 375 376 377 378 379 Last Page 375 of 709