I've tried to make an animation using python to demonstrate the 1-D simple harmonic oscillator and step potential examples. Hope that it can be useful for some of you. Have fun~ :)
https://blog.gwlab.page/solving-1-d-schrodinger-equation-in-python-dcb3518ce454
By the way, If you are...
Hello everyone !
I am working on ultrasound scan and the processing of the signal received by the probe. I made the model I wanted and as I do not have an ultrasound scan machine I want to simulate the signal processing.
I will do that with the Python package Scipy and the function...
The Coupled ODE Model
Below are my coupled differential equations, where the only variable I try to meddle with is the ITMblood. The motivation here is if I try to increase ITMblood (in the next section I will show how I do it), at some concentration of ITMblood (most likely a very huge one) ...
I have to perform a calculation on my data. Here is an example of data from just one time step (data from other time steps would appear as additional rows).
X
Y
Z
Total
2
2
1
3
Total = SQRT(X2 + Y2 + Z2).
The calculation I have to do is: (N • N), where "N" is an average.
I tried...
Check this link: How to override the copy/deep-copy operations for a Python object?
Can anyone explain, in layman's terms, what is going on in this source code?
from copy import copy, deepcopy
class MyClass(object):
def __init__(self):
print('init')
self.v = 10...
Hi,
I'm new to programming in python [total beginner in programming] and I would like to ask you for your help.
Here is what I got so far:
import numpy as np
import random
from math import sqrt
p = np.array([(0, 0), (1, 0), (1, (1/sqrt(2)))], dtype=float)
t = np.array((0, 0)...
In a self learning project I am fooling around book https://faculty.washington.edu/rjl/fdmbook/
I want to do some of the computation myself to better understand the concepts but the book is Matlab based and Matlab is too expensive.
Does anyone by any chance have some of the codes provided by...
I'm given this code to plot the system for task 1 where my teacher have used some random numbers just to show us how the code can be used:
The code makes a plot that is given below:
So my professor just gave us this code and plot without saying anything more. All the students in the class...
Hallo at all!
I'm learning statistic in python and I have a problem to show you.
I have this parametric function:
$$P(S|t, \gamma, \beta)=\langle s(t) \rangle
\left( \frac{\gamma-\beta}{\gamma\langle
s(t) \rangle -\beta}\right)^2\left( 1- \frac{\gamma-\beta}{\gamma\langle
s(t) \rangle...
How to run a numerical simulation of Laplace equation if one of the boundary condition is like this: $$V(x,y) = 0 \text{ when } x \to \infty$$
I am trying to use Python to plot the solution of this Example 3.5. in Griffins EM
Hello
I am struggeling with a problem, or perhaps more with understanding the problem.
I have to simulate a one dimensional percolation in Python and that part I can do. The issue is understanding the next line of the problem, which I will post here:
"For the largest cluster size S, use finite...
Hello everyone!
I was studying chaotic systems and therefore made some computer simulations in python. I simulated the driven damped anhatmonic oscillator.
The problem I am facing is with solving the differential equation for t=0s-200s. I used numpy.linspace(0,200,timesteps) for generate a time...
there's a website to size an aquarium heater or chiller.
This is just for learning purposes (not for fish) but I have modified these parameters from default to perform a load calculation on a 100 gallon glass tank... For the tank temperature range I set to be between 150-160 degree F. and a...
I attached a file with some explanations of the variables in the code and the plot that I should get. I don't know what is wrong. Any help will appreciated.
from scipy.integrate import quad
import numpy as np
from scipy.special import gamma as gamma_function
from scipy.constants import e...
The book's procedure for the "shooting method"
The point of this program is to compute a wave function and to try and home in on the ground eigenvalue energy, which i should expect pi^2 / 8 = 1.2337....
This is my program (written in python)
import matplotlib.pyplot as plt
import numpy as...
Hi
I am learning how to do a line integral convolution with OpenGL given a vector field. So, as a first step, I need to learn how to create an nxn noise image. Are there any good tutorials/books I can use to learn how to do this?
As part of a group project, we have been asked to create a code which produces the following matrix:
I want to create the graphics of this in a way that looks similar to this:
But of course with different number of cells, different colours, etc. The problem is that from what I have found...
I am currently doing a leet code problem and came across something, I have not noticed before.
Here is a sample of the code I am working on.
s = "10#11#12"
A=[]
B=[]
i=0
count=0
while i < len(s):
if i+2<len(s) and s[i+2]=='#':
A+=[(s[i]+s[i+1]+s[i+2])]
i+=3
print(i)...
Hey Physics Forum
I am currently doing my bachelor project in geophysics, with focus on the evolution of glaciers in Greenland. My project consists partly of programming, because I want to get better at it. I have, however, hit a wall. I can't seem to figure out what is wrong with my code and I...
Hello everybody,
I am a master student in Theoretical Chemistry and I am working in the DFT realm. Both TDDFT and DFT applied to extended systems (eg. using QUANTUM ESPRESSO). Of course I work with these softwares from a end-user point of view, not as a developer.
But anyway, even if some of...
Hello,
I am an Undergraduate student looking for ideas for a project in Python. The project should contain a library filled with modules, classes (and preferably something with inheritance), and the unittest module.
I would like to do something as follows: First, some kind ob WebScraping to...
Please help!
I am trying to create a Python program for an assignment that will convert Celsius to Fahrenheit and vice versa depending on the input from the user. The numeric conversion portion of the code is working, however, if the user inputs "exit" the while loop is supposed to terminate...
Hello everyone. I need to construct in python a function which returns the evaluation of a Chebishev polynomial of order k evaluated in x. I have tested the function chebval form these documents, but it doesn't provide what I look for, since I have tested the third one, 4t^3-3t and
import numpy...
I am currently working my way through some w3schools python exercise on tuples and lists etc and one question was to write a program to converted a tuple to a string.
Now originally I used the str() function on the tuple and printed the result. I then used the string in a for loop for a...
I’ve been looking for a certain type of software that can host programming (preferably C or Python) and other process that I’m going to need such as DSP, DSP filters, diagrams (3D graphs, charts,…), and text editing within the same file. It’s mainly so that I can incorporate and use each one...
I'm interested in quantum programming. So far I've managed to use Java and Python inside Datamelt computation project for physics simulations and for various statistical plots. Now I want to make a simple code that illustates quantum computing, and maybe even to visualize its principles (for...