Questions tagged [infinite-loop]
Questions about looping or recursive structures that do not complete. Such structures include While, For, FixedPoint, and NestWhile. Also user defined functions that make recursive calls to themselves.
135 questions
1
vote
0
answers
104
views
How to define a function through a summation of other functions efficiently?
I want to plot the following function:
$F(x, \omega) = \sum_{m = - \infty}^{\infty}\sum_{n = 1}^{\infty} \theta(\omega m - \xi_{mn}) \cos(x \xi_{mn})$
Where $\xi_{mn}$ is defined as the BesselJZero[m,...
0
votes
2
answers
242
views
Iterative Calculation of Points on a Hyperbola Using Reflections and Line Intersections
Given the hyperbola $C: 4y^2 - x^2 = 3$, point $P1(-1, 1)$ lies on $C$. Points $Pn (n >=2)$ are constructed in the following manner: Draw a line with a slope of $-1$ through point $P(n-1)$ that ...
0
votes
1
answer
118
views
Optimize while loop with several conditions
I am trying to generate several random numbers according to some conditions, but the way I have it implemented, it won't run.
The conditions are:
...
0
votes
1
answer
72
views
Double For loop does not give the expected results? [closed]
Why does the j index start from 2 not 1 in this double ...
2
votes
1
answer
215
views
How can I count iterations with NestWhile?
I'd like to count loop iterations for some substitution rules.
For example:
rule = {1 -> {0}, 0 -> {1}}
init = {0}
maxIter = 10
I'm going to avoid all ...
0
votes
0
answers
110
views
Do loop Implementation
I want to generalise the following algorithm to a loop overall possible subsets of the original set.
the algorithm has the following form:
ver={X41,X42,X43,X44}
and
...
0
votes
1
answer
154
views
Wolfram Alpha simplifying $\sqrt{1+x^\sqrt{1+x^\sqrt{1+...}}}$ incorrectly [closed]
I am pretty new to Wolfram Alpha. I want Wolfram Alpha to find the derivative of $\sqrt{1+x^\sqrt{1+x^\sqrt{1+...}}}$. At the moment, I am having trouble with Wolfram Alpha simplifying it incorrectly.
...
0
votes
3
answers
248
views
How do I create a Table from a For loop?
I've been trying to create a table that has the % of the cycle of a sample and the module of acceleration for the first 100 values, but I don't know how to create it. Here's the code:
I have imported ...
0
votes
0
answers
121
views
Nested loop for two variables
I have a quantity as below,
P[k_0,A_]= A Log [k0].
I want to generate data for this for A={0,10^3} and k0=10^{-11} to 10^{-2} using a Do loop but I don't know how to apply a loop on two variables ...
0
votes
1
answer
187
views
How to work on "Do" loop?
let's say
...
2
votes
1
answer
106
views
Print out how many times to calculate the sum of the squares of its digits until answer is 1 or 4
I am trying to write a recursive function, toscare1[], that takes as parameter a positive natural number. Then calculate the sum of the squares of its digits, thus creating a new number; then, we ...
2
votes
0
answers
189
views
The fastest and most scalable way to write a nested loop
The problem is to find the weights {w1,w2,w3,w4} that satisfy the condition. Which is the fastest and most scalable way (e.g. for 10000 weights) to write this ...
1
vote
2
answers
160
views
Trying to apply numerical method with Do
I am trying the following scheme to learn to implement an iteration using Do loop. I tried to implement the same method using for loop but with same errors. I, therefore, turned to the Do loop to ...
1
vote
0
answers
62
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:
...
-1
votes
1
answer
99
views
Right writing of While loop
Help me pls write While loop correctly. I have next code:
...