48,566 reputation
173195
bio website uoregon.edu/~noeckel
location
age
visits member for 2 years, 10 months
seen 9 hours ago

Apr
16
comment How do I simplify a vector expression?
I already anticipated this comment in my answer, and mentioned that it opens up a wide field of additional definitions one could add. I may come back to that when I have time.
Apr
15
comment Symbolic evaluation fails because it exceeds $RecursionLimit
Yes, that's a way around the problem (+1). And if you have other cases where Subscript needs its arguments evaluated, you just have to wrap those in Evaluate.
Apr
14
comment Series expansion in terms of Hermite polynomials
@belisarius For that general case, at least I can allow a larger basis than necessary, with the latest edit. Then basis can be kept fixed as some list with a number of polynomials that is expected to be large enough for all purposes.
Apr
14
comment Series expansion in terms of Hermite polynomials
@belisarius That's what my second version does. Or are you referring to the case of a more general basis?
Apr
14
comment Series expansion in terms of Hermite polynomials
@belisarius See edit - I hardcoded the HermiteH part into the function in case you're only interested in those basis functions. Then the counting of terms is automatic. In the first version, I wanted to keep the list basis deliberately general so you can use other polynomials there, too.
Apr
13
comment How can I use FindRoot on an expression from NDSolve?
Maybe you have time to try the OP's new original code. I can't do it right now.
Apr
13
comment How can I use FindRoot on an expression from NDSolve?
The edit contains various syntax errors. Definitions like f[u] should be f[u_], spaces are missing between names.
Apr
13
comment How can I use FindRoot on an expression from NDSolve?
I was working in version 8 when I wrote my answer so I couldn't go this route, but I agree this is a nice new feature (+1).
Apr
13
comment How can I use FindRoot on an expression from NDSolve?
I can't execute your edited new code, but the fact that you get the quoted error message means that you probably did everything right up to the point of finding $\omega$. The issue you're seeing now is unrelated to the original one. There's a lack of precision in calculating the NDSolve solution, or maybe the zero is not where you think it is.
Apr
13
comment How can I use FindRoot on an expression from NDSolve?
@Spawn1701D I'm just taking the question as stated: "an analogous problem is..." so we have a linear second order BVP. Then of course you can't use the initial derivative as the parameter. It's simply an eigenvalue problem, and you shoot for the value of $\omega$ that satisfies the BC. My guess is that you're reading too much into the question.
Apr
13
comment How can I use FindRoot on an expression from NDSolve?
@Spawn1701D The initial condition is $p'[0]=1$, and that's a standard choice which doesn't require knowing the solution. It's just selecting the non-trivial solution consistent with the boundary condition at $0$. The other linearly independent solution is $p[0]=1$, $p'[0]=0$; this is always true for such equations. Basically what I'm doing is a shooting method that converts the BVP into an initial value problem. I'm sure that's what Paul is doing, and that's why FindRoot comes in.
Apr
13
comment How can I use FindRoot on an expression from NDSolve?
@Spawn1701D The fact that his example has a trivial solution doesn't mean that the example is trivial. It has a non-trivial solution too (any linear homogeneous equation has a trivial solution, but nobody cares). How to obtain the latter using NDSolve is a valid question, which I answered.
Apr
12
comment Dynamic visualization of Graph[] on a webpage
Since this can't even be done in Mathematica, I think an equally valid question would to be: how to implement the dynamic rearrangement of vertices in Mathematica, so that it can potentially be exported as a CDF. I'm not saying I would do that, though. I like the SVG + JS approach in your self-answer too.
Apr
11
comment Area of the largest rectangle bounded by $y=x^2$ and the x-axis within the unit interval
In a situation where you're not sure how to begin, it's usually best to try doing it by hand instead of jumping straight into Mathematica.
Apr
10
comment StreamPlot in Polar Coordinates
It works (+1), but I had to correct a small syntax error in StreamScale where a } is missing.
Apr
10
comment StreamPlot in Polar Coordinates
Oh yes, I overlooked that part. I'll edit my answer to fix it usng the same method I used here.
Apr
9
comment Composing an image with a plot
The answers with Manipulate reminded me of this question: Animate ParametricPlot3D for two different parametric equations
Apr
9
comment How to label vertices in a grid with random integers?
It would be best if you post some code that you have tried so that readers can get a better idea of where your Mathematica problem is.
Apr
8
comment Integral evaluation taking too long
@NoLeafClover Of course I can't really guess what your goal is. But the step functions have no effect for s > t, and the remaining terms don't go to zero, so the infinite integral goes to infinity.
Apr
8
comment Integral evaluation taking too long
@SjoerdC.deVries The integrand goes to 1 outside the unit box, so it doesn't converge.