Skip to main content

All Questions

Tagged with
5 votes
1 answer
701 views

Calculating the nonlinear reflection coefficient of a crystalline silicon slab

The purpose of this script is to calculate the nonlinear reflection coefficient of a crystalline silicon slab. It takes some input files (columns of data separated by whitespace), converts that data ...
roguephysicist's user avatar
3 votes
1 answer
1k views

Command line calculus program

I have written a simple command line program in Python 3 that accepts a function (in the mathematical sense) from a user and then does various "calculus things" to it. I did it for my own purposes ...
scott_fakename's user avatar
0 votes
1 answer
109 views

Find all subsets of a vector that sum up to another vector

I'm looking for a way to make my code more simple. This code takes a list of vectors and returns all subset of that list that sum up to another vector. For example: ...
Antarr Byrd's user avatar
3 votes
2 answers
1k views

Python -- polynomial operations class

This Python class takes a GF2 (finite field mod 2, basically binary) polynomial in string form, converts it to a binary value, then does arithmetic operations, then converts the result back into a ...
stackuser's user avatar
  • 133
5 votes
0 answers
297 views

Summing 2D NumPy array by multiple labels [closed]

Each element of the array is a coordinate (x, y). Each coordinate has two labels. Goal: sum the elements that have the same two labels. How can ...
Bystander's user avatar
4 votes
1 answer
5k views

Integration of data using Simpson's rule

I wrote a Python program that performs an integration of data using Simpson's rule. The program takes the areas to be integrated from a foo.ref file, with the following syntax: ...
Bas Jansen's user avatar
11 votes
3 answers
4k views

Determining Pythagorean triples based on the hypotenuse

Below is my written code to determine if, based on the hypotenuse, a Pythagorean triple is possible, and what are the lengths. I was wondering if there is a more efficient way of doing so. ...
Victor C's user avatar
  • 113

15 30 50 per page
1
10 11 12 13
14