module GridMethod.TaskData

open System
open GridMethod.TaskModel

// General form
// Equation: -p(x) * y(x)'' + q(x) * y(x)' + r(x) * y(x) = f(x)
// Initial conditions:
// α_1 * y(a) - α_2 * y'(a) = α
// β_1 * y(b) + β_2 * y'(b) = β

// Option 5 from method_part_2_2 (Pakulina's manual)
let p x = (/) 1.0 (x + 3.0)

let q x = -1.0 * x

let r x = x |> (+) 2.0 |> Math.Log

let f x = 1.0 - x / 2.0

let equationData = { p = p; q = q; r = r; f = f }

let initialData =
    { a = -1.0
      b = 1.0
      α_1 = 0.0
      α_2 = -1.0
      α = 0.0
      β_1 = 0.5
      β_2 = 1.0
      β = 0.0 }

let taskData: Task =
    { Equation = equationData
      InitialConditions = initialData }
