Tag Info

2

Not sure if it is what you are after: action[dog_] := Print@StringForm["take dog no. for a walk", dog]; RadioButtonBar[Dynamic[dog, (dog = #; action[dog]) &], {1, 2, 3}]

2

I hope I understand your question. I think you are wondering why Trial 1 does not work the same as Trial 2. In that case the answer likes with != or Unequal. The Condition will not match because != does not evaluate when one side is symbolic and the other numeric. Instead you should use: sortResult[x_ /; x == 0] := 0; sortResult[res_] := MapAt[SortBy[#, ...

2

Here is a way of evaluating your integral analytically. Series expand the integrand, but hold out a factor x/(-1 + E^x) to ensure that the series can subsequently be integrated term by term — this factor is 1 at x = 0, and x E^-x as x -> Infinity. Keep only the first few terms of the series, which we will use to “spot the pattern”. ser = Series[(x ...

2

Let's use WReach's method to examine Manipulate: x = "global"; f[] := x Manipulate[{x, f[], Hold[x]}, {x, {"local"}}] {"local", "global", Hold[FE`x69]} This is akin to the output of Module. (See the WReach's post.) The value of x is not temporarily changed as with Block, nor are explicit x expressions directly replaced with the local value of x ...

1

These are the conditions necessary for the expression to be Positive Assuming[0 < q < 1 && 0 < y < x < 1, FullSimplify@ Reduce[Positive[ 1/2 - (2 q (2 q + x^2 - y^2))/(2 q (q - 2) - x^2 + y^2)^2]]] Sqrt[2] + q == 2 || [...] and other more complicated solutions.

1

To get a numeric result you would need to assign numeric values to m, w, and h int = Assuming[{Element[{m, w , h}, Reals], m w h > 0}, Integrate[Exp[-p^2/(m w h)], {p, -Infinity, Sqrt[h m w]}] // Simplify] 1/2 Sqrt[[Pi]] Sqrt[h m w] (1 + Erf[1]) For example, int /. {m -> 1., w -> 2. , h -> 2.} 3.2661

1

Your first example code actually is wrong, logically speaking. You are not supposed to make assignments to control variables (unless control type is set to None). The control variable is supposed to be modified only using the controls (sliders, buttons etc...), and read only in the Manipulate expression. Otherwise, you can get into an infinite loop. When ...

1

The problem is that you wrote aq where you meant a*q. Although, implicit multiplication with a space a q can be handy, I come more and more to the conclusion that it introduces far more mistakes than a explicit * would allow for. Anyway, with the corrected code you get f[n_] := Expand[(1 - a*q^{2 n})* Sum[FunctionExpand[QPochhammer[a q, q, n + j - ...

Only top voted, non community-wiki answers of a minimum length are eligible