Tilte

Text blah blah $y = \sin(x)$


In [1]:
x=1
y=2
x*y


Out[1]:
2

In [4]:
using PyPlot

In [10]:
x = collect(linspace(0, 10, 100))
y = sin.(x)
z = cos.(x)
plot(x, y, "--r", x, z, ":g")
xlabel("x axis")
ylabel("y axis")
title("sin and cos plots")
grid()
text(6.0, 1.0, "annotation")
savefig("sincos.eps")



In [2]:
struct Relperm
    krw0
    kro0
    swc
    sor
    nw
    no
end

relperm = Relperm(0.9, 0.3, 0.15, 0.2, 2.0, 2.0)


Out[2]:
Relperm(0.9, 0.3, 0.15, 0.2, 2.0, 2.0)

In [11]:
function visualize_relperm(k::Relperm)
    sw = linspace(k.swc, 1-k.sor, 100)
    krw = k.krw0*((sw-k.swc)/(1-k.swc-k.sor)).^k.nw
    plot(sw, krw)
    xlabel("Sw")
    ylabel("krw")
end


Out[11]:
visualize_relperm (generic function with 1 method)

In [12]:
visualize_relperm(relperm)


Out[12]:
PyObject Text(24,0.5,'krw')

In [25]:
"""
function f(;x=1, y=3)
"""
function f(;x=1, y=3)
    return sin(x)*cos(y)
end


Out[25]:
f

In [26]:
?f


search: fd for fma fld fft full fld1 find filt fill fft! fdio flag frexp foldr

Out[26]:

function f(;x=1, y=3)


In [2]:
import JLD

In [11]:
t = collect(1:0.1:10)
M = zeros(length(t), 15)
for i in 1:15
    v = sin.(t.^(i/10))
    M[:,i]=v[:]
end
s = "this is only a test"
JLD.save("test_jld.jld", "t", t, "M", M, "note", s)

In [12]:
res = JLD.load("test_jld.jld")
plot(res["t"], res["M"])


Out[12]:
15-element Array{PyCall.PyObject,1}:
 PyObject <matplotlib.lines.Line2D object at 0x7fc27a810150>
 PyObject <matplotlib.lines.Line2D object at 0x7fc27a810210>
 PyObject <matplotlib.lines.Line2D object at 0x7fc27a8102d0>
 PyObject <matplotlib.lines.Line2D object at 0x7fc27a810390>
 PyObject <matplotlib.lines.Line2D object at 0x7fc27a810450>
 PyObject <matplotlib.lines.Line2D object at 0x7fc27a810510>
 PyObject <matplotlib.lines.Line2D object at 0x7fc27a8105d0>
 PyObject <matplotlib.lines.Line2D object at 0x7fc27a810690>
 PyObject <matplotlib.lines.Line2D object at 0x7fc27a810750>
 PyObject <matplotlib.lines.Line2D object at 0x7fc27a810810>
 PyObject <matplotlib.lines.Line2D object at 0x7fc27a8108d0>
 PyObject <matplotlib.lines.Line2D object at 0x7fc27a810990>
 PyObject <matplotlib.lines.Line2D object at 0x7fc27a810a50>
 PyObject <matplotlib.lines.Line2D object at 0x7fc27a810b10>
 PyObject <matplotlib.lines.Line2D object at 0x7fc27a810bd0>

In [13]:
res["note"]


Out[13]:
"this is only a test"