Tag Info

New answers tagged

9

Regarding the plot issue, I tried using HoldForm[x = Stack[_]] as an axis label to capture the stack at the moment of evaluation inside HoldForm. This revealed a problem in a helper function for dealing with units. The function Visualization`Utilities`OptionsDump`unitFormStringQ is applied to the axis labels (in a pattern test). The definition is this: ...


3

I can't yet explain the behavior but I can greatly reduce your minimum example: MakeBoxes[a_ /; FreeQ["foo", a], fmt_] := "bar" /; False ODE = F'[z] == g F[z]; Fguess = {F -> (Exp[a #] &)} ODE /. {F -> (Exp[a #] &)} ODE /. Fguess {F -> (Exp[a #1] &)} a E^(a z) == E^(a z) g Derivative[1][F][z] == g F[z] Critically: If I ...


1

Considering work-arounds, Style and Inactivate seem to work well together. Plot[x , {x, 0, 1}, AxesLabel -> {Style["M", Italic], Style[Inactivate[InputForm[E] = M c^2, (Set | Times)], "TraditionalForm"]}] Inactivating Times keeps M c^2 from being rewritten to c^2 M.


9

I'm not sure what's going on with HoldForm[InputForm[ℰ]], but I think I know what's going on with Plot. It appears at some point ReleaseHold is called because wrapping HoldForm twice fixes your problem. Plot[x^2, {x, -2, 2}, AxesLabel -> {x, HoldForm[HoldForm[InputForm[E = 1]]]}]


7

I can't comment on exactly why HoldForm has changed but I believe your examples fall under the purview of the new Active/Inactive functionality. For example: Clear[x]; Plot[Sin[x], {x, 0, 1}, AxesLabel -> {Inactivate[x = 3], Inactive[Set][InputForm[E], 3]}] x Note, however that Inactivate can't be used with InputForm, since you want InputForm to ...


2

In the current release, you can try the following: pf = {Cos[u], Sin[u] + Cos[v], Sin[v]}; gr = ParametricPlot3D[pf, {u, 0, 2 Pi}, {v, -Pi, Pi}]; mr = DiscretizeGraphics[gr // Normal] Disregard the message about Lighting not supported, DiscretizeGraphics[gr //Normal] will remove the duplicated points Now this will work: ...


6

This is at least one bug, possibly more. Let me explain: If we go one step further and use Needs["TetGenLink`"] tethull = TetGenConvexHull[pts]; bmr = BoundaryMeshRegion[tethull[[1]], {Polygon[tethull[[2]]]}] BoundaryMeshRegion::binsect: "The boundary curves self-intersect or cross each other in ...


6

I think it's a bug. Tracing Tracing the evaluation of DSolve as the following: eq = D[y[x], x] - y[x]^2 + y[x]*Sin[x] - Cos[x] == 0; traceRes = Trace[DSolve[eq, y[x], x, GeneratedParameters -> ThisIsForGeneralC], {TraceInternal -> True, TraceOff -> _Message}]; and formatting (using the ...


7

This is a bug in DSolve. The solution to your example should certainly include a constant of integration. DSolve attempts to solve this Riccati equation by solving the corresponding second order linear ODE. The problem occurs while using the solution of the second order linear ODE, which has an unevaluated integral in it. Sorry for the confusion and ...


5

Heureka! Symbolic solution with constant of integration found. With a little help for MMA from its friend ... Writing the differential equation as eq = y'[x] - Cos[x] == y[x] (y[x] - Sin[x]); we observe that putting (no MMA code) $$z(t)=y(t)-Sin(t)$$ we obtain a related equation eq1 = z'[t] == z[t] (z[t] + Sin[t]); which surprisingly is DSolved ...


6

In Mathematica 10.0.0 for Windows, I have experienced similar problems. When non-ASCII characters were placed after \ in a string, they were decoded in a strange way. (Character '\' is used as a path separator in Windows). ToCharacterCode["\\a", "Unicode"](*OK*) {92, 97} ToCharacterCode["\\", "Unicode"](*OK*) {92} ToCharacterCode["μ", "Unicode"](*OK*) ...


2

This is also not an answer but a brief study in $Version "8.0 for Microsoft Windows (64-bit) (October 7, 2011)" which might be of interest. It considers three methods of calculating the requested probability. It shows that in this version there is no negative probability but there is still a "critical number" which amounts to 8. For n = 8 the ...


7

Using Simon Woods's Spelunk we see that the body of the function is: Self : AssociatePairs[l_] := Module[{r$}, r$ = Which[! Quiet[TrueQ[MatrixQ[l, PairQ]]], Message[AssociatePairs::npairs, l]; $FailRHS, True, HoldSequence[Associate @@ Transpose[l]]]; ReleaseHoldSequence[r$] /; ! MatchQ[r$, $FailRHS | HoldSequence[$FailRHS]] ] I draw ...


4

Now that the workaround has worked for me for days without crash, let me put it as an answer myself. The crash (at least in my case) is because of the kernel tries to connect to internet and something wrong happened there. To solve the problem, uncheck Preference -> Internet Conectivity -> Allow the Wolfram System to access the Internet


3

This bug has been fixed in v10.0 (Tested on Wolfram Programming Cloud):


3

Maybe they renamed it. You should search the help for "AutomatedReports" this will bring you to guide/AutomatedReports. Or on the web: AutomatedReports. Some small examples an more detailes are presented at Automated Report Generation and the links therein.


7

For file operations two workarounds currently work: 1) Use slash / instead of double backslash in the paths to files under Windows: Import["D:/test/кириллическое название/файл.txt"] 2) Use FileNameJoin or StringJoin: Import[FileNameJoin[{"D:", "test", "кириллическое название", "файл.txt"}]] Import[StringJoin[{"D:", "\\", "test", "\\", "кириллическое ...


0

One can use gradient color schemes for LineLegend Plot[{Sinc[x], Sin[x], Cos[x]}, {x, 0, 10}, PlotStyle -> Thickness[0.01], ColorFunction -> Function[{x, y}, ColorData["NeonColors"][x]], PlotLegends -> LineLegend["NeonColors", {"Teste", "Tuste", "Taste"}], PlotTheme -> "Scientific"] ?? LineLegend will reveal some hints:


2

I don't know if this help or not but here is what I got for you. ContourPlot[Sin[x y], {x, 0, 3}, {y, 0, 3}, ContourShading -> None, ContourStyle -> {{Red, Thickness[0.008]}}, PlotTheme -> None]


5

This bug has been fixed in V10 mat = {{7/2 - I/2, -1 + I, 1/2 + 5 I/2}, {-1 + I, 5 + I, -1 + I}, {1/2 + 5 I/2, -1 + I, 7/2 - I/2}}; Eigensystem[mat] Gives: {{6, 3 + 3 I, 3 - 3 I}, {{1, -2, 1}, {1, 1, 1}, {-1, 0, 1}}} \begin{array}{ccc} 6 & 3+3 i & 3-3 i \\ \{1,-2,1\} & \left\{1,1,1\right\} & \{-1,0,1\} \\ \end{array}


0

if you want same legend as in plot1, maybe also some round way like this: p1 = First@Last@Plot[Sinc[x];, {x, 0, 10}, PlotLegends -> {"Teste"}]; Row[{Plot[Sinc[x], {x, 0, 10}, PlotLegends -> {"Teste"}, PlotStyle -> Thick, ColorFunction -> (ColorData["AvocadoColors"][#2] &), ImageSize -> 300], p1}]


4

I appreciate that this is a question with philosophical and technical dimensions about automation. Like kguler a work around: Plot[Sinc[x], {x, 0, 10}, PlotStyle -> Thick, ColorFunction -> (ColorData["AvocadoColors"][#2] &), ImageSize -> 400, PlotLegends -> BarLegend["AvocadoColors", LegendMarkers -> None, LegendLabel -> ...


7

A work-around: plt = Plot[Sinc[x], {x, 0, 10}, PlotStyle -> Thick, ColorFunction -> (ColorData["AvocadoColors"][#2] &), ImageSize -> 400]; legend = Row[{Graphics[plt[[1]], AspectRatio -> 1, ImageSize -> 30], "Teste"}]; Legended[plt, legend] In Version 10, one can use PlotTheme->"Sparkline" to create the thumbnail legend: ...


9

The details of the styles associated with various themes can be accessed using the function ResolvePlotThemes in the Charting context. For example: Grid[{#, Column@(Charting`ResolvePlotTheme[#, ListPlot] /. HoldPattern[PlotMarkers -> _] :> Sequence[])} & /@ {"Monochrome", "Frame", "Vibrant"}, Dividers -> All] (* removed the part ...


5

I propose two possible solutions: Turn off transparency by including Opacity[1] in the CountourStyle Use CapForm["Butt"] to prevent the line caps from overlapping. With this solution you can keep transparency on, and the result will look like: With CapForm["Butt"] theoretically there can still be a slight misalignment, or crack between the lines, but ...


4

Change to delta := Module[{y}, NDSolve[{y''[n] + y'[n] - y[n] == 0, y[-3] == 1, y'[-3] == 1}, y, {n, -3, 0}]] This is a possible bug.


0

If you need to show the points at the arrow tips, you should specify them separately from the specification of the arrows. The points coordinates may be obtained from those of the arrows. Try this: textsize = 16; ah = 0.03; ps1 = 0.5; ps2 = 0.01; lstAr1 = {{{0.0, Sqrt[2]}, {0.35, Sqrt[2]}}, {{-0.1, -Sqrt[2]}, {-0.35, -Sqrt[2]}}, {{2 Pi + 0.1, ...


3

So what you basically have to do is to take the head of the arrow only. I was a bit lazy to rebuild the Polygon myself so I looked for a .m file related to Arrow and found Arrow.m in /usr/local/Wolfram/Mathematica/8.0/AddOns/LegacyPackages/Graphics which contains approximately the following function makehead: makehead[len_, wid_, cent_] := Polygon@{{0, 0}, ...


2

Today I reinstalled Mathematica 9 on my MacBook Air 2013 - I had the external Apple Display connected when installing - now CurrentImage[] only works when external Display is connected and works through that camera. This may be a hint for others ...


0

In version 10, one could use this workaround: Reduce[FunctionDomain[(4000 - 1000 k)/(k - 4), k] && (4000 - 1000 k)/(k - 4) < 0] FunctionDomain alone returns k < 4 || k > 4 and can be used to restrict the domain of k within Reduce ...


3

Exposition of the problem Roots works well on the following equation (obviously it yields generic formulae and it doesn't deal with exceptional cases e.g. when A == 0 qurtics expressions are not valid): eq = A/3 x^4 - x^2 + 2 a x - b^2 == 0; while in a special case of eq it fails (however in Mathematica 9 the system doesn't hang) returning the following ...


1

Clear[A, a, b, x]; eq1 = A/3*x^4 - x^2 + 2*a*x - b^2 == 0; Now, as you propose: eq2 = Simplify[eq1 /. {a -> Sqrt[3/(16 A)], b -> Sqrt[3/(16 A)]}, A > 0] (* 24 Sqrt[3] Sqrt[A] x + 16 A^2 x^4 == 9 + 48 A x^2 *) With this one finds: Solve[eq2, x] (* {{x -> Sqrt[3]/(2 Sqrt[A])}, {x -> Sqrt[3]/( 2 Sqrt[A])}, {x -> ...



Top 50 recent answers are included