Questions tagged [debugging]

Questions about debugging techniques, using the built-in debugger, and/or the Wolfram Workbench debugger.

Filter by
Sorted by
Tagged with
1 vote
1 answer
56 views

Troubleshooting NDSolveValue::rdelay Error in a Dengue Epidemic Model with Delay Differential Equations in Mathematica

I am modeling the vector dynamics of a dengue epidemic using a system of delay differential equations (DDEs) in Wolfram Mathematica. My model includes a complex interplay of host-vector interactions, ...
Lennert Saerens's user avatar
1 vote
0 answers
28 views

Insert function not working [closed]

...
1goncalo1's user avatar
4 votes
2 answers
346 views

Is it possible in Mathematica to get a step-by-step evaluation of the following?

Is it possible in Mathematica (or WolframAlpha["...]") to get a step-by-step evaluation of the following? ...
1_student's user avatar
  • 635
6 votes
3 answers
235 views

Incrementing a random element of an array repeatedly

Consider this code to simulate a simple instance of the coupon collector problem. We initialize an array to {0, 0} and then keep incrementing a random element until we've incremented every element at ...
dreeves's user avatar
  • 696
1 vote
1 answer
118 views

Trace animation of spherical and $\pi$ atomic orbital

I want to get trace animation, which forms 3D object at last. Though I saw ring shape structural animation in the website: https://community.wolfram.com/groups/-/m/t/1991109 also Creating a movie of ...
rani's user avatar
  • 309
1 vote
0 answers
75 views

How do I profile my own code in Mathematica? [duplicate]

Coming from the question Profiling from Mathematica and reading the example, I manage to reproduce it but I have no idea how to adjust it to profile my own code. Given an example file: ...
infinitezero's user avatar
  • 1,409
0 votes
0 answers
49 views

Printing the value of a function crashes Mathematica

I define SolVm1: ...
NC520's user avatar
  • 479
2 votes
1 answer
69 views

How to debug `$Failed` messages

The following quits with message $Failed and no other information on Mathematica 13.2 (also on cloud), are there any debugging tricks to find the source of the ...
Yaroslav Bulatov's user avatar
4 votes
3 answers
125 views

How to evaluate EXPR in a subsession of a different already running kernel and get the output?

Is there a way to evaluate some expression in a subsession of another already running kernel, collecting the output, from a Local monitoring kernel? Something like ...
Fabrizio Nesti's user avatar
2 votes
1 answer
75 views

How to remove debugging prints from my package?

I'm using my own package, partly based on Ted Ersek's RootSearch package, partly based on some posts on this portal. It has a lot of debug prints coded like this: ...
Igor Kotelnikov's user avatar
1 vote
1 answer
69 views

DSolve is producing a segmentation fault for large systems of equations

The below code runs fine for anything up to a 64^2 matrix. However, moving to 128^2 throws a segmentation fault, which, despite my best efforts to debug, I cannot find a cause for. Or, to be honest, ...
GaussStrife's user avatar
1 vote
0 answers
37 views

ParametricNDSolve computation time is sensitive to the range of independent variable

My code to solve a system of nonlinear differential equations are the following: ...
user280016's user avatar
0 votes
0 answers
48 views

Line breaks cause too many empty lines in the Information box

$Version 13.0.1 for Mac OS X ARM (64-bit) (January 28, 2022) When there are many *Values with line breaks, the ...
Lacia's user avatar
  • 2,253
1 vote
1 answer
76 views

Techniques to debug large cell which crashes kernel?

Is there any technique to debug a large cell which crashes kernel? IE, perhaps some way to print each line in the cell before it gets evaluated? The following is such an example cell, crashes both ...
Yaroslav Bulatov's user avatar
5 votes
2 answers
607 views

Why the Debug .dll is work normall but the Release .dll is crash in librarylink?

The Catenate is very slow in FunctionCompile. So I want to use the librarylink to make a .dll...
yode's user avatar
  • 26.7k
6 votes
2 answers
145 views

Why is DSolve unable to solve this second order ode with initial conditions? Any workaround?

Fyi, report to WRI as suggedted. [CASE:4956902] This ode is similar to one here but for some reason DSolve could not able to solve this. This ode is from a ...
Nasser's user avatar
  • 143k
4 votes
0 answers
98 views

JoinAcross Memory Leak

I believe JoinAcross may have a memory leak but would appreciate some help looking at it. It appears to be small when used just once but when iterated a lot it eventually crashes my wolframscripts. I'...
rfrasier's user avatar
  • 592
0 votes
0 answers
209 views

Find a way to have all progressively human reading or logical steps in a symbolic calculus and improve rendering

I have the following Mathematica notebook on this link notebook link 1.First, I would like to generate in an automatically way this notebook to a Wolfram script that I can make run directly from ...
youpilat13's user avatar
2 votes
0 answers
38 views

How can I see the invocation stack of functions together with their arguments after Interrupt?

I know that by pressing Alt+comma, I can interrupt a running task. This brings me to an interactive environment as if there would have been a command Interrupt[] (...
Adalbert Hanßen's user avatar
0 votes
0 answers
76 views

How can I see, which function has stuck?

This code runs infinitely. How can I see which function exactly had stuck and potentially fix the code? ...
Anixx's user avatar
  • 3,585
3 votes
1 answer
78 views

How to exit TraceDialog?

Nice question brought by my friend. myFunc[x_] := x + 1; TraceDialog[Map[myFunc, Range[100]], myFunc[___]] Assume you decide to interrupt after entering the dialog....
Pavel Perikov's user avatar
7 votes
2 answers
254 views

Trace works differently with different right-hand-side rules—bug?

Bug introduced in 2.1 or earlier and persisting through 13.2 UPDATE: Wolfram Support has confirmed that this is a bug. I noticed that Trace does the following ...
thorimur's user avatar
  • 9,010
6 votes
1 answer
127 views

Want to tally the arithmetic operations of a recursive computation

Say I have a recursive computation func[n], and it involves the standard arithmetic operations +, -, *, /. I want to know how many additions, subtractions, multiplications, and divisions where done in ...
Andreas Lauschke's user avatar
4 votes
2 answers
288 views

How can I memoize the result of o[i] and at the same time force u to be incremented whenever o[i] is called?

I am working on the following code: ...
Red Banana's user avatar
  • 5,329
0 votes
0 answers
57 views

Piecewise[ ] for joining InterpolationFunction objects?

I want to combine InterpolationFunction objects, results of an NDSolve in a loop, into one function. This is my code: ...
Borislava Dimitrova's user avatar
0 votes
1 answer
104 views

See how Mathematica computed the integral

Mathematica says that the following complicated integral is infinity, which is reasonable: ...
Laplacian's user avatar
  • 1,053
2 votes
1 answer
83 views

NdSolveValue Freeze sensitive to initial condition

I am trying to solve the following system of non-linear differential equations: ...
Andrei's user avatar
  • 21
1 vote
0 answers
135 views

"Show Stack Trace" option always missing from error context menu

According to the Wolfram Language documentation, there should be an option in the context menu to see the stack trace: But I never see that option in my context menus: Is there a specific global ...
Shredderroy's user avatar
  • 5,249
0 votes
0 answers
53 views

If definition of elements in table

I need to define a table where the definition of the elements differs if the indices $i$ and $j$ are equal or different. In particular I have to implement the following formula $$(K_1^{(1)}(m_1,m_2))_{...
Davide Morgante's user avatar
2 votes
2 answers
370 views

Overwrite a tensor product notation a_\[TensorProduct]b_ := KroneckerProduct[a, b]

I noticed that the definition of KroneckerProduct and For example TensorProduct[({ {0, 1}, {1, 0} }), ({ {0, 1}, {1, 0} })] Output: {{{{0,0},{0,0}}...
wonderich's user avatar
  • 923
1 vote
0 answers
152 views

How to print local variable when assertion failed

Given the following code: func[i_] := Module[{k}, k = i; Assert[k > 0, k]]; func[-1] The output is: ...
Chris Guo's user avatar
  • 149
1 vote
0 answers
47 views

Is it possible to trigger some Mathematica code when an error of the type StringTake::take happens?

I process data from various sources (databases) that are formatted very inconsistently. I would like to be able to process them finally summarized in one piece. My code consists of many cases of ...
Adalbert Hanßen's user avatar
6 votes
1 answer
168 views

How to detect unused local variables?

I have some code (that I did not write) that has many unused local variables in Modules. I would like to clean this up. Is there any automated way to do this or to make it more clear that a local ...
Kvothe's user avatar
  • 4,387
1 vote
0 answers
52 views

Clean startup with back up

Whenever there are bugs Wolfram Support suggests to do a clean restart by holding Ctrl + Shift during start-up (often they recommend that without even warning the user that this will delete all their ...
Kvothe's user avatar
  • 4,387
4 votes
1 answer
209 views

Debugger toolbar refuses to turn off in a notebook. Not sure what to try next?

In the past I had the same problem but there was an easy solution. Just turn off at the Evaluation -> Debugger in the main menu. But this time it is completely ignored. First of all I do not know ...
Jules Manson's user avatar
  • 2,457
11 votes
2 answers
277 views

How to globally disable and re-enable Echo?

I have Echo's buried in code all over my notebook, I'd like a flag to turn them all on or off globally. Sure Unprotect[Echo];Echo=Identity would disable them, but ...
M.R.'s user avatar
  • 31.4k
1 vote
0 answers
59 views

How to change Echo output font size including EchoLabel within an entire Notebook?

I am creating a notebook template. I have Input and Output font size set at 10 but the Echo font size is 12. How do I change Echo to font size of 10? I cannot find a setting for this in Option ...
Jules Manson's user avatar
  • 2,457
2 votes
1 answer
145 views

Parameter space search routine is too fast?

I wrote a small script to comb through the parameter space of a function looking for where the function satisfies a certain relation everywhere on its (co-ordinate space) domain. However, since I am ...
shanedrum's user avatar
  • 577
0 votes
1 answer
71 views

NDsolve on ODE returns "non-numerical value for a derivative at t == 0.`." [closed]

The input is: ...
BenXylona's user avatar
7 votes
0 answers
118 views

Understanding the profiler: Is pattern matching/de-structuring expensive?

I was profiling some code and I am trying to understand what the results mean. Suppose we have the very idiomatic, ...
ITA's user avatar
  • 393
5 votes
0 answers
225 views

FindGeometricTransform not working properly for a simple problem

I am surprised why FindGeometricTransform is failing to automatically register or align two sets of points that are drawn from a ...
Ali Hashmi's user avatar
  • 8,950
1 vote
0 answers
55 views

Can Mathematica warn you about mistyped variables?

In other dynamical programming languages like Python, mistyping a variable, e.g. mistyping var1 as bar1 in the example below, immediately results in an error. ...
felix's user avatar
  • 549
4 votes
1 answer
175 views

What are some debugging helpers or tips/tricks in your Mathematica toolbag?

I am a novice so imagine my confusion with Mathematica's very poor error and trace messages. Debugging should be an easy thing to do even for beginning programmers but not with Mathematica. What are ...
Jules Manson's user avatar
  • 2,457
1 vote
1 answer
96 views

help improving my code or debugging it for Galerkin method

I'm trying to plot it but I cannot, where it keeps running without giving any plots for more than 40 mins, and I'm quite sure about code... The issue that I don't know to how to debug the code at all,...
SSRR7755's user avatar
1 vote
1 answer
40 views

Style function not working inside Print Row functions

About Watch[...] is a helper function for watching a list of variables or other functions inside a Module[...] during ...
Jules Manson's user avatar
  • 2,457
2 votes
0 answers
41 views

Is it possible to profile Wolfram Language code without Workbench? [duplicate]

Are there any tools built into the latest version of Mathematica that would allow a user to run a profiler against packages? I have read this question, but there have been two releases since that ...
Shredderroy's user avatar
  • 5,249
1 vote
1 answer
68 views

Why does the mix of Exclusions and SymbolicProcessing->0 sets my integral to $0$?

I am trying to compute a $5$-dimensional integral, which may or may not be zero. I do believe it is finite though, at least for the values $\epsilon$, $\sigma$ used here. The integral is given in the ...
Pxx's user avatar
  • 691
7 votes
0 answers
89 views

Logging modules in Mathematica?

Is there any logging module or functions or scripts that one can use to store all the information of what happens during executing mathematica program in Wolfram? For example, one might look up log....
Xuemei's user avatar
  • 1,616
6 votes
0 answers
89 views

In over my head in trying to create a debugger

Apologies for a less than ideal question, but if I could have asked a good question the answer would probably have been revealed in the process... In answer to this question @LeonidShifrin gave some -...
Julian Moore's user avatar
  • 2,560
2 votes
0 answers
554 views

Unknown Box Name (ToBoxes) Error

I'm getting the following error in Mathematica What is going on? How do I avoid such an error? In order to roughly understand how I'm getting this error, here is a bit of context: I'm using ...
sam wolfe's user avatar
  • 4,663