~ubuntu-branches/ubuntu/maverick/dolfin/maverick

« back to all changes in this revision

Viewing changes to demo/ode/courtemanche/cpp/plot.py

  • Committer: Bazaar Package Importer
  • Author(s): Johannes Ring
  • Date: 2008-09-16 08:41:20 UTC
  • Revision ID: james.westby@ubuntu.com-20080916084120-i8k3u6lhx3mw3py3
Tags: upstream-0.9.2
ImportĀ upstreamĀ versionĀ 0.9.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Import solution
 
2
from solution import *
 
3
 
 
4
# Import matplotlib
 
5
from pylab import *
 
6
 
 
7
 
 
8
# Plot first component of solution
 
9
subplot(211)
 
10
plot(t, u[:,0])
 
11
grid(True)
 
12
xlabel('t')
 
13
ylabel('V(t)')
 
14
title('Courtemanche')
 
15
 
 
16
# Plot time steps
 
17
subplot(212)
 
18
semilogy(t, k[:,0])
 
19
grid(True)
 
20
xlabel('t')
 
21
ylabel('k(t)')
 
22
 
 
23
# Display value at end time
 
24
print "V(T) = " + str(u[len(u) - 1, 0])
 
25
 
 
26
show()