Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added homework file 'Exercise_1.1.ipynb' via upload #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ninakuni
Copy link

Hi Nils, my homework is enclosed in file 'Exercise_1.1.ipynb
Please let me know if something went wrong with the upload and if there's something wrong, missing or whatever :)
Thanks, Nina

@nilsvu
Copy link
Member

nilsvu commented Apr 13, 2019

Hi @ninakuni, this looks good 👍 A few things I noticed:

  • You integrate only to $t=3 M$, instead of $t=10 M$
  • Your light rays start at an initial coordinate distance $0 <= r0 <= 1 M$ from the black hole, which is why they all fall in (their coordinate distance decreases with time). Try starting the light ray outside the horizon $r0 >2 M$ :)
  • The coordinate $r$ is only defined for positive values, so you could stop the integration once $r$ becomes negative.

Hi Nils,
tried to fix that r0 > 2M but I think adapting the np.linspace(...) command isn't the right approach..

To stop integration when r becomes negative, I tried to implement if r == 0:  and so on, but that didn't really work.  Maybe you could give me another hint

Nina
@nilsvu
Copy link
Member

nilsvu commented Apr 15, 2019

Hi Nina,

  • The way you changed np.linspace looks good - see how the curves go outward to increasing $r$ when you start outside of $r0=2M$? If you choose $r0$ between 1 and 3, for example, then you'll even see some curves falling in and some going out.
  • To prevent $r$ from going negative, you could try to change the condition for the while loop like this:
    while r.successful() and r.t < 10. and r_history[-1] > 0:
        ...
    The r_history[-1] picks the last element from the list, which is the one that was just added in the previous iteration of the loop.

@nilsvu
Copy link
Member

nilsvu commented Apr 26, 2019

5/5 points. 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants