Questions tagged [numerical-methods]

Algorithms which solve mathematical problems by means of numerical approximation (as opposed to symbolic computation).

5
votes
1answer
2k views

Simple neural-network simulation in C++

The C++ code below simulates the timecourse of the membrane potential (V) of a population of 128 leaky integrate-and-fire ...
4
votes
1answer
212 views

Simple neural-network simulation in C++ (Round 2)

Intro Yesterday I posted this question. Since then, I've updated my code to incorporate these suggestions. I've also removed the dependence on C++11. Finally, I've made the following changes that ...
4
votes
1answer
190 views

Simple neural-network simulation in C++ (Round 4)

You may want to take a look at Rounds 1, 2, and 3, though that isn't necessary for understanding what's below. The major change since Round 3 is that my code is much cleaner and I'm including ...
4
votes
1answer
215 views

Simple neural-network simulation in C++ (Round 3)

As I mentioned at the end of my Round 2 answer, I've needed to expand my code in order to produce faithfully the data needed for Figure 1 of this paper. Unfortunately, the updates have made my script ...
2
votes
1answer
274 views

Multithreaded Monte Carlo pi approximation with own pseudorandom number generator

I made a Monte Carlo pi approximation program, that makes use of multithreading and a pseudorandom number generator I wrote (the one from big_wheel.hpp, which I ...
10
votes
1answer
855 views

Generate iCalendar .ics files with events for astrological aspects

I'm relatively new to Python, coming from a deep C++ background. I'm mostly looking for feedback on how to make my code more idiomatic/pythonic, but I would welcome and appreciate any and all other ...
7
votes
2answers
138 views

Simple function that simulates survey results based on sample size and probability

What is this: This is a simple function, part of a basic Monte Carlo simulation. It takes sample size and probability as parameters. It returns the simulation result (positive answers) plus the input ...
5
votes
1answer
110 views

Approximating Pi with Polygons

I wrote a program that approximates Pi by using polygons. I used the formulars in the picture beyond. In my code they are called innerPoly (\$c_{2n}\$) and ...
4
votes
0answers
174 views

Verilog implementation of trapezoidal integration method

Any and all comments are welcome in this review. Problem I've been doing a lot with numerical integration methods recently and have mostly been programming in Python. But...speedups! And FPGAs are ...
4
votes
1answer
864 views

Gees - GPL Euler equation solver

As a little helper I recently had to write a code that solves the 1-D Euler equations. As it serves my purpose well I though others could make use of it as well. The homepage of the code can be found ...
3
votes
2answers
2k views

Use Newton's Method to compute sqrt(x)

Given the following task: Use Newton's method to compute the square root of a number. Newton's method involves successive approximation. You start with a guess, and then continue averaging ...
3
votes
4answers
1k views

Computing integer square roots in Java - follow-up

(See the previous iteration.) My two previous methods for computing the integer square root of a number \$N\$ ran in the \$\mathcal{O}(\sqrt{N})\$ worst case time. Now I have added a method (...