Questions tagged [procedural-programming]

Questions about Mathematica's procedural programming paradigm.

18 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
57 views

How would you rewrite these procedurally coded internal routines in functional form?

I came across the following two internal functions SimplifyDump`AbsToSign and SimplifyDump`SignToAbs that have been written ...
1
vote
0answers
73 views

Using While properly

I am trying to make While[] work with function results and evaluate them at the same time. ...
1
vote
0answers
65 views

While loop with changing variable , NDSolve and an Integral

Complete Edit: The Following code is new ...
1
vote
0answers
78 views

How can i set up an If or Do loop to follow this calculation procedure?

The following picture depicts the calculation procedure I wish to set up. The inputs are $T_r$, the chemical composition of the feedstock and constraints defined by the equivalence ratio. This ...
1
vote
0answers
55 views

Execute a notebook with a changing variable

I have created a notebook with one fix variable that I want to run from 1 to 100. Every time the whole notebook (all cells) shall be executed for the given number. At the end of the notebook, it shall ...
1
vote
0answers
50 views

Using Iterators within the WebSearch Command

I am currently trying to use the WebSearch command within Mathematica to search names from a Dataset that I have already imported. The names that I am trying to search are located in the 4th column of ...
0
votes
1answer
59 views

Creating a loop that gives first value that is false/true

My question is, if there is a command/function that gives me the first value for which an expression becomes false?! For a simulation of several rounds of the game battleships(ger. Schiffe versenken) ...
0
votes
0answers
30 views

Optimization of Do loop with multiple variables

I am pretty new to Mathematica and I would like to optimize a Do loop with multiple variables that I have. I have three lists of three elements each, with the condition that the first element must ...
0
votes
0answers
40 views

Running a complex notebook from a different master notebook?

I am trying to use the Dynamo notebook (https://www.ssc.wisc.edu/~whs/dynamo/dynamo_3S_v1.4.1.nb) in a loop over parameters. Basically, this software takes one matrix as input, solves ODEs and some ...
0
votes
0answers
48 views

Iterative loop with many steps

I want to automate the following code, let me begin by explaining the code first. This code, for representation, is divided into 3 parts. The first is: ...
0
votes
0answers
37 views

The variable in the While loop does not change

I have a simple while loop. After running, the variable does not change: ...
0
votes
0answers
43 views

How can I count the number of days (Monday, Tues, etc) in a year?

I am new to Mathematica and for fun am trying some of the challenges. The one I am working on now is: ...
0
votes
0answers
27 views

Running a test over a list to alter list

I'm quite new to this. I have a nested list that represent solutions to an equation. I would like to create a new list that only contains one 'representative' of each element. As an example, imagine I ...
0
votes
0answers
51 views

Using Map function with NDSolve

I would like to solve a set of differential equations but vary one parameter, KieP, between 900 and 1100. The solution for a given parameter has many peaks. I would then like to interpolate between ...
0
votes
0answers
65 views

Iterating a Module

I have a Module that can act on other Modules, which is given as Kk[EE,p,z1,z2,z3,K_func] and I am trying to iterate it, such that ...
0
votes
0answers
24 views

Finding trivial solutions, of the type 0 = 0, of an equation involving su(N) structure constants

so I have a bunch of equations $f_{abc} = f_{egd}m_{ae}m_{bg}m_{cd}$ (sum over repeated indices), where $f_{abc}$ are the structure constants of $su(N)$, for some $N$, and $m_{ab}$ are elements of ...
0
votes
0answers
176 views

Iteration problem using NestList or Do

I am trying to model a tank with discontinuous flow into the tank and discontinuous flow out of the tank. I do it numerically. You can imagine a tank to which I feed blue balls at timepoint t0, red ...
0
votes
0answers
118 views

Do loop with step size being being a doubling factor

Right now I'm doing loops like this: For[n=10, n<1000, n =2n, Do Stuff]. Is there a way to do this as a Do[] loop? I know ...