Skip to main content

Questions tagged [debugging]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
46 views

Solve function not returning the same output when it should

I'm trying to obtain an equation describing the intersection points of an arbitrary hyperbola with an ellipse centered at the origin. If I restrict the hyperbola to not have any horizontal translation,...
William's user avatar
  • 101
0 votes
2 answers
85 views

Expand disagrees with original expression

I have a rather nasty double summation that I am doing. To check that whatever I do it is valid, I routinely substitute in numerical values. I also have checked the result of the double sum by doing a ...
RealDisinformation's user avatar
3 votes
0 answers
103 views

Partial trace of a $n \times n$ square matrix

I would like to create a function to compute the partial of a general matrix. I came across to the following code for a 4x4 matrix: ...
Gabriele Stevanato's user avatar
1 vote
1 answer
59 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
30 views

Insert function not working [closed]

...
1goncalo1's user avatar
4 votes
2 answers
355 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
241 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
135 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
  • 365
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,419
0 votes
0 answers
51 views

Printing the value of a function crashes Mathematica

I define SolVm1: ...
NC520's user avatar
  • 479
2 votes
1 answer
72 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
126 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
78 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
70 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,443
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
666 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.9k
6 votes
2 answers
146 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
  • 147k
4 votes
0 answers
99 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
210 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,630
3 votes
1 answer
80 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
255 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,020
6 votes
1 answer
131 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,411
0 votes
0 answers
63 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
109 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
85 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
142 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,271
0 votes
0 answers
55 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
438 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
158 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
  • 309
1 vote
0 answers
48 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
178 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,591
1 vote
0 answers
53 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,591
4 votes
1 answer
210 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,467
12 votes
2 answers
280 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.6k
1 vote
0 answers
63 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,467
2 votes
1 answer
155 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
  • 587
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
122 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
228 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
  • 9,020
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
  • 559
4 votes
1 answer
183 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,467
1 vote
1 answer
101 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,467
2 votes
0 answers
43 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,271
1 vote
1 answer
69 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
  • 711