In [1]:
x=1
y=2
x*y
Out[1]:
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]:
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]:
In [12]:
visualize_relperm(relperm)
Out[12]:
In [25]:
"""
function f(;x=1, y=3)
"""
function f(;x=1, y=3)
return sin(x)*cos(y)
end
Out[25]:
In [26]:
?f
Out[26]:
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]:
In [13]:
res["note"]
Out[13]: