README.do.txt 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. ======= Pysketcher =======
  2. Tool for defining sketches of physics problems in terms of Python code.
  3. ===== Purpose =====
  4. Pysketcher can typically be used to draw figures like
  5. FIGURE: [doc/src/tut/fig-tut/wheel_on_inclined_plane, width=600 frac=0.6]
  6. Such figures can easily be *interactively* made using a lot of drawing programs.
  7. A Pysketcher figure, however, is defined in terms of computer code. This gives
  8. a great advantage: geometric features can be parameterized in term
  9. of variables, as here:
  10. FIGURE: [doc/src/tut/fig-tut/vehicle0_dim, width=600 frac=0.6]
  11. One can then quickly change parameters, here to
  12. `R=0.5; L=5; H=2` and `R=2; L=7; H=1`, and get new figures that would be
  13. tedious to draw manually in an interactive tool.
  14. FIGURE: [doc/src/tut/fig-tut/vehicle_v23, width=800]
  15. Another major feature of Pysketcher is the ability to let animate the
  16. sketch. Here is an example of a very simple vehicle on a bumpy road,
  17. where the solution of a differential equation (upper blue line) is fed
  18. back to the sketch to make a vertical displacement of the spring and
  19. other objects in the vehicle, "view animation": "http://hplgit.github.io/bumpy/doc/src/mov-bumpy/m2_k1_5_b0_2/index.html" (the animation was created by
  20. "this Pysketcher script": "https://github.com/hplgit/bumpy/blob/master/doc/src/fig-bumpy/bumpy_road_fig.py").
  21. FIGURE: [http://hplgit.github.io/bumpy/doc/src/mov-bumpy/m2_k1_5_b0_2/tmp_frame_0030.png, width=600]
  22. ===== Tutorial =====
  23. For an introduction to Pysketcher, see the tutorial in "HTML": "http://hplgit.github.io/pysketcher/doc/pub/pysketcher.html", "Sphinx": "http://hplgit.github.io/pysketcher/doc/pub/html/index.html", or "PDF": "http://hplgit/github.io/pysketcher/doc/pub/pysketcher.pdf" format (or a simplified version of
  24. the tutorial in Chapter 9 in "A Primer on Scientific Programming with Python": "http://www.amazon.com/Scientific-Programming-Computational-Science-Engineering/dp/3642549586/ref=sr_1_2?s=books&ie=UTF8&qid=1407225588&sr=1-2&keywords=langtangen", by H. P. Langtangen, Springer, 2014).
  25. ===== Examples =====
  26. See the `examples` directory for some examples.
  27. For example, a pendulum and its body diagram,
  28. FIGURE: [examples/pendulum2, width=800 frac=1]
  29. can be created by the "`examples/pendulum.py`": "https://github.com/hplgit/pysketcher/tree/master/examples/pendulum.py".
  30. ===== Citation =====
  31. If you use Pysketcher and want to cite it, you can either cite this
  32. web site or the book
  33. that has the original documentation of the tool.
  34. BibTeX format:
  35. !bc
  36. @book{Langtangen_2014,
  37. title = {A Primer on Scientific Programming With {P}ython},
  38. author = {H. P. Langtangen},
  39. year = {2014},
  40. publisher = {Springer},
  41. edition = {Fourth},
  42. }
  43. @misc{Pysketcher,
  44. title = {{P}ysketcher: {D}rawing tool for making sketches},
  45. author = {H. P. Langtangen},
  46. url = {https://github.com/hplgit/pysketcher},
  47. key = {Pysketcher},
  48. note = {\url{https://github.com/hplgit/pysketcher}},
  49. }
  50. !ec
  51. Publish format:
  52. !bc
  53. * books
  54. ** A Primer on Scientific Programming With {P}ython
  55. key: Langtangen_2014
  56. author: H. P. Langtangen
  57. year: 2014
  58. publisher: Springer
  59. status: published
  60. edition: Fourth
  61. entrytype: book
  62. * misc
  63. ** {P}ysketcher: {D}rawing tool for making sketches
  64. key: Pysketcher
  65. author: H. P. Langtangen
  66. url: https://github.com/hplgit/pysketcher
  67. status: published
  68. sortkey: Pysketcher
  69. note: \url{https://github.com/hplgit/pysketcher}
  70. !ec
  71. ===== History =====
  72. Pysketcher was first constructed as a powerful educational example on
  73. object-oriented programming for the book
  74. *A Primer on Scientific Programming With Python*, but the tool quickly
  75. became so useful for the author that it was further developed and
  76. heavily used for creating figures in other books by the author.