### 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 TestPowertrainTransientSpec <: AbstractTransientAnalysisSpec
  name::Symbol = :TestPowertrainTransient
  var"alg"::ODEAlg.Type = ODEAlg.Auto()
  var"start"::Float64 = 0
  var"stop"::Float64 = 50
  var"abstol"::Float64 = 0.000001
  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"model"::Union{Nothing, System} = FrictionBrakeDemo.TestPowertrain(; name=:TestPowertrain)
end

function DyadInterface.run_analysis(spec::TestPowertrainTransientSpec)
  overrides = Dict{SymbolicT, SymbolicT}()
  no_namespace_model = toggle_namespacing(spec.model, false)
  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

TestPowertrainTransient(;kwargs...) = run_analysis(TestPowertrainTransientSpec(;kwargs...))
export TestPowertrainTransient, TestPowertrainTransientSpec
