For questions on interpreting existing error messages that you have encountered, as well as writing and managing messages, assertions and checks for your own functions.

learn more… | top users | synonyms

21
votes
4answers
2k views

Why does MatrixForm affect calculations?

This is a really newbie question, but it has me confused. Why does this code work without // MatrixForm and doesn't work with ...
9
votes
3answers
3k views

General::ivar is not a valid variable when plotting - what actually causes this and how to avoid it?

I was just evaluating a couple of expressions and started to get errors like this: ...
40
votes
2answers
2k views

Mathematica Debuggability

One of the things that I really dislike about Mathematica is its lack of debuggability compared to many other programming languages. Some of the problems arises from the functional nature of ...
5
votes
1answer
2k views

How do I prevent NIntegrate::inumr errors within other functions?

I believe this question is best illustrated with a simple example. If I run FunctionInterpolation[NIntegrate[a + b, {a, 0, 1}], {b, 0, 1}] I get errors of the ...
15
votes
2answers
299 views

MathKernel doesn't return all Messages

In Mathematica I run this command: Plot[Sin[x], {x, 1, 15}, GridLines -> error] It generates a Plot with this error message: A GridLines specification ...
9
votes
2answers
485 views

Solving/Reducing equations in $\mathbb{Z}/p\mathbb{Z}$

I was trying to find all the numbers $n$ for which $2^n=n\mod 10^k$ using Mathematica. My first try: Reduce[2^n == n, n, Modulus -> 100] However, I receive ...
12
votes
4answers
294 views

How to catch complete error message information

If I evaluate this expression: Module[{}, 1/0;0^0]; msg = $MessageList I get: ...
2
votes
1answer
3k views

How do I identify the source of a “Tag times protected” error?

I have some code that looks like Table[ a = 1; b = {2, 3} c = i;, {i, 2} ] which gives an error: Set::write: Tag Times in c {2,3} is ...
12
votes
1answer
582 views

Finding a Specific Line in a Package

In a package I am developing, I accidentally left this line Protect[ uncompleted prior to running the package. Mathematica produced this error message ...
2
votes
1answer
2k views

How do I troubleshoot when I get a Part::partd or a Part::partw error?

Mathematica has produced the following error message: Part::partd: Part specification ... is longer than depth of object? What is partd? I think I may ...
44
votes
2answers
1k views

What are the best practices / most common / idiomatic ways to report errors in Mathematica?

In particular, what are the best ways to report errors about incorrect arguments to a function? Checking for the correct arguments is relatively easy using patterns, but how to report an informative ...
24
votes
1answer
427 views

which is better, using Assert[] or manual checks on arguments and other computations?

I never used Asserts in Mathematica, but trying to see what advantage they have over just argument check and additional definitions of the function to capture unwanted input. For example, which one ...
11
votes
2answers
526 views

Take screenshot of the entire desktop using Mathematica

Is it possible to get a screenshot of the entire desktop directly in Mathematica? I am on Ubuntu running Mathematica 8. For some reason GUIScreenShot[] fails. But ...
9
votes
2answers
266 views

How to find a specific error message?

Is there a way to find an existing error message in the System` context, that is used for a certain case? I want to include a message in a custom function that ...
11
votes
1answer
282 views

Check does not interrupt evaluation of the expression when a Message is emitted

On the surface, Check looks like a good method to use when you need to abort the evaluation of an expression whenever a Message ...
8
votes
2answers
705 views

Table function with Part[] call misbehaving, but only after initial startup of Mathematica

I am getting errors like: Part::partd: Part specification standardBasis[[1]] is longer than depth of object. with the following Manipulate expression: ...
6
votes
1answer
348 views

What does MaxStepFraction do?

I find that with NDSolve[...] while solving a partial differential equation, changing the MaxStepFraction from ...
3
votes
3answers
284 views

Need help with exception handling

I have read the docs for Catch, Throw, and friends multiple times, and I confess that I find them utterly incomprehensible... ...
2
votes
0answers
83 views

StringMatchQ error messages printed to console while main notebook is sitting idle [duplicate]

Possible Duplicate: Strange ::usage behavior in v9 I'm currently finishing up a Mathematica vector calculus package (MMA9.0 on Mac Os X), but have had a persistent problem that I haven't ...
4
votes
3answers
145 views

Incompatibility of Row and TeXForm

Bug introduced in 9.0 Update: Since no one has been able to give a reason for this change in behavior or provide a solution I am tagging this as a bug. Please report it to Wolfram Support if this ...
2
votes
1answer
691 views

A combination of Set::setraw and Set::shape errors

Please consider the following toy code: ...
0
votes
1answer
2k views

Stategies to avoid NIntegrate::slwcon error

I am trying to numerically evaluate an integral whose integrand depends on two parameters, say $(a,b)$ and when $b\gg 1$ I suspect (although it's not guaranteed) that the integrand is very small. Thus ...
28
votes
3answers
887 views

No warning when extrapolating with Plot

One of the most annoying "features" of Mathematica is that the Plot family does extrapolation on InterpolatingFunctions without ...
10
votes
3answers
94 views

How to limit number of user-defined messages issued per evaluation

I have written code such that if it runs into a particular function, a warning message is issued. However, it is common for the program to call this function several times in a single evaluation, but ...
9
votes
4answers
579 views

Using Position (which requires a pattern) in the same manner as Select (which requires a criterion)

I am using Mathematica7. I have a list of lists (creatively named list in the following sample code) containing data. I would like to find the positions of the ...
10
votes
4answers
2k views

What is the cleanest way to prevent divide-by-zero warnings?

If I evaluate {1, 2, 3, 4}/{5, 6, 0, 8}, obviously I get one warning: ...
9
votes
2answers
1k views

Why is this semicolon in red?

I have a piece of code that works well, but when I put a semicolon after a plotting statement, the semicolon appears in red. What's the error?
6
votes
2answers
458 views

How do I make NotebookEvaluate work inside Button?

The following creates a button to select a notebook to run. When the button is pressed it seems that Mathematica finds the notebook but cannot evaluate it. The following error occurs Could not ...
3
votes
1answer
297 views

Exception/Error handling using returns codes

There is good explanation available for error handling on this and similar links. Here there is information on handling inappropriate input arguments and handling unprocessed functions using ...
5
votes
1answer
1k views

FeynArts not working properly

So I have installed all FeynArts folders (from 3.5 to 3.7) with FeynCalc 8.0.1., and none of it is working properly :\ First I load the path to specific FeynArts package (3.5 for instance), then, by: ...
5
votes
2answers
164 views

“Not a valid Filling specification” error

I have a function, which plots the given function array f. This is a part of the function: ...
8
votes
1answer
239 views

Why is Dataset upset by division by zero?

Consider this example: ds = Dataset@Transpose[<|"a" -> {1, 2, 3, 4, 3, 2, 1}, "b" -> {6, 5, 4, 3, 2, 1, 0}|>, AllowedHeads -> All] Now say I ...
7
votes
1answer
128 views

What should I call the messages that appear when the mouse moves over failed graphics output?

I attempted to evaluate the following Plot[x^2, {x, 1, 2}, PlotStyle -> {RGBColor[a]}] which, of course, failed. After the failure, putting my mouse over the ...
6
votes
2answers
170 views

Interpolating an Antiderivative

I'd like to be able to make InterpolatingFunctions for antiderivatives of functions that can't be integrated symbolically. However, the following code returns several error messages: ...
5
votes
4answers
115 views

Passing a variable messages list to Quiet

I'm trying to build a Verbose option into some code but I'm having trouble passing to a Quiet statement a variable list of which messages I want to suppress. My ...
5
votes
1answer
188 views
3
votes
1answer
114 views

How do I format Compile[] correctly?

My Mathematica skill is still rusty, so kindly bear with me. I'm having problem formatting expression to compile the function correctly: $\sum _{g=1}^G \sum ...
3
votes
0answers
107 views

Dealing with errors and resuming the code after one

How can I write my Mathematica code so that it resumes at a specific place if any Message is displayed during the execution of an expression? For example, in Visual ...
3
votes
1answer
255 views

FunctionInterpolation Errors / Question re Evaluation Order and Options

I have using Mathematica functions that takes a Cartesian coordinate relative to the Earth (xyz) and converts it to a latitude, longitude, and altitude (lla). And here it is: ...
2
votes
1answer
110 views

Error when attempting to save Notebook. Cause and solution?

I am experiencing an error attempting to save a modified Notebook in Mathematica 10 under Windows. The error I get is: ...
2
votes
0answers
100 views

“LinkOpen::linke : specified file is not a mathlink executable”

The following code runs fine if I run it interactively: ...
2
votes
0answers
75 views

Finding and interpreting errors [duplicate]

This sounds like a fairly trivial question, but I can't think of any way to solve it. I am doing an extensive parameter sampling where a set of ODEs is used together with ...
2
votes
1answer
527 views

FindRoot Infinite expression 1/0 encountered error

I have 1 equation in 1 variable, which when I use Plot, looks like this: ...
2
votes
1answer
422 views

Inconsistent initial and boundary conditions

I have a 4th order nonlinear PDE with the following BCs and IC: ...
1
vote
1answer
45 views

error message DSolve::“bvnul”

...
1
vote
1answer
61 views

Turning Off Error messages locally

I'm trying to turn Off an error in an expression. ...
1
vote
1answer
103 views

FindFit::nrlnum What am I doing wrong?

I have a model called qobs: ...
1
vote
0answers
110 views

Failure of CountryData due to connectivity?

Today I started researching the "Four colours theorem" and to do so I need data, regions for example. I tried using the following line: ...
1
vote
1answer
416 views

What does the Error Message in DSolve really mean?

Having this ordinary non linear differential equation $$y'-x^2 (y+1)\cdot (y+2)^2= 0$$ with the boundary condition $y(4)=2$. When trying to solve this one with Mathematica by using ...
1
vote
1answer
719 views

Plotting a complex function [duplicate]

What does it mean if this message appears: {Im[(1-E^Times[<<3>>] f)/(1-Power[<<2>>] f)]-0,Im[(1-E^Times[<<3>>] f)/(1-Power[<<2>>] f)]-0} must be a list of equalities or ...