Tag Info

Hot answers tagged

16

A bit of historic background Before Mathematica version 6 graphics were produced as a side-effect much as Print works now. In fact you can load this old system using: << Version5`Graphics` Now you get this behavior: Note that the output is - Graphics - and the plot itself is handled like Print. Since there was often little value in having - ...


12

It's not a syntax mistake. Consider it a suggestion, FrontEnd tells you: "maybe you want to plot it as it has no much sense now". Of course it may have sense, it's just a suggestion. If you take a closer look you will find that storing such Plot makes more sense for FE:


10

One possible solution is using Quiet: ds[All, Quiet[#a/#b]&] Another possible solution is using the FailureAction option: ds[All, #a/#b, FailureAction -> None]


9

The pink box shows a formatting error. You can disable highlighting of formatting errors for a specific object using Style: Style[ Graphics[{Disk[], garbage}], AutoStyleOptions -> {"HighlightFormattingErrors" -> False}] You can also change the setting globally using the Preferences dialog (Edit - Preferences - Messages - Formatting error ...


8

The problem has nothing to do with OpenWrite. You never Close the stream you open in your call to Read. Read, unlike ReadList, does not automatically close a stream (file, pipe, etc.) that's given as its first argument string. (That's because the purpose of Read is to be able to read from the same source in pieces, unlike ReadList which does it all at ...


8

The number 2045 is suspicious. Add three to it to include stdin, stdout, and stderr, and you get 2048, which I suspect is total number of file descriptors available to you. I conclude your problem is caused by eating up all the available file descriptors. This is usually caused by doing too many file opens without doing any file closings to return some file ...


7

This question probably will not receive a "real" answer because it is based on a misconception about what $MachineEpsilon actually is. But, since the question is upvoted, I suppose there is more than one person who is not yet clear on how this is defined. Therefore, here is a comment to try to clarify the definition and tie up the loose ends of the thread. ...


7

Use NDSolve antiD = NDSolveValue[{f'[x] == Sqrt[1 + x^3], f[0] == 0}, f, {x, 0, 10}] Example usage: Plot[antiD[x], {x, 0, 10}] Alternatively... This works because this function can be antidifferentiated (by Mathematica). antiD = FunctionInterpolation[ Evaluate @ Integrate[Sqrt[1 + x^3], {x, 0, t}, Assumptions -> 0 < t < 10], {t, 0, ...


6

First, note that turning off messages is technically not the same thing as not printing them. You can avoid printing messages by removing the output channel they're being sent to: $Messages = {} Restore the previous behaviour using $Messages = $Output, provided that you haven't changed $Output. But this won't turn messages off, it will only avoid ...


6

One option would be to restrict the function from funky regions with a Condition liks this f[x_, y_] /; Abs[x - y] > 5 := (Sin[x] - Sin[y])/(x - y); Plot3D[f[x, y], {x, -10, 10}, {y, -10, 10}] Out: One can easily see that Plot3D will also sample points in the region which is "forbidden", the points are just not drawn due to the RegionFunction. ...


6

This is not an attempt to answer the question exactly as posed, because generally speaking I don't consider it a good idea to subvert Mathematica's evaluation process (e.g. by reaching up the stack and rewriting definitions based on their RHS before they evaluate) just to satisfy arbitrary syntactical preferences. A better way, if you just want to stop ...


6

Note: this response was written before sample data for the question was changed from 24 3D points to 96 2D points. The main message remains unchanged, however. The error message is complaining that the first zero in the first polygon specification is not a valid index into the list coord which has 24 elements. A GraphicsComplex defines a list of points of ...


5

Not knowing quite what you're doing this may or may not help. I think the problem is you're turning the warnings off in the master kernel and the warnings you're seeing come from the slaves. I'd suggest... ParallelTable[Quiet[your code here],{your iterator here}]; OR ParallelEvaluate[Off[NIntegrate::slwcon]]; ParallelTable[your code here, {your iterator ...


5

According to the documentation center: Goto first scans any compound expression in which it appears directly, then scans compound expressions that enclose this one. Your Goto - Label construction is part of the List so Mathematica fails to find the label. Taking this under consideration, the following will work: k = 0; Do[{ Label[top]; k = k + 1; ...


5

The term incidence matrix has caused confusion on this site before, so I think it's time to clear this up. There's no standard, generally agreed upon definition of incidence matrix. It's a loose term for a matrix that describes the relationship (connections) between two different classes of objects. What these objects are can vary. When you see the term ...


5

We can use Hold to prevent message names from being evaluated until the time is right: g[a_, verbose_:False] := Module[{messageList} , messageList = If[verbose, {}, Hold[FindRoot::lstol]] ; messageList /. _[m___] :> Quiet[FindRoot[x^2 + x + a, {x, 3}], {m}] ]


4

NDSolve has already detected the largest such intervals for you, which is why the resulting InterpolatingFunctions have restricted domains. You can use InterpolatingFunctionDomain to extract those domains. I'd do something like so Clear[x1, x2, y] eqn = {x1'[t] == -x1[t]^2 - x2[t] + y[t]^3, x2'[t] == x1[t] - x2[t] + x1[t]^2 x2[t]^2, y'[t] == x2[t]^2 ...


4

Sorry, but your matrices aren't valid incidence matrices. From the IncidenceMatrix help page: For an undirected graph, an entry $a_{ij}$ of the incidence matrix is given by: 0 if vertex $v_i$ is not incident to edge $e_j$ 1 if vertex $v_i$ is incident to edge $e_j$ 2 if vertex $v_i$ is incident to edge $e_j$ and a self-loop In ...


4

The test matrices are matrices but not incidence matrices. The rows represent the vertices and each column represents an edge. Consequently each column must have only 2 non-zero entries or a single entry of 2 for self loops. This is not the case for any of the matrices or their transposes. To check for yourself, try yourself, e.g.: mat = ...


4

The answer why it is not valid incidence matrix is given by the above answers. To verify if your matrix is valid, use the following command m = {{1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0}, {1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0}, {1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1}, {0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0}, {0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0}, {0, 1, 0, 0, 1, 0, 0, ...


4

I have found a workaround which works for my purposes, though it is not particularly pretty, and the weird behaviour of Evaluate on error messages remains a mystery to me. It is possible to switch between different Quiet behaviours by setting a custom message group and then switching that within the logic. The following code works, as far as I can tell. ...


4

Why not something a little simpler? g[a_, verbose_: False] /; ! verbose := Quiet[g[a, True], FindRoot::lstol] g[a_, True] := FindRoot[x^2 + x + a, {x, 3}] Now: g[1] (* no message *) g[1, True] (* FindRoot::lstol: printed *) This has the advantage of separating the primary definition from the one that controls Message printing, making both ...


3

Same idea a belisarius but moving the entire first argument into a separate function, while also localizing x: fn[x0_?NumericQ, v0_?NumericQ] := Module[{x}, {x[0], x'[0]} /. NDSolve[{x''[t] == 1, x'[0] == v0, x[0] == x0}, {x, x'}, {t, 0, 1}] ] StreamPlot[fn[x0, v0], {x0, -2, 2}, {v0, -2, 2}] No errors.


3

It's a bug: there are more than one call to Message[FindRoot::bbrac], and some of them are suppressed, but only if Quiet is used. Here's a way to check suggested by Szabolcs: messageHandler = Print[{##}] &; Internal`AddHandler["Message", messageHandler]; Quiet@FindRoot[x == 1, {x, 0, 0.5}, Method -> "Brent"] <...> ...


3

You only have to make sure that the coefficient c[n] in the Fourier series is defined for all n. This means that the If statement defining c[n] must return a value not only for n==0 as it does in your attempt, but also for other values of n. So all you have to do is change your code to c1[n_] := 1/2/Pi Integrate[Sign[x] Exp[-I n x], {x, -Pi, Pi}]; c2[n_] = ...


3

Assuming there's not a typo in your question, it's doing exactly what it should, meaning perhaps your equation or its entry is incorrect. Using a simplify wrapper: fs[a_] := FullSimplify[a, 0 < r < 1 && r ∈ Reals] I applied it to the blocks of your equation as follows: s1 = fs[4* Pi*(-(r*(1 + r)^2* Sqrt[-(((1 + r)^4 + (-1 + ...


3

The reason this error occurs is because Set and Part have the Attribute HoldFirst, while functions like Position, which was used to get the position 4, does not have HoldFirst. To verify, the line s[[1]] = Sum[s[[1]] /. b[3] -> k, {k, 3}] adds a parenthesis which does not get evaluated, so (s//Hold)[[1,4]] Out[1] = Part::partw: "Part 4 of ...


3

The trial version does not support export operations, so this is not possible with the trial.


3

You have the x overloaded in too many places. You use it as free variable for the Series, then you use it for the plot command variable. I think this error happens because ?? Plot show it has HoldAll. Then the x for the plot takes effect before the Series is expanded. But this 'x' is now a number, so Series complains as it needs a symbol. But best to ...


3

Do[ Check[{i/i, 1/(i - 5)}, Print@i], {i, -10, 10}] // Quiet 0 5



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