Skip to content

Commit 076b93c

Browse files
committed
plot fixes
1 parent cdf096f commit 076b93c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tutorials/advanced/03-kolmogorov_equations.jmd

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ We will define the σ and μ by comparing it to the orignal equation. The xspan
6464
d = 1
6565
r = 0.02
6666
sigma = 0.4
67-
xspan = (85.00 , 115.0)
67+
xspan = (80.00 , 115.0)
6868
tspan = (0.0 , 1.0)
6969
σ(du , u , p , t) = du .= sigma.*u
7070
μ(du , u , p , t) = du .= r.*u
@@ -98,7 +98,7 @@ And then finally call the solver
9898
Now let us find a Monte-Carlo Solution and plot the both:
9999
```julia
100100
monte_carlo_sol = []
101-
x_out = collect(85:5.00:115.00)
101+
x_out = collect(85:5.00:110.00)
102102
for x in x_out
103103
u₀= [x]
104104
g_val(du , u , p , t) = du .= 0.4.*u
@@ -124,10 +124,11 @@ if use_gpu == true
124124
m = fmap(cpu , m)
125125
end
126126
y_out = m(x_model)
127-
y_out = reshape(y_out , 7 , 1)
127+
y_out = reshape(y_out , 6 , 1)
128128
```
129129
And now finally we can plot the solutions
130130
```julia
131131
plot(x_out , y_out , lw = 3 , xaxis="Initial Stock Price", yaxis="Payoff" , label = "NNKolmogorov")
132132
plot!(x_out , monte_carlo_sol , lw = 3 , xaxis="Initial Stock Price", yaxis="Payoff" ,label = "Monte Carlo Solutions")
133+
133134
```

0 commit comments

Comments
 (0)