-
Notifications
You must be signed in to change notification settings - Fork 4
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 exercise #115
added exercise #115
Conversation
…t and prothero equations
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@@ -0,0 +1,227 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove references to the "Vorlesung". It implies that this exercise cannot be solved without the context of the lecture, while this should be a collection of exercises useful to everyone. What we can do later, is add a reference to a book chapter.
Reply via ReviewNB
@@ -0,0 +1,227 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The
%%file dalquist.m
is not necessary here, and may lead to not intended behavior: It tells the octave kernel to save the contents starting from the second line to a filedalquist.m
, instead of executing the commands. Since the filedalquist.m
is not used subsequently, I suggest removing this line. BTW, I think because you have%% file
instead of%%file
the line is interpreted as a normal code comment. But even then: What is the benefit of this code comment? - So far, we agreed on English code comments.
- Can you include the output of this function?
Reply via ReviewNB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I now tried to run the Notebook and it didn't work, because clearvars
is apparently not implemented in Octave, could you please make sure, that your code works with Octave?
@@ -0,0 +1,227 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can explicitly reference line 21 for the second bullet point, since this appears odd when first reading the code. Let the reader think about, why you would choose the step sizes as h_selection = [0.5 * 2/abs(lambda), 1.01 * 2/abs(lambda)];
.
Reply via ReviewNB
@@ -0,0 +1,227 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One g(t) is not in math mode. Can we ask the reader to verify that the given solution is in fact the exact solution?
Reply via ReviewNB
@@ -0,0 +1,227 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,227 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't particularly like the title "Aufgabe". It looks weird in the TOC on the right and it is a lost subsection. And there has been another Aufgabe further above.
Also, can you be more precise, as what you mean by *g(t) = 4t^2 implementieren*? You obviously don't mean ;) :
funciton y = g(t) % implement g(t) = 4*t^2, easy: y = 4*t^2;
Reply via ReviewNB
Sorry, I thought we get a nice visualization from ReviewNB here on Github. You can checkout my comments here: https://app.reviewnb.com/joergbrech/Modellbildung-und-Simulation/pull/115/ |
I looked at the comments on ReviewNB. The last commit addresses all of them. I did not find a function to directly refer changes to a comment on ReviewNB, hopefully you can trace the changes. |
Yes, no problem! I think you have to login (with Github) to NBReview to comment. |
] | ||
}, | ||
{ | ||
"cell_type": "markdown", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer, if you use the normal jupyter-notebook output for this. Otherwise, if a user wants to run the code interactively, they will have two outputs. Also, the image link seems to be dead: https://963-168147770-gh.circle-artifacts.com/0/html/07_num_ode/02_stabilitaet_eulerverfahren.html
For this it would be nice if the images were formatted nicely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't manage to create the jupyter-notebook output in the JupyterLab editor. Where can I find some instructions for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly fails? Did you follow the steps from our Contribution Guide? Specifically, click on "Initial Setup" at the beginning of the file.
You need an octave installation, jupyter-notebook and the octave_kernel (which is in our requirements.txt file). Then jupyter-notebook will run the octave kernel instead of the default python3 kernel to execute the code. All plots will be rendered in the notebook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Octave was not the issue, it was nodejs missing.
I also needed to set the graphics_toolkit to "gnuplot".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, good to know, I never encountered this problem. I wonder if we should document this somewhere? Maybe a troubleshooting section in the wiki... what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know. There actually was an according message in the console for JupyterLab, which is how I found out. "gnuplot" is also supposed to be the default graphics_toolkit, I'm not sure why it was not set as such in my kernel.
One thing which could be added is that "sudo" is a linux-specific command, so I used the Octave installation from GNU and set OCTAVE_EXECUTABLE to the correct path. The Miniconda prompt was not able to load the packages from the available channels.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Octave was not the issue, it was nodejs missing.
I also needed to set the graphics_toolkit to "gnuplot".
For future reference, the discussion about the default Octave toolkit can be found here.
"execution_count": null, | ||
"metadata": { | ||
"tags": [ | ||
"hide_input" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this code block hidden?
"Variieren Sie nun die Parameterauswahl in `lambda_selection` und `h_selection`.\n", | ||
"\n", | ||
"- Wie ändert sich die Lösung?\n", | ||
"- Warum ist `h` in Zeile 21 abhängig von `lambda` gewählt? Was passiert, wenn `h` unabhängig von `lambda` gewählt wird? Was, wenn `h` für das explizite Verfahren nur minimal kleiner als $\\frac{2}{|\\lambda|}$ ist?\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure, it's line 21 anymore. And I just realized, that the line numbers are not rendered in the html output (I saw them in NBreview), sorry. So maybe it would be best to repeat the formula for the two step sizes.
changed clearvars to clear
I still need to change the figure size for a properly visible output
Ok, we are getting there! Sorry for being naggy, but as a final thing, do you think we can beautify the graphical output? The graphs are a bit small and hard to read, and a legend would be nice. |
Yes, definitely! I'm on it once I'm done with my lectures for this week :) The trouble with the figure size is that the default output as a fig has quite a coarse resolution. But I will try to figure something out the next days. |
Resized figures Added a legend
So, I tried to do two things:
edit: When running on the built version, a box around the legend is left, I do not know why.. |
It already looks much better! The only not so nice thing is that you see the dummy plot as a red x somewhere in the legend. Here is one more thing you could try, I think it should be Octave-compatible: https://stackoverflow.com/questions/41454174/how-to-have-a-common-legend-for-subplots |
I saw this solution before, but unfortunately it does not work on Octave, neither on my local engine nor on the mybinder.org engine. The code they use an example works in MATLAB, but not on Octave, either. |
That's unfortunate...but ok. It is fine as it is! Let's not overengineer this |
Thanks for your contribution! |
Oh wait, can you merge/rebase on master? The TOC order is messed up again and I believe we need the changes from joergbrech/Modellbildung-und-Simulation@52bbd26 to fix it. I would like to see that the order is ok in this branch before merging this into master. |
We need to rebase on/merge master to make sure that this PR does not mess up the TOC order
Thanks! Looks good! |
closes #102
comparing explicit and implicit solution for dahlquist and prothero equations