I have been trying out mathematica 10 features, but sadly unable to use NDSolve for even simple PDE's. I am still wrestling with the problem of boundary conditions. The solution I get in the interpolating function doesn't have proper values specified in the boundary conditions. For example if I specify
<< NDSolve`FEM`
DirichletCondition[V[S, t] == 10.0, (S >= 110 && t == 1.0)]
And if i check the boundary condition V[110,1.0] it doesn't give 10.0 as the result. The values don't make sense.
Here's my original problem
soln = NDSolveValue[
{D[V[S, t], t] + r*S*D[V[S, t], S] + 0.5 sigma^2 S^2 D[V[S,t], {S,2}] - r V[S,t] == 0,
DirichletCondition[V[S, t] == 20.0, (S >= 110 && t == 2.0)],
DirichletCondition[V[S, t] == 10.0, (S >= 110 && t == 1.0)],
DirichletCondition[V[S, t] == -Max[80 - S, 0], (S <= 80 && t == 2.0)],
DirichletCondition[V[S, t] == 0.0, (S > 80 && S < 110 && t == 2.0)]},
V, {S, t} ∈ mesh];
autocall[130, 1.0]
(* 15.3241 *)
which doesn't make any sense!
The condition stated preciely that at t = 1.0 make the value 10.0 for S greater than or equal to 110.0.
I am using the following mesh
ω = ImplicitRegion[True, {{S, 0, 200}, {t, 0, 2.0}}];
mesh = ToElementMesh[ω, MaxCellMeasure -> 0.005 , "MeshOrder" -> 2];
Strangest part is mathematica doesn't give any errors and now I think problem is with the interpolating function which is not satisfying the boundary conditions.
Any clues on how to solve this simple PDE? Have given up partially on this tool after trying various other options...maybe NDSolveValue is not built for such problems.
sigma
? When I run your code I get the error "The PDE coefficient {{-1. S+r S,1.}} does not evaluate to a numeric matrix of dimensions {1,2}." $\endgroup$