mclindner / galcollide Goto Github PK
View Code? Open in Web Editor NEWEnvironment for creating initial conditions for galaxy collisions.
Environment for creating initial conditions for galaxy collisions.
Problem: (-1*d_perigalactic * e) / (eccentricity - 1)) must be greater than initial separation for brentq to work
The _get_vxvy() function in Combine.py works fine for the parameters we are interested in, but if eccentricity is too low and (-1*d_perigalactic * e) / (eccentricity - 1)) - r) is negative,
brentq will fail. This makes sense given that f(a) and f(b) must have different signs, but I am unsure if this makes sense physics-wise. Obviously the initial separation must also be less than or equal to the intergalactic distance, and violating that errors as it should.
This may all be fine, but investigation is needed to make sure.
Error message:
Traceback (most recent call last):
File "Main.py", line 31, in
combined = two_bodys.combine()
File "/home/michael/NBody/Combine.py", line 205, in combine
x1, y1, vx1, vy1 = self._initial_conds(which_gal=self.Gal1)
File "/home/michael/NBody/Combine.py", line 157, in _initial_conds
x, y, vx, vy = self._get_vxvy(which_gal)
File "/home/michael/NBody/Combine.py", line 84, in _get_vxvy
self.inital_separation)
File "/home/michael/miniconda3/lib/python3.7/site-packages/scipy/optimize/zeros.py", line 776, in brentq
r = _zeros._brentq(f, a, b, xtol, rtol, maxiter, args, full_output, disp)
ValueError: f(a) and f(b) must have different signs
The period given by T = np.sqrt(((4*np.pi ** 2) / (k ** 2)) * self.semimajor_axis ** 3) is used in the solve_ivp function, so the domain of the output should match the period. However, when I plot the output values, this is not the case. Both galaxies seem to orbit many more times than expected. To me this seems like a units problem, but I am having a hard time identifying the error.
Validation that the orbits look as they should given the parameters that we input is needed - I will have to look through some textbooks. The units seem correct, but I am not 100% sure that changing the perigalactic distance is having the correct effect on the orbits.
Now that the length/vel scaling isn't needed, we could the (fully combined) model into the observation frame at the last step of the code. Our movies would then be in the correct perspective.
When there is no param file in the working directory, the NSteps in the param file created by running the code will be wrong. Running again fixes this when the file is overwritten. Maybe a default param file should be included, or specify in code.
We need to do this to ensure that the mass scaling isn't messing up the IC calculation math anywhere.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.