Skip to main content

All Questions

Filter by
Sorted by
Tagged with
-1 votes
1 answer
739 views

How to write Bessel function using power series method in Python without Sympy?

I am studying Computational Physics with a lecturer who always ask me to write Python and Matlab code without using instant code (a library that gives me final answer without showing mathematical ...
Becker Hija's user avatar
2 votes
1 answer
2k views

Is Gauss quadrature always a good option for know analytical functions?

What are the limitations of Gauss quadratures? I know that if I'm integrating, for example, a data set a Gauss quadrature won't be the best option, but if I know the function analytically is there any ...
baggins's user avatar
  • 21
0 votes
0 answers
336 views

Numerical solutions of unsteady 2D heat equation in python producing error incorrectly

I am trying to implement two numerical solutions. A forward Euler and a second order Runge-Kutta for the unsteady 2D heat equation with periodic boundary conditions. I am using a 3 point central ...
sokato's user avatar
  • 354
0 votes
2 answers
3k views

How do I solve a 2nd order differential equation for projectile motion with air resistance?

the equation is: d^2 r/dt^2 = -c/m (dr/dt)+g where r is the position of the projectile, c is the drag coefficient, m is the mass of the projectile and g is the acceleration due to gravity. Assuming ...
TIVONA's user avatar
  • 19
1 vote
1 answer
772 views

How to find the electric field from the potential?

That's my script to find a potentiel in a ionization room: # Programme de résolution de l'équation de Laplace # par la méthode de Gauss-seidel # importation des librairies import numpy as np import ...
Taha Elbad's user avatar
1 vote
2 answers
635 views

Estimate velocity on a spring by iterative approach

The problem: Consider a system with a mass and a spring as shown in the picture below. The stiffness of the spring and the mass of the object are known. Therefore, if the spring is stretched the ...
nabster's user avatar
  • 13
0 votes
2 answers
4k views

Angular spectrum method using python

I am trying to numerically propagate a given (electric) field using the angular spectrum method. For this I am following "Principles and Applications of Fourier Optics" (Robert K. Tyson) Chapter 3, ...
BluNova897's user avatar
0 votes
0 answers
485 views

Vector Plot of Electric Field (Laplace's Equation)

I have solved Laplace's equation for a 2D square box analytically, and would like to plot the electric field vectors as a function of y and x. https://www.youtube.com/watch?v=ws3LIfWxfcM This is a ...
Pox 219's user avatar
  • 15
2 votes
1 answer
7k views

solving 1D Schrödinger equation with Numerov method (python)

I'm currently trying to solve the 1D Schrödinger eq. (time independent) with the Numerov method. The derivation of the method is clear to me but I have some problems with the implementation. I tried ...
Sito's user avatar
  • 496
0 votes
3 answers
228 views

How to define a function in python that takes as an input mathematica function and it's argument and apply to it.

I want to define a function that takes arguments as a mathematical function , it's arguments, and number of iterations (I am looking for the zeros of the function with the fixpoint theorem). I know ...
George Farah's user avatar
0 votes
2 answers
1k views

Modifying C implementation of rk4 method

My problem is, frankly, that I'm unsure how this works. I need to modify the double f() function to solve an arbitrary differential equation d2θ/dt2 = −ω2sinθ, but as it is I am unsure how to proceed....
MCV's user avatar
  • 3