### DO NOT EDIT THIS FILE
### This file is auto-generated by the Dyad command-line compiler.
### If you edit this code it is likely to get overwritten.
### Instead, update the Dyad source code and regenerate this file


using DyadInterface
using DyadInterface: ODEAlg, DEVerbosity, OptimizationLevel
using ModelingToolkit: SymbolicT, toggle_namespacing
using DyadInterface: AbstractTransientAnalysisSpec, TransientAnalysisSpec
@kwdef mutable struct BrakeThermalAnalysis_ConstantSpec <: AbstractTransientAnalysisSpec
  name::Symbol = :BrakeThermalAnalysis_Constant
  var"alg"::ODEAlg.Type = ODEAlg.Auto()
  var"start"::Float64 = 0
  var"stop"::Float64 = 1800
  var"abstol"::Float64 = 1e-8
  var"reltol"::Float64 = 0.000001
  var"saveat"::Float64 = 0
  var"dtmax"::Float64 = 0
  var"tstops"::Array{Float64, 1} = []
  var"automatic_discontinuity_detection"::Bool = false
  var"optimize"::OptimizationLevel.Type = OptimizationLevel.None()
  var"progress"::Bool = true
  var"respecialize"::Bool = false
  var"verbose"::DEVerbosity.Type = DEVerbosity.Standard()
  var"log_file"::String = ""
  var"Q_disk"::Float64 = 9300
  var"Q_pad"::Float64 = 700
  var"vehicle_speed"::Float64 = 25
  var"wheel_speed"::Float64 = 83
  var"model"::Union{Nothing, System} = FrictionBrakeDemo.BrakeThermalTest_Constant(; name=:BrakeThermalTest_Constant)
end

function DyadInterface.run_analysis(spec::BrakeThermalAnalysis_ConstantSpec)
  overrides = Dict{SymbolicT, SymbolicT}()
  no_namespace_model = toggle_namespacing(spec.model, false)
  push!(overrides, no_namespace_model.Q_disk => spec.var"Q_disk")
  push!(overrides, no_namespace_model.Q_pad => spec.var"Q_pad")
  push!(overrides, no_namespace_model.vehicle_speed => spec.var"vehicle_speed")
  push!(overrides, no_namespace_model.wheel_speed => spec.var"wheel_speed")
  base_spec = TransientAnalysisSpec(;
    name=:TransientAnalysis, overrides, alg=spec.alg, start=spec.start, stop=spec.stop, abstol=spec.abstol, reltol=spec.reltol, saveat=spec.saveat, dtmax=spec.dtmax, tstops=spec.tstops, automatic_discontinuity_detection=spec.automatic_discontinuity_detection, optimize=spec.optimize, progress=spec.progress, respecialize=spec.respecialize, verbose=spec.verbose, log_file=spec.log_file, model=spec.model
  )
  run_analysis(base_spec)
end

BrakeThermalAnalysis_Constant(;kwargs...) = run_analysis(BrakeThermalAnalysis_ConstantSpec(;kwargs...))
export BrakeThermalAnalysis_Constant, BrakeThermalAnalysis_ConstantSpec
