module GridMethod.Program

open FsAlg.Generic
open Plotly.NET
open Plotly.NET.TraceObjects

let explicitSchemeSolution = Algorithm.runWithExplicitScheme TaskData.taskData 15 30

Chart.Surface(
    X = explicitSchemeSolution.t_points,
    Y = explicitSchemeSolution.x_points,
    zData = (Matrix.toArrayArray explicitSchemeSolution.Solution),
    Opacity = 0.5,
    Contours = Contours.initXyz (Show = true)
)
|> Chart.withTitle "Явная схема"
|> Chart.show

let newExplicitSchemeSolution =
    Algorithm.runWithExplicitScheme TaskData.taskData 30 30

Chart.Surface(
    X = newExplicitSchemeSolution.t_points,
    Y = newExplicitSchemeSolution.x_points,
    zData = (Matrix.toArrayArray newExplicitSchemeSolution.Solution),
    Opacity = 0.5,
    Contours = Contours.initXyz (Show = true)
)
|> Chart.withTitle "Явная схема (условие устойчивости не выполняется)"
|> Chart.show


let implicitSchemeSolution = Algorithm.runWithImplicitScheme TaskData.taskData 15 30

Chart.Surface(
    X = implicitSchemeSolution.t_points,
    Y = implicitSchemeSolution.x_points,
    zData = (Matrix.toArrayArray implicitSchemeSolution.Solution),
    Opacity = 0.5,
    Contours = Contours.initXyz (Show = true)
)
|> Chart.withTitle "Неявная схема"
|> Chart.show
