Posts by oklucas • 31 points
4 posts
-
0
votes1
answer231
viewsQ: How to create a tridiagonal matrix in Python?
Hello, I would like to know how to write a tridiagonal matrix Nxn. I have three vectors that will be updated in a loop. I’m working with something semlhnante to this: Note: I would just like to know…
-
0
votes0
answers413
viewsQ: Indexerror: index 3 is out of Bounds for Axis 0 with size 2
D[i][j+1] = - u_med[i+1]/(delta_r[i]*delta_r[i+1]) Indexerror: index 3 is out of Bounds for Axis 0 with size 2 I’ve had another problem with that code and I asked here, but the problem now is this.…
-
1
votes1
answer82
viewsQ: list index out of range - From Fortran to Python
I wrote a program in Fortran and now I’m trying to write it in Python. However, it’s giving an error: D[i][j+1] = - u_med[i+1]/(delta_r[i]*delta_r[i+1]) Indexerror: list index out of range I’m a…
-
1
votes1
answer94
viewsQ: How to store information in a Python (write) file?
Hello, I’m writing a program in Python with a code I have in Fortran. I have a problem writing this excerpt (from Fortran): do i=1,n write(3,350)r(i),(ener(j)*alfa,j=1,6) !meV end do I tried to…