All Questions
85 questions
1
vote
2
answers
205
views
vectorize an Ax=b solver
A lot of numerical solvers (such as this one), for some reason, only supports solving Ax=b where x, b are vectors.
What if I want to solve AX = B, where X and B are matrices.
I know numerically one ...
0
votes
1
answer
103
views
How to evaluating solutions to Coupled Nonlinear Elliptic ODEs with Relaxation Method?
I would like to determine the following system of coupled, nonlinear, elliptic ODEs of second order with boundary conditions f(0) = h(0) = 0, f(1) = h(1) = 1.
I used a relaxation method to solve the ...
0
votes
3
answers
108
views
running sum of np.array with widely varying elements
I need to calculate the running sum of np.array. Let's say a is a given np.array of length l and n is an integer step, then I need an array b of length l - n + 1, where
b= [a[0]+a[1]+...+a[n-1], a[1]+...
0
votes
0
answers
71
views
Apply Crank-Nicolson method to wave equation with np.linalg.solve
I want to solve a system of equations, where x,y are the vectors which I want the solutions. And c,d are the solutions. A,B are matrix
x-y=c+d
y-Ax=Bd+c
The full problem which I tried to summarize ...
0
votes
2
answers
422
views
How to check for exception values like nan,None and infinity
I'm coding a validator for a data pipeline and I want to assert that the numbers in my data are all "good" numbers, so I want to check for NaN, Inf or null. Are some kind of function that ...
0
votes
0
answers
148
views
NumPy np.linalg.solve give two different solution on different machines
I am studying computer science at the moment. We have the following exercise:
Execute LU decomposition given a matrix A and vector b using NumPy. We had to derive L and U by hand and came up the ...
1
vote
1
answer
209
views
Mismatch between Matlab log and Numpy np.log
While rewriting an old Matlab code to NumPy, I noticed differences in logarithmic calculation.
In NumPy, I use np.log, Matlab uses log function.
b = [1 1 2 3 5 1 1];
p = b ./ sum(b);
sprintf('log(%....
0
votes
0
answers
59
views
Numerical noise in numpy when recovering the phase shifts of a sinewave
When using the code snippet below, I expect the value of displacement_sim to almost exactly equal displacement however there seems to be a significant amount of numerical noise.
import numpy as np
...
0
votes
0
answers
39
views
I want to define two different regions with different properties, however, the following error is coming and I don't know how can I sort it out
import numpy as np
import ComPASS
from ComPASS.utils.units import *
from ComPASS.utils.grid import grid_center
from scipy.interpolate import griddata
#Set Output information
ComPASS....
1
vote
0
answers
36
views
np.arange strange behavior - numeric problems
I want to shift the zero t=0 to the point idx_null = 53538 and the length of the time is 62468.
This is the code which I tried:
dt = 3.1e-10
len(np.arange(-idx_null*dt,(len(t)-idx_null)*dt,dt))
Out [...
0
votes
1
answer
247
views
numpy: multiply uint16 ndarray by scalar
I have a ndarray 'a' of dtype uint16.
I would like to multiply all entries by a scalar, let's say 2.
The max value for uint16 is 65535. Let's assume some entries of a are greater than 65535/2.
Because ...
0
votes
4
answers
1k
views
How to filter Pandas Unique Result by only Non-Numeric Values?
Context
I have a Pandas Series and am calling the .unique() Method to get all unique Values. I now would like to filter this result to only see unique Values that are Non-Numeric. However, I get the ...
1
vote
1
answer
49
views
How to find points of the x axis corresponding to the values of y equal to some value
I have a sine signal defined by two lists
enter image description here
and I want to know the points of conductance (s) at which the voltage is 0.5.
I did it wit this code:
voltage = [...] conductance ...
0
votes
2
answers
66
views
I need help finding an infinite loop or something because the code that I have doesn't run
Im trying to calculate the hill coefficient of two logistic functions, f(x) and g(x), their composition, c(x), and input it in a datatable. Additionally, I am inputting the functions themselves, their ...
0
votes
2
answers
1k
views
Python numpy matrix multiplication mismatch in core dimension
I am trying to matrix multiply a 2x2 matrix with a 2x1 matrix. Both matrices have entries which are linspaces such that the resulting 2x1 matrix gives me a value for each value of the linspace.
I get ...