# Tag Archives: python

## Extracting numbers using regular expression

It took hours to understand how the regular expression works. I briefly explains the symbols in the codes. . any single character ? zero or one of the previous character + one or more of the previous character * zero … Continue reading

Posted in Python | Tagged , , , | Leave a comment

## Python code to produce print surface from the level probe data

probe_0315.dat 20.00, 60.00, -0.630 0.00, 60.00, -0.690 -20.00, 60.00, -0.830 -40.00, 40.00, -0.290 -20.00, 40.00, -0.440 0.00, 40.00, -0.600 20.00, 40.00, -0.730 40.00, 40.00, -0.820 60.00, 20.00, 0.160 40.00, 20.00, -0.050 20.00, 20.00, -0.260 0.00, 20.00, -0.460 -20.00, 20.00, -0.620 … Continue reading

Posted in Reprap 3D Printer | | Leave a comment

## ztouch – create empty files

Out of necessity I built a simple program that create many empty files. I put few examples how to use it in the code. Below command create exactly 1,000 empty files which mimic Nikon D200’s image files. The first file … Continue reading

Posted in GNU/Linux, Python | | 1 Comment

## sympy – find equations for the lines that are tagent and normal to the curve at (1, 2).

Chapter 2 Practice Exercises, p183

## sympy – changing graph color of plot()

plot() handles color names for RGB color codes. SymPy document doesn’t explain it clearly or sample codes don’t exit. Here is another example.

Posted in Python | | 1 Comment

## sympy – sawtooth function

Calculus and Analytic Geometry, George B. Thomas and Ross L. Finney Exercises 2.5 81, p163 s = 0.78540 – 0.63662*cos(2*t) – 0.07074*cos(6*t) – 0.02546*cos(10*t) – \ 0.01299*cos(14*t) plot(s, (t, -pi, pi)) dsdt = 1.27324*sin(2*t) + 0.42444*sin(6*t) + 0.2546*sin(10*t) + 0.18186*sin(14*t) … Continue reading

Posted in Python, Science and technologies | | Leave a comment

## sympy – proof of the derivative of sin(x) is cos(x)

In IPython-notebook on the web browser interface, checking value of expression is simply typing the name of expression in the following line.

Posted in GNU/Linux, Python, Science and technologies | | Leave a comment

## sympy example – finding tangent lines to a function

Chapter 2: Derivatives Exercises 2.2, p130 43. Find the tangents to Newton’s Serpentine (graphed here) at the origin and the point (1, 2). 47. a) Find an equation for the line that is tangent to the curve at point (-1, … Continue reading

Posted in Python, Science and technologies | | Leave a comment

## sympy – plot(): draw many graphs on one window.

Graph in a window that has 0 <= x <= 2. Then, on the same screen, graph for h = -1, -0.5, -0.1, 0.1, 0.5, 1.

Posted in Science and technologies | | Leave a comment