This wikilog article is a draft, it was not published yet.

Crash course in Scientific Computing

⇠ Back to Blog:Sandbox
m (Crash Course in Scientific Computing)
m (Crash course in Julia (programming))
 
(7 intermediate revisions by one user not shown)
Line 3: Line 3:
 
or, as officially known, [[The Wolverhampton Lectures on Physics]]: [[Wolverhampton Scientific Computing|VI — Scientific Computing]].
 
or, as officially known, [[The Wolverhampton Lectures on Physics]]: [[Wolverhampton Scientific Computing|VI — Scientific Computing]].
  
# [[WLP VI/I|Operating Systems]]
+
{{WLPVI-content}}
# [[WLP VI/II|$\TeX$ and $\LaTeX$]]
+
 
# [[WLP VI/III|Computer programming]]
+
or do you mean
# [[WLV VI/IV|Julia]]
+
 
# [[WLV VI/V|Numbers]]
+
# [[WLV VI/OS|Operating Systems]]
# [[WLV VI/VI|Random numbers]]
+
# [[WLV VI/TeX|$\TeX$ and $\LaTeX$]]
# [[WLV VI/VII|Algorithms - the idea]]
+
# [[WLV VI/CP|Computer Programming]]
# [[WLV VI/VIII|Algorithms - applications]]
+
# [[WLV VI/Julia|Julia]]
# [[WLV VI/IX|Integrals]]
+
# [[WLV VI/Plotting|Plotting]]
# [[WLV VI/X|Derivatives]]
+
# [[WLV VI/Numbers|Numbers]]
# [[WLV VI/XI|Root finding]]
+
# [[WLV VI/RandomNumbers|Random numbers]]
# [[WLV VI/XII|Better root finding]]
+
# [[WLV VI/Algo1|Algorithms–the idea]]
# [[WLV VI/XIII|Differential equations: Euler]]
+
# [[WLV VI/Algo2|Algorithms–applications]]
# [[WLV VI/XIV|Differential equations: Heun and Runge-Kutta]]
+
# [[WLV VI/Complexity|Complexity]]
# [[WLV VI/XV|Oscillators]]
+
# [[WLV VI/Integrals|Integrals]]
# [[WLV VI/XVI|Stability]]
+
# [[WLV VI/Derivatives|Derivatives]]
# [[WLV VI/XVII|Functions]]
+
# [[WLV VI/Roots|Root finding]]
# [[WLV VI/XVIII|Objects]]
+
# [[WLV VI/ODE1|ODE: Euler]]
# [[WLV VI/XIX|Librairies: the world]]
+
# [[WLV VI/ODE2|ODE: Heun & Runge-Kutta]]
# [[WLV VI/XX|Librairies: private bits]]
+
# [[WLV VI/ND|Higher Dimensions]]
# [[WLV VI/XXI|Linear algebra]]
+
# [[WLV VI/LinearAlgebra|Linear algebra]]
# [[WLV VI/XXII|DFT]]
+
# [[WLV VI/DFT|Fourier and DFT]]
# [[WLV VI/XXIII|Hyperspace]]
+
# [[WLV VI/Interpolation|Interpolation]]
# [[WLV VI/XXIV|Advanced topics]]
+
# [[WLV VI/Extrapolation|Extrapolation]]
# [[WLV VI/XXV|Fun problems]]
+
# [[WLV VI/Stability|Stability and Convergence]]
 +
# [[WLV VI/Chaos|Chaos and fractals]]
 +
# [[WLV VI/OOP|Objects]]
 +
# [[WLV VI/Lib|Librairies]]
 +
# [[WLV VI/Fun|Fun problems]]
 +
 
 +
----
 +
 
 +
= Crash course in Julia (programming) =
 +
 
 +
When plotting pure functions, you might find that the density of points (PlotPoints in [[Mathematica]]) is not enough. This can be increased by specifying the step in the range, but in this case beware not to query your functions outside of its validity range, which would work otherwise. Compare:
 +
 
 +
<syntaxhighlight lang="python">
 +
plot(x->sqrt((15/x^2)-1),0,4,linewidth=5,linealpha=.5,linecolor=:red,ylims=(0,3))
 +
plot!(x->sqrt((15/x^2)-1),0:.0001:3.8729,linewidth=2,linecolor=:blue,ylims=(0,3))
 +
</syntaxhighlight>
 +
 
 +
<center><wz tip="High sampling-density (blue) vs automatic (red) but less trouble-making plot of a function that becomes ill-defined outside of its domain.">[[File:Screenshot_12-03-2020_184242.jpg|400px]]</wz></center>
 +
 
 +
The first version can plot over the range 0–4 but does so by not plotting the full function, while the second (with x-steps of 0.0001 allowing for the nice curvature) shows everything but would return an error if going over the limit where the argument gets negative.

Latest revision as of 16:24, 8 March 2021

Crash Course in Scientific Computing

or, as officially known, The Wolverhampton Lectures on Physics: VI — Scientific Computing.

  1. Computers
  2. Operating Systems
  3. Software
  4. $\TeX$ and $\LaTeX$
  5. Computation
  6. Computer Programming
  7. Julia
  8. Plotting
  9. Numbers
  10. Random numbers
  11. Algorithms–the idea
  12. Algorithms–applications
  13. Root finding
  14. Linear Equations
  15. Interpolation and Extrapolation
  16. Fitting
  17. Integrals
  18. Derivatives
  19. Ordinary Differential Equations
  20. Differential calculus of vector fields
  21. Partial Differential Equations
  22. Finite elements and finite volumes
  23. Fourier and DFT
  24. Chaos and fractals
  25. Fun problems

or do you mean

  1. Operating Systems
  2. $\TeX$ and $\LaTeX$
  3. Computer Programming
  4. Julia
  5. Plotting
  6. Numbers
  7. Random numbers
  8. Algorithms–the idea
  9. Algorithms–applications
  10. Complexity
  11. Integrals
  12. Derivatives
  13. Root finding
  14. ODE: Euler
  15. ODE: Heun & Runge-Kutta
  16. Higher Dimensions
  17. Linear algebra
  18. Fourier and DFT
  19. Interpolation
  20. Extrapolation
  21. Stability and Convergence
  22. Chaos and fractals
  23. Objects
  24. Librairies
  25. Fun problems

Crash course in Julia (programming)

When plotting pure functions, you might find that the density of points (PlotPoints in Mathematica) is not enough. This can be increased by specifying the step in the range, but in this case beware not to query your functions outside of its validity range, which would work otherwise. Compare:

plot(x->sqrt((15/x^2)-1),0,4,linewidth=5,linealpha=.5,linecolor=:red,ylims=(0,3))
plot!(x->sqrt((15/x^2)-1),0:.0001:3.8729,linewidth=2,linecolor=:blue,ylims=(0,3))
Screenshot 12-03-2020 184242.jpg

The first version can plot over the range 0–4 but does so by not plotting the full function, while the second (with x-steps of 0.0001 allowing for the nice curvature) shows everything but would return an error if going over the limit where the argument gets negative.