/[escript]/trunk/doc/examples/cookbook/cerjen.py
ViewVC logotype

Contents of /trunk/doc/examples/cookbook/cerjen.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5706 - (show annotations)
Mon Jun 29 03:41:36 2015 UTC (3 years, 7 months ago) by sshaw
File MIME type: text/x-python
File size: 348 byte(s)
all python files now force use of python3 prints and division syntax to stop sneaky errors appearing in py3 environs
1 from __future__ import division, print_function
2
3 import pylab as pl
4 import numpy as np
5
6 s=0
7 e=20
8 x = np.linspace(s,e,1000)
9
10 y = np.exp(-1.0*(0.005*(s-x))**2)
11
12 pl.plot(x,y)
13 pl.title("cerjen damping")
14
15
16
17 pl.savefig("cerjen.png")
18
19
20 x2= np.linspace(0,0.1,333)
21
22 y2=np.exp(-50.*x2)*np.sin(40*3.14157*x2)
23
24 pl.clf()
25 pl.plot(x2,y2)
26 pl.savefig("source.png")

  ViewVC Help
Powered by ViewVC 1.1.26