3,604 questions
-3
votes
0
answers
72
views
Too many vertices in COMSOL mesh [closed]
I'm making a diffraction grid model in COMSOL. It consists of plate cut through (the "Screen") and the block of media (the "Air"). But when it comes to creating a mesh the program ...
4
votes
1
answer
132
views
Linear regression using scipy.ODR gives 0 error on all parameters
I was trying to use scipy ODR to fit a linear graph as that would take into account both my xerror and yerror for each value. It does infact get me parameters out but I just end up with it saying that ...
2
votes
4
answers
152
views
Is this floating-point thermistor beta equation robust?
I'll try to be judicious in how much context I include here. I will lead with my primary question and then fill out more context.
Question
Is there a different form of my equation that will be more ...
0
votes
0
answers
51
views
A problem in indexing hub selection for a many-body state problem and erdos number
I'm working on reproducing figure 8 of “Dynamical decoherence of a qubit coupled to a quantum dot or the SYK black hole,”.
The figure is:
In the paper "hub=0 corresponding to the many-body state ...
0
votes
1
answer
105
views
Time function for Plasma simulation
I would like some input or suggestions to an aspect of a program I am writing. I am programming a simulation of impurities in a background plasma. The background data is defined on a certain grid and ...
Best practices
0
votes
4
replies
68
views
Numerical estimate of derivative for stochastic process
I am modelling a stochastic process in which the position of a particle is being updated according to the following rule: X[t+1] += V[t] * dt + np.sqrt(2*dt) * np.random.normal(0, 1). My simulation ...
Best practices
2
votes
1
replies
62
views
Compute 1D motion profile with acceleration, deceleration and mid-course target change
I need an analytic solution for a 1D motion controller. Initial state: x=0, v=0. Parameters: a_acc = 50, a_dec = 30, v_max = 40. Given a target position (e.g. x=20) the object should:
accelerate up ...
1
vote
0
answers
60
views
Ray tracing for the offner stretcher
Please help me refine the ray tracing code of the Stretcher Offner in MATLAB.
I used the formulas from the article to plot graphs from Figure 3, showing the dependence of the group delay on the ...
0
votes
1
answer
68
views
Rotate Pelvis to face the camera UE5.6
I am in the process of making an active ragdoll character in ue5.6. I have gotten the ragdoll walking, grabbing, hanging, jumping, and all sorts of fun stuff. But I am currently stuck on how to make ...
2
votes
2
answers
148
views
How to fix the erfz function from package pracma properly?
I need to use the function erfz (error function that takes complex arguments) for fitting Voigt profiles. It seems like it is only implemented in R in the pracma package as erfz(z).
I tried to ...
-2
votes
1
answer
136
views
Calculating second focal point of planetary orbit [closed]
With a 2d physics simulation in JavaScript I am trying to determine the second focus of an ellipse. My system's eccentricity is too low. The point moves around too much and isn't where it should be. ...
0
votes
0
answers
104
views
Trying to graph of the relationship of the frequency and wave number of the spin wave
I've been trying to make this code into a function and gather the wave number, but how do I get the frequency and then collect the data bt changing the wave number and then graphing.
Here is the code ...
2
votes
1
answer
236
views
Physics of cubes in simulation
I want to create a website that can repeat that experiment from Youtube video. And i made it, its working, but it has problem: when input number is entered above 2-3 thousand, the big block, when ...
3
votes
1
answer
384
views
Integration limits when integrating to infinity using quad and vectorize
I have a rather complicated physics-model (Thomas Hopfield model from https://www.researchgate.net/publication/...
1
vote
2
answers
109
views
Issues with boundary layers in step propagation
I am trying to create a function which receives the transversal profile of a beam and outputs the transversal profile propagated by some distance. To exemplify the task, here is the profile of a ...
1
vote
1
answer
230
views
FMM M2M Translation Discrepancy (Greengard's Short Course) with SciPy Spherical Harmonics
I'm implementing the Fast Multipole Method (FMM) for Coulomb interactions, following "A Short Course on the Fast Multipole Method" by Leslie Greengard: http://math.nyu.edu/faculty/greengar/...
2
votes
1
answer
175
views
What's making these two neutron stars not get closer to each other? (Kilonova Simulation with Python)
Here's my code that I've made to simulate two neutron stars resulting in a kilonova:
import numpy as np
import matplotlib.pyplot as plt
G = 6.6743e-11
c = 299792458
R_ns = 12000
m1 = m2 = 3.5e31
...
0
votes
1
answer
116
views
Fourier propagation is propagating backwards
I am trying to write a code which propagates a beam a certain distance through Fourier propagation. Here is the relevant excerpt of the code:
import numpy as np
import scipy
from matplotlib import ...
0
votes
0
answers
59
views
Unable to add physics (collision, gravity) in my A-Frame project (Quest + PC via Netlify)
I'm developing an A-Frame (HTML/JS) project for use on Meta Quest 1 and on PC via Netlify to create a simple VR escape game.
I want to add physics (collisions, gravity on objects, impassable walls) ...
6
votes
1
answer
216
views
Scipy OptimizeWarning: Covariance of the parameters could not be estimated when trying to fit function to data
I'm trying to plot some data with a non-linear fit using the function:
kB and Bv being a constant while J'' is the independent variable and T is a parameter.
I tried to do this in Python:
#Constants
...
0
votes
1
answer
235
views
Sunset/rise calculation
I'm using the suntime class that is based on: "Calculate sunrise and sunset times for a given GPS coordinate within PostgreSQL".
I'm struggling with the following:
At the end of the ...
0
votes
0
answers
148
views
Why does pybullet physics sim behave non-realistic in simple experiment?
I want to know if pybullet is accurate enough to use it to simulate physics environments to train machine learning models. I want to create a line following robot that follows a line based on what it ...
0
votes
0
answers
56
views
Unity Raycast from spotlight fails to detect obstacle in 3D side-scroller
I’m working on a 3D side-scrolling game in Unity where I want to cast rays from a Spot Light to detect obstacles behind which I want to generate a shadow platform (similar to Projection: First Light).
...
2
votes
1
answer
76
views
Volume preservation in phase space in leapfrog algorithm
Based on the information provided in these lecture notes, the leapfrog integration algorithm should preserve area (for single-body systems) in phase space.
I implemented the algorithm for a Coulomb ...
1
vote
1
answer
68
views
Does this leapfrog method work for the 3 body problem?
I have been trying to make a leapfrog integration to document the variation of the hamiltonian over time for the 3BP, but I never really grasped how to implement it using the normal half-step method ...
1
vote
0
answers
64
views
How can I fix point adding error on a quartic trajectory generation in matlab
I am working on generating a quartic trajectory with a quintic finish with known points and an acceleration limit on matlab. After creating this trajectory using the constants I calculated I am trying ...
6
votes
1
answer
278
views
Accurate 2D collision simulation in Rust
I have created a 2D physics simulation in rust that works for the most part. It involves creating balls which collide with each other and their container. I have looked at a lot of resources and found ...
0
votes
0
answers
81
views
CharacterBody3d velocity.y continues continues to increase even when it's on the floor. Why?
I have a box, which is used in a similar fashion to a Sokoban box. Here is a screenshot:
The box has an Area3D collider on each vertical side. When the player enters the Area3d the box is moved ...
0
votes
0
answers
58
views
Possible bug in RealityKit Physics
My iOS app uses RealityKit with Physics to move entities. It requires to put objects on a board. This must be done with a totally inelastic impact, i.e. the object must not bounce back when put on the ...
-2
votes
2
answers
54
views
2D object doesnt collide with my player object
trying to make a flappy bird clone and i cant seem to make the player and walls collide (very new beginner) so was looking for solutions and none of them worked for me
using UnityEngine;
public class ...
0
votes
0
answers
67
views
How can I overlay a Rankine cycle on top of a Temperature-Entropy plot? How can I add physical transformations on top of my cycle?
Results of my code on top of which I would like to plot the cycle:
I’m struggling to plot a Rankine cycle using the provided thermodynamic points. I can input any data they want, but I can’t find the ...
2
votes
0
answers
66
views
Not obtaining the correct orbital diagrams with visualising the wavefunctions for hydrogen in python
I have used the wavefunction of hydrogen and started plotting the electron clouds for each specific electron orbital. I used the Numpy, SciPy for calculations and used plotly's graph objects for ...
1
vote
2
answers
128
views
deviation in solutions (differential equations) using odeint vs runge-kutta-4th
I am modelling a Coupled Spring-Mass-System: Two objects with masses m1 and m2, and are coupled through springs with spring constants k1 and k2, with damping d1 and d2.
Method 1: taking a cookbook-...
0
votes
0
answers
123
views
Calculating MSD of a Brownian particle using trackpy vs manually
I am trying to understand the trackpy algorithm for calculating MSD in comparison to a simple manual method of calculating it. My intention is to use trackpy to analyze the tracks of Brownian ...
2
votes
1
answer
94
views
Intersection of two data sets, one linear and one not
I need to find the intersection of a straight line and a stress-strain curve to determine the offset yield strength.
I've been trying to use the following code, which successfully prints the curve ...
2
votes
1
answer
85
views
Unable to create a toggle for gridlines on MatplotLib Python
I've been trying to make a toggle button to turn on and off the gridlines on my graph every time it's clicked. I understand how the toggle works as I was able to do it for some lines being animated ...
1
vote
0
answers
90
views
Why does my 3D double pendulum simulation take too long to run?
I am trying to simulate a 3D double pendulum using Python, SymPy, and SciPy. The goal is to solve the Lagrange equations and animate the results. However, the script runs indefinitely, and I have ...
1
vote
0
answers
110
views
Orbital motion predictor is only accurate when satellite starts on a specific side of the planet
I created a script that simulates gravity between satellites and a planet and predicts the orbit of the satellite based on the orbital elements calculated by the satellite's velocity and position ...
1
vote
1
answer
115
views
Why does this orbiting object not perfectly repeat its orbit?
Clip of wonky orbit
I made a rudimentary (I'm still extremely proud of it) orbital sim. The satellite does not go around the planet on the second pass the same way it went around on the first pass. ...
0
votes
0
answers
49
views
Entanglement entropy of Bell Diagonal States returns always one
I've been trying to compute the entanglement entropy for Bell Diagonal states. I tried many implementations in python and all of them gave me that all possible states have this entropy equal to 1.
...
0
votes
0
answers
76
views
How to simulate in python the superconducting density of states of a BCS superconductor with YSR (yu-shiba-rusinov) with 1D chain tight binding model
I try to simulate the following problem:
Compute the density of states numerically of a BCS superconductor with magnetic impurities using the tight binding model of 1D chain with periodically border ...
0
votes
1
answer
68
views
Generate trajectory along surface of a sphere with velocity
I am trying to generate trajectory between 2 points A and B along surface of a hemisphere.
Constraints:
The end point of the trajectory(Point B) should have velocity in a certain direction given by (...
1
vote
1
answer
53
views
Fixing fluctuations, precision errors and more in velocity control algorithm. Is my approach correct?
Problem:
I want my "Follow Coordinates System (FCS)" to reach the position of a "Set Coordinates System (SCS)" while maintaining a trapezoidal velocity profile using given ...
0
votes
0
answers
60
views
Simple MD simulation for N atoms with PBC in Python
I'm trying to implement a simple molecular dynamic simulation in Python for N atoms with periodic boundary conditions while allowing coordinate wrapping to visualize the atoms interacting through
...
0
votes
1
answer
163
views
Molecular dynamic simulation using velocity verlet in Python
I'm trying to implement a simple MD simulation in Python (I'm new to this),I'm using LJ potential and force equations along with Verlet method.
I posted another question about the same code yesterday ...
1
vote
1
answer
89
views
MD simulation using velocity verlet in Python
I'm trying to implement a simple MD simulation in Python (I'm new to this),I'm using LJ potential and force equations along with Verlet method:
def LJ_VF(r):
#r = distance in Å
#Returns V in (...
1
vote
1
answer
96
views
Problem Updating Angular Velocity and Angles in Binary Star Orbit Simulation (Python, Matplotlib)
I'm creating a simulation for a binary star system in python using matplotlib. I want it to change based on the users inputs through sliders I've provided. When I first created this without any real ...
1
vote
0
answers
57
views
Output is not as expected when learning phase transitions in the Ising model
I am working on a numerical project using Python3 to estimate the phase transition of a 2-D Ising model using deep learning.
I have completed up to the point of calculating the spin coordination using ...
1
vote
1
answer
88
views
Alternatives to Power Spectral Density for Response of an Oscillator
Background:
Antiresonance is the phenomenon when the amplitude of a system (say an oscillator) shows a significant dip. Here is an article in Wikipedia discussing the same in a coupled system. The ...
2
votes
1
answer
125
views
Difficulties achieving convergence with NLopt mathematical optimization for a physics problem
I am coding a physics simulator for simulating the static behavior of objects floating in water (mainly ships). Object position is described by immersion depth (draft), and two angles (heel and trim). ...