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...
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"
while i < len(s):
if i+2<len(s) and s[i+2]=='#':
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...
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...
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...
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
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...
I am trying to animate a plot of two distinct points (blue and green points) moving about the complex unit circle using Python's Matplotlib library. The problem I am having is that the animation does not remove and update the previous data points but rather sequentially smears it on the unit...
This might be a bit of a dumb question, but I'm not familiar with much in the programming world. I know a few languages that I've learnt on my own (online) or through a course in school (MATLAB). When it comes down to coding outside of matlab or a website, I'm not sure where to...
Hi, I want to plot the vector field ##\vec F = ye^x \hat i + (x^2 + e^x) \hat j + z^2e^z \hat k##
The code I have tried:
# The components of the vector field
F_x = y*e**x
F_y = x**2 + e**x
F_z = z**2*e**z
# The grid
xf = np.linspace(-0.15, 2.25, 8)
yf = np.linspace(-0.15, 2.25, 8)
I want to program an GARCH model for exchange rates. To do this, I calculated the residuals. Next, I did the following (in python)
vP0 = (0.1, 0.05, 0.92)
a = minimize(garch_loglike, vP0, eps, bounds = ((0.0001, None), (0.0001, None), (0.0001, None))...
I want to make an animation where a (red) ball departs from (0,0) and draws the function ##f(x) = sin x##
This is what I know:
How to plot ##f(x) = sin x##
To do so I followed instructions from the worksheet. Actually I'd have done:
But I guess they want to me to it in that way because...
I asked this question on SO, but I am having problems with it (I cannot even get into my account now). It seems that people using the IP I am using are asking a lot and that limits the number of questions I can ask. Please have a look at my question. Here's the link:
[Moderators note: bold large...
Two weeks ago I had no idea on how to code using Python. Now I have completed an online course on functions, loops and strings. However, in that course I did not practice using the specific library called Sympy. Besides, I will use Python in the Physics-Math background, for solving problems like...
I am looking for a book for learning Python so as to compute matrices, eigenvalues, eigenvectors, divergence, curl (i.e vector calculus).
If you also have online recommendations please feel free to write them.
Hello and thanks in advance for your help.
For about a week now, I've been trying to write what should be a simple python program. The idea is first to write a program for a simple harmonic pendulum, then adapt it to a spring pendulum. However, in order to do this, I have to write the simple...
In Keras, the method model.fit() is used to train the neural network. How can I get the output from any hidden layer during training? Consider following code where neural network is trained to add two time series
#multivariate data preparation
#multivariate multiple input cnn example
This is not a question, but a note, which I thought could help students.
I thought I would share this here, as people may be looking for practice problems.
My professor in the Python course I just finished recommended https://projecteuler.net/ as a site to practice using programming skills...
I have a signal which has an attenuation of 20dB per decade, how do I remove this attenuation using SCIPY? Alternatively how to do it in MATLAB if there are no SCIPY users here?
I'm a SCIPY/MATLAB novice fyg.
Thank you for your kind assistance