Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [scientific-computing]

Do not use this tag. If your question is about using computers in science, ask on https://scicomp.stackexchange.com, instead. Only programming questions are on-topic on Stack Overflow.

scientific-computing
0 votes
1 answer
150 views

Gaussian Matrix?

Does a "Gaussian Matrix" refer to a matrix that has undergone gaussian elimination to become an upper triangular matrix (the U in lu factorization), or instead to the elimination matrix that ...
James Rider's user avatar
1 vote
1 answer
349 views

Pivoted QR in Julia?

In Julia, the function qr(A) will perform a QR decomposition on a given matrix A. However, is there any function/way in Julia to do a "pivoted" QR decomposition on a given matrix?
James Rider's user avatar
2 votes
1 answer
279 views

QR Factorization of Rank Deficient Matrix in Julia?

If (in Julia) we compute the QR factorization of a rank deficient matrix like A=[1 2 3;4 5 6;7 8 9], some of the diagonal entries of the R matrix will be very small. However, when doing this ...
James Rider's user avatar
0 votes
1 answer
165 views

How to initialize a container struct without knowing its size?

I am an amateur in C++, I am working on an scientific computing code. I defined a struct to store all the data input from the file. In the struct I have several 2D and 1D arrays whose dimensions ...
YS_Jin's user avatar
  • 55
2 votes
0 answers
93 views

Diagonal Matrix of Sigma Values in Julia

If I compute the SVD of a matrix A in Julia, it will give the sigma values of the matrix, BUT NOT in matrix form. However, if I want to assemble the sigma values of a matrix A into a diagonal matrix, ...
James Rider's user avatar
0 votes
1 answer
770 views

Efficient/parallel matrix routines on Apple silicon

I'm working in Physics, and as part of my job I have to do a lot of numerical calculations ("numerics"), 90+% of which involves the diagonalization of large matrices. At the moment, I use ...
dsfkgjn's user avatar
  • 13
0 votes
0 answers
35 views

UnboundLocalError: local variable 'rmeff' referenced before assignment

Hey I'm trying to compute the concentration of a tubular reactor with two reaction, I get this error thrown each time I run the code, I tried putting the variable in the function as global still ...
Votex5264421's user avatar
1 vote
1 answer
590 views

When to use xarray over numpy for medium rank multidimensional data?

I have some multidimensional data and was wondering if i should use xarray when speed is one, albeit not highest, of my concerns. I have a 4D array so it's not so big as to preclude me from using ...
Austin Benny's user avatar
3 votes
0 answers
298 views

How to calculate the path of a particle subject to a vortex?

I'm trying to draw a path of a particle starting at (x0,y0) subject to a vortex located at (xv,yv). This is inspired by Lorena Barba's AeroPython. As stated in the lesson, the motion should be ...
Ross Mariano's user avatar
0 votes
0 answers
131 views

Is there an effective way to fit the following two datasets with lsqcurvefit?

I have two complex datasets for which I intend to find a suitable function to fit them. The first dataset is presented as follows: As you can see, although complicated, it seems that this dataset is ...
tjk's user avatar
  • 3
0 votes
0 answers
73 views

pymc.Uniform giving ZeroProbability error: Stochastic alpha's value is outside its support, or it forbids its parents' current values

I am using a example given in web of pymc, when I try to run pymc.Uniform I am getting the following error --------------------------------------------------------------------------- ZeroProbability ...
Divyadeep harbola's user avatar
0 votes
1 answer
124 views

Finding the best linear section of data

I have some scientific data and wish to find the best region to fit a straight line in. Theoretically, the data should have a constant gradient but other influences effect the data such that there are ...
Stuart's Fanclub's user avatar
0 votes
1 answer
278 views

MATLAB: Does the execution of addpath/rmpath/savepath in one MATLAB instance affect other instances?

Does the execution of addpath/rmpath/savepath in one MATLAB instance affect other instances? Motivation: Imagine that you are developing a MATLAB package, which provides a group of functions to the ...
Nuno's user avatar
  • 266
0 votes
0 answers
263 views

Is MEX of MATLAB known to be slow on macOS?

Question: Is MEX of MATLAB known to be slow on macOS? Here, "slow" refers to the speed of setting MEX up, of compiling MEX code, and of running the MEX function. I have done some timing ...
Nuno's user avatar
  • 266
2 votes
1 answer
355 views

How do I add another coordinate label in Xarray?

I have an Xarray, say da = xr.DataArray([[1,2],[1,2]],coords={'x':['param1','param2'],'y':['idx','idx2']}) This is a 2D data array. As I build out my code, I would like to add another "column&...
Austin Benny's user avatar

15 30 50 per page
1
2 3 4 5
46