Tag Info

New answers tagged

19

Maybe you can transform this into an easier problem: If you were instead looking for lines that are at any point perpendicular to your vector field: (that's easy, it's just a coordinate transformation) and if your (transformed) vector field were the gradient of a scalar field (yes, big if), then this would be really easy: These lines are simply the level ...


9

The following is far from perfect, just a kickstart: image = ColorConvert[Rasterize[8, ImageSize -> 40], "Grayscale"] {dx, dy} = Table[ImageAdjust@ GaussianFilter[ image, {6, 3}, δ], {δ, {{1, 0}, {0, 1}}}]; data = Reverse /@ Transpose[2 ImageData /@ {dx, dy} - 1, {3, 2, 1}]; p = ListStreamPlot[data, StreamPoints -> {400, .2, 10}, Frame -> ...


2

If you want to avoid Subscript then x[t_] := Table[ ToExpression["x" <> ToString[i]] , {i, 1, 10} ]


1

For this simple case it should work. Clear[x, X] n = 10; Format[x[m_Integer]] := Subscript[x, m] X[t_] := Array[x[#][t] &, n] DSolve[D[X[t], t] == X[t], X[t], t]


1

You could use Table to declare the functions x[t_] := Table[Subscript[x, i][t], {i, 1, 2}] DSolve[x'[t] == x[t], x[t], t]


3

Use two Tube[]s: monoTube[{p1_?VectorQ, p2_?VectorQ}, r_?NumericQ] := Module[{h = 1 + $MachineEpsilon^(3/4), pm, t}, t = r/EuclideanDistance[p1, p2]; pm = t p1 + (1 - t) p2; {{CapForm[None], Tube[{p1, pm}, r]}, Tube[{t h p1 + (1 - t h) p2, pm}, {0, r}]}] Graphics3D[monoTube[{{0, 0, 0}, ...


3

monoTube [{pt1_, pt2_}, r_] := {EdgeForm[None], Cylinder[{pt1, pt2}, r], Sphere[pt2, r]} monoTube1[{pt1_, pt2_}, r_] := With[{s = (Norm[pt2 - pt1] - r) Normalize[pt2 - pt1] + pt1}, {EdgeForm[None], Cylinder[{pt1, s}, r], Sphere[s, r]}] Graphics3D[{monoTube [{{0, 0, -1}, {0, 0, 1}}, 1], ...


1

Another thing to look at is the difference between = and :=. For example, if you define your first function as f[a_, t_, c_] := Sum[c[[i]] Exp[-(a - t[[i]])^2], {i, 1, 3}] then you get no warnings and you can evaluate f[a, {t1, t2, t3}, {c1, c2, c3}] as you wish. You can also take derivatives D[f[a, {t1, t2, t3}, {c1, c2, c3}], a] without any ...


2

Here is some food for thought f[a_, t_List, c_List] /; Length @ t == Length @ c := Plus @@ MapThread[(#1 Exp[-(a - #2)^2]) &, {c, t}] f can be used as a numerical function or to generate symbolic expressions. The clause /; Length @ t == Length @ c enforces the constraint that the vectors t and c must have the same length. f[a, {t1, t2, t3}, {c1, ...



Top 50 recent answers are included