3,615 questions
Best practices
2
votes
1
replies
54
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 ...
0
votes
0
answers
40
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
52
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
0
answers
62
views
Python package to compute ekman velocities in the water column from observations? [closed]
Is there any python package to compute ekman velocities in the water column from wind data observations? I have wind direction and velocity on an specific location and I would like to obtain a ...
1
vote
2
answers
139
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 ...
-1
votes
1
answer
133
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
84
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. Below here is the ...
3
votes
1
answer
217
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
365
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
107
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
221
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
172
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
105
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
54
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
160
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
200
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
136
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
51
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
71
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
59
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
61
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
254
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
75
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
55
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 ...
-1
votes
2
answers
45
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
59
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 ...
0
votes
0
answers
65
views
Computing the differential cross section using python
I am looking at the decay of $Z\rightarrow e+e-$. I am trying to plot d$\sigma$/dcos$\theta_{e-}$ vs cos$\theta_{e-}$ where $\theta_{e-}$ is the angle, in the correspondent Z rest frame, between the ...
2
votes
0
answers
60
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
113
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
110
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
86
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
71
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 ...
0
votes
0
answers
66
views
Simulation of radar images based on a simulated wave field
I am modeling a radar image based on my already modeled field of sea surface waves. Faced with the problem that the final image does not work right. It turns out to be some kind of nonsense. You can ...
1
vote
0
answers
80
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
106
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
110
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
43
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
68
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
64
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 (...
0
votes
0
answers
65
views
ATLAS Silvaco: I am trying to simulate a Silicon Heterojunction Solar Cell in Silvaco. How do I model the charge transport at ITO/a-Si(p) interface?
The ITO(n)/a-Si(p) interface creates an opposing diode for the c-Si(n) based SHJ.I am trying to implement tunnelling using bbt.nonlocal and tat.nonlocal models.No matter how small the qtmesh is, I ...
1
vote
1
answer
49
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
51
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
134
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
79
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 (...
0
votes
0
answers
110
views
Python Programming for Keithley 6487
I’m working on a script to perform measurements with a Keithley 6487 and am currently experiencing difficulties with reading voltage and current values. Although I have some experience with PyVISA on ...
1
vote
1
answer
92
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
53
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
86
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 ...
0
votes
0
answers
48
views
Issues with enthalpy & combustion thermochemistry calculations using the thermo python package
I am working on a Python project to generate rocket engines according to user parameters. However, I've been dealing with the thermochemistry calculations for quite a while and I do not know what to ...
2
votes
1
answer
121
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). ...