|
From: Klaus S. <kl...@sp...> - 2022-02-08 20:08:29
|
Hi
you can define a set of boundary conditions like this
bcSet = ql.FdmBoundaryConditionSet(
[ql.FdmDirichletBoundary(mesher, 100, 0, ql.FdmBoundaryCondition.Lower),
ql.FdmDirichletBoundary(mesher, 200, 0, ql.FdmBoundaryCondition.Upper)]
)
Second parameter of the Dirichlet boundary condition is the value of the underlying, third parameter the direction of the boundary condition. For one dimensional problems this is always zero.
regards
Klaus
On Montag, 7. Februar 2022 17:24:32 CET Yev via QuantLib-users wrote:
Hi,
I have this Python code:
solver = ql.FdmBackwardSolver(
ql.FdmLinearOpCompositeProxy(op),
ql.FdmBoundaryConditionSet(),
ql.FdmStepConditionComposite(ql.DoubleVector(), ql.FdmStepConditionVector()),
ql.FdmSchemeDesc.CrankNicolson()
)
How can I specify left/write boundary conditions, let's say left=1, right = 2?
It's probably in this argument: ql.FdmBoundaryConditionSet(), but I cannot figure it out.
|