Tag Info

1

I think the OP asked from a algebraic resp. beginners point of view as of calculus, so is my answer: It assume it is looking for Discriminant, fr = FunctionRange[x/(1 + x^2), x, y] $-\frac{1}{2}\leq y\leq \frac{1}{2}$ fr[[1]]; fr[[5]]; fr == x/(1 + x^2) $\left(-\frac{1}{2}\leq y\leq \frac{1}{2}\right)=\frac{x}{x^2+1}$ Plot[{x/(1 + x^2), fr[[1]...

2

Some alternatives for thought food... slist /. x_Integer:>g[x] ...or... Last@Last@Reap[Scan[Sow[g[#]]&,slist]]

2

g[w_] := w^2 + 1 slist = Range[0, 100, 1]; g[slist] {1,2,5,10,17,26,37,50,65,82,101,122,145,170,197,226,257,290,325,362,401,442,485,530,577,626,677,730,785,842,901,962,1025,1090,1157,1226,1297,1370,1445,1522,1601,1682,1765,1850,1937,2026,2117,2210,2305,2402,2501,2602,2705,2810,2917,3026,3137,3250,3365,3482,3601,3722,3845,3970,4097,4226,4357,4490,4625,...

1

This works fine: interSpecialCycle[permutation_] := PermutationCycles[permutation][[1]][[1]] myperm = {1, 4, 2, 5, 3} list1 = SpecialCycle = interSpecialCycle[myperm] But list1 will not be callable, so I don't know what you mean by that: interSpecialCycle[myperm] returns a list. Are you saying that you currently call it several times with the same ...

2

There seem to be other oddities in this code. TGrad[x, y] /. {x -> pt[1], y -> pt[2]} doesn't make sense to me. You probably meant to use pt[[1]] which is shorthand for Part[pt, 1]. But even this shouldn't be needed as values of x and y should be populated from the destructuring pattern pt : {x_, y_}. More importantly deriv would appear to need a ...

4

You can plot a constant Plot3D[{x^2 + y^2, 100}, {x, -10, 10}, {y, -10, 10}, ColorFunction -> "BlueGreenYellow"] or Plot3D[x^2 + y^2, {x, -10, 10}, {y, -10, 10}, MeshFunctions -> {#3 &}, Mesh -> 1, ColorFunction -> "BlueGreenYellow"]

0

Piecewise basically uses an array, so you can put it with a Table. for example val = Sort@RandomReal[1, 10] step[x_] = Piecewise[Table[{i, val[[i - 1]] < x < val[[i]]}, {i, 2, 10}]]; Plot[step[x], {x, 0, 1}, GridLines -> {val, {}}] {0.254837, 0.27277, 0.302014, 0.339608, 0.504063, 0.567221, 0.826478, \ 0.869325, 0.879442, 0.904477}

2

Do you mean: ClearAll[A] Attributes@A = HoldAll; A[f[n_]] := A[f[n]] = Module[{d}, d = Numerator@f[n - 1]] I've removed the redundant Return. Module is also irrelevant here actually. Anyway, I suppose you need Module in your real problem so don't take it away. Or you need f to be arbitrary, too? Then: ClearAll[A] Attributes@A = HoldAll; A[f_[n_]] := A[f[...

1

Following up on Verbeia's comment, it is probably easier to use Which, especially when you get to your Vertex rendering function, which has more nested Ifs. For the present case: Which[#2 === what, "yay", #2 === whoops, "nay"] & @@ {-5, what} returns "yay" or "nay" as desired.

5

First of all you shouldn't (if possible) use approximate numbers working with symbolic functionality like a very sophisticated function Reduce. Before seeking the set of your interest try to envisage the region: RegionPlot[ Abs[1/(1 + I/Sqrt[x + I y])] < 1/2, {x, -1.1, 0.5}, {y, -0.6, 1.0}] Now we can see what we are to find, i.e. ...

0

A simple solution is: gr=Table[With[{x=#},valor[[i]]/F[x]]&,{i,Length@valor}] Can this help?

4

The error message tells everything: "NMaxValue::nnum: "The function value {-0.31322198} is not a number at {s,t} = {0.6524678079740285,0.04524817776440737}"" NMaxValue[First[f[s, t]], {s, t} ∈ Rectangle[{0, 0}, {1, 1}]]

2

Something like this? The red curve shows your contour line... P = Polygon[{{0, l}, {l, 0}, {d - l, 0}, {d, l}, {d, d}, {0, d}}]; d = 50; l = 10^-5; V = 10000; sol = NDSolveValue[{D[u[x, y], x, x] + D[u[x, y], y, y] == 0, DirichletCondition[u[x, y] == V, x + y == l && 0 <= x <= l && 0 <= y <= l], DirichletCondition[u[x, ...

2

EDIT It can get more complicated. Look at a contour given by r[t_] := 1 + 2 Cos[t]; Original post The result of the integral for a (reasonable) closed contour is just 2 I times the area enclosed by the contour. Proof: the integral is $$\int \left(z^*+z\right) \, dz$$ Letting $$z=x+i y$$, $$dz=dx+i dy$$ the integral becomes \int 2 x (dx + i dy)=...

4

I post this taking the OP on face value. There are many ways (of course) to do this. There is a lot to digest (for someone new to Mathematica, esp. distinguishing substance from cosmetic aspects). Setup: a = {-1, -1}; b = {1, -7} ; c = {3, 3}; array = {a, b, c}; exp = u x^2 + 2 v x y + w y^2; "Just get Mathematica to do it" (as J.M. suggested `...

5

First we shall define 'the integration on a curve'. Traditionally, this is defined as integration of f.dl where dl is the length of a small part of the curve. So, using t as a medium, we can explicitly write out the curve's function on a complex plane, here let's assume it's z=2 Exp[I t]. Then we can use t, a real number, as the integration variable, which ...

1

In addition I added a point animation and observed some oddly behaviour of Dynamic and ContourPlot3D. Functions and Conditions. yPath has to be defined immidiately (without ":") cause the later \ recursive defintion wouldn' t work otherwise yPath[x_] = -((3 Sqrt[25 - x^2])/5); zPath[x_] := Sin[x] Sin[yPath[x]] comparison[x_] := yPath[x] == (-yPath[x]) ...

4

I am not entirely sure what the aim is here. I am choosing a different ellipse. However, this could be easily changed. p3 = Plot3D[Sin[x] Sin[y], {x, -5, 5}, {y, -5, 5}, PlotStyle -> {Green, Opacity[0.5]}, Mesh -> False]; cp = ContourPlot3D[ x^2/25 + y^2/9 == 1, {x, -5, 5}, {y, -5, 5}, {z, -1, 1}, Mesh -> None, ContourStyle -> Opacity[...

1

You are almost there. Try this: q[matr_, n_, k_] := matr[[n, k]]; Now let us take a matrix: m = {{a, b}, {c, d}}; and apply the function to this matrix: q[m, 1, 2] (* b *) Done, have fun!

3

For changing the position of the cylinder you could add a dynamic Slider. Regard that "Show" won't work within "Dynamic", so thats why I wrote the trigonometric function in the contour argument. dx = 0; dz = 0; Row[{Slider2D[Dynamic[{dx, dz}], {{-10, -10}, {10, 10}}], "dx =" Dynamic[dx], ", dz =" Dynamic[dz]}] Dynamic[ContourPlot3D[{((x + dx)/5)^2 + ((z ...

2

You might look into ContourPlot3D: p1 = ContourPlot3D[(x/5)^2 + (y/3)^2 == 1, {x, -10, 10}, {y, -10, 10}, {z, -10, 10}, ContourStyle -> LightBlue]; p2 = Plot3D[Sin[x] Sin[y], {x, -10, 10}, {y, -10, 10}]; Show[p1, p2] Of course, if you want to do a little more with this, it helps to put both in a contourplot. So, how do we get the intersection of ...

4

The $is a symbol used by Mathematica to generate local variable names for variables that are confined to a particular scope. For instance, if you run Module[{x}, Print[x]] you'll find it prints something like x$4456. This is the name Mathematica gave the variable to distinguish it from any other x's outside the Module.

3

This is a bug due to the use of slots (#1, #2, ...) internally in the implementations of Derivative and of Integrate. Focus first on Derivative. Derivative[1,0][Print] prints #1#2. This means that at least one branch of the code for Derivative involves calling Print[#1,#2]. In your case, Derivative[1,0][f] calls f[#1,#2]. Focus next on Integrate The ...

0

As an example, consider this function g and its derivative gd: g[x_] := x - 1/10*x^3; gd[x_] = D[g[x], x]; Now you want to study monotonicity in a certain interval. For this, you will need to find the local extrema of your function. The corresponding x-values of your extrema can be found using Solve, NSolve or FindRoot (for this simple example, Solve ...

2

You may use Simplify. If $f(x)$ is a function, then Simplify[f[x]>=f[y], x>=y] should evaluate to the necessary condition for the monotonicity to hold. If necessary, you can use FullSimplify

3

As a general case where you want to replace all the arguments, (b'[x y/z] + z b''[x y/z]) /. Derivative[n_][b_][x_] :> Derivative[n][b][z] z b''(z)+b'(z) No matter what was your previous argument, it will be replaced by z.

1

b'[xy/z] + z b''[xy/z] /. {xy/z -> z} gives me an output of b'[z]+z b''[z] Is that what you meant?

2

Just to get you started: cpoly = First[Cases[ChromaticityPlot[{}], _GraphicsComplex, ∞]]; xy2uv = LinearFractionalTransform[{DiagonalMatrix[{4, 6}], {0, 0}, {-2, 12}, 3}]; planckLocus[t_?NumericQ] := With[{planck = 1/((Exp[1.43877696*^7/(# t)] - 1) #^5) &}, Normalize[({{1.0478112, 0.022886602, -0.050126976}, {0.029542398, 0....

1

I found the answer here. Basically I should use function @@ variableList.

1

Activate@Replace[Inactive[f][3],3->1, Infinity] 1 or Replace[Hold@f[3], 3 -> 1, Infinity] // ReleaseHold 1

Top 50 recent answers are included