Questions tagged [code-review]
This tag is intended for the review and improvement of style for already functioning code. It not meant to change the objective of the code.
490 questions
0
votes
1
answer
75
views
Help to try and make my code finish running. Series of incomplete elliptic integrals
I have the following code
...
3
votes
1
answer
149
views
Speed up a finite element solver with small features (full code without error)
This is a question similar to the previous one with small features. I'm solving this problem by modifying the method of @Alex. The code can run without error, but it was always stuck at ~...
3
votes
0
answers
183
views
Mathematica demonstration of the expected volume of a random polytope in a ball
Related MSE post
I'm trying to make Mathematica demonstration of the paper The expected volume of a random polytope in a ball.
In the $d$-dimensional Euclidean space $E^d$ ($d \geq 2$), consider the ...
1
vote
0
answers
110
views
Optimizing my code so it runs faster, Series function
I am trying to compute expansions of some fairly long expressions using the built in function Series in Mathematica, and I was wondering if there is anything I can do in order to make the code run ...
1
vote
1
answer
148
views
How to fix error in HAM (Homotopy Analysis Method) while running code for second order solution?
This code works well to generate first order solution but gives recursion error on generating second order solution. I think the error is causing due to computation of $f$ but don't know how to fix it....
1
vote
2
answers
332
views
How to resolve the issues in code for the system of PDEs?
I have the system of PDEs, that is:
$F_{1\eta\eta}^{k+1}(i,j)+A_1^k(i,j)F_{1\eta}^{k+1}(i,j)+A_2^k(i,j)F_1^{k+1}(i,j)+A_3^k(i,j)F_{1\xi}^{k+1}(i,j)+A_4^k(i,j)F_2^{k+1}(i,j)+A_5^k(i,j)G^{k+1}+A_6^k(i,j)...
4
votes
4
answers
477
views
Is there an alternative and more compact way to make the following parametric plot?
Is there a better way of plotting this?
...
1
vote
2
answers
186
views
What does the Wolfram lint warning (PatternRule) "The same symbol occurs on LHS and RHS of Rule" mean?
Similar to this question, I am wondering about the meaning of the wolfram lint(PatternRule) warning: ...
3
votes
2
answers
466
views
Simulating k-many 'Electrons' with 'Repulsion' on 'Atoms'
Perhaps a better title would be:
"Simulating k-many Moving Points with Distance Contraints on Sphere-like Cages"
because I am not concerned about representing anything physically real. This ...
2
votes
3
answers
176
views
Rotations in lists with a fixed element
In general, I have this initial data:
n = 8;
a = Range[0, n - 1];
b = RandomChoice[a];
c = RandomSample[a];
d = Partition[c, 2];
where ...
1
vote
1
answer
241
views
Code optimization using Mod[] function
I wrote this code:
...
3
votes
2
answers
219
views
Code Optimization with Table and Sum
I wrote the following code:
...
2
votes
2
answers
121
views
Simple example of running one notebook from another [closed]
I have two notebook codes 'calculation.nb' and 'caller.nb'. The first code simply generates and prints a random number. The second code I want to use to call the first code a set number of times (say ...
2
votes
1
answer
223
views
Is there an error in the code? [closed]
Probability: $$\rho_{n}=\int_{\Omega} |\psi_{n}(x,y)|^{2}~ dx~ dy$$
Inverse Participation Ratio(IPR): $$IPR_{n}=\int_{\Omega} |\psi_{n}(x,y)|^{4}~ dx~ dy$$
Under the standard normalisation $\rho \le 1$...
7
votes
3
answers
660
views
Help with a very ugly piece of code [duplicate]
In orden to list all derangements of five elements, I wrote the following (very ugly) code:
...