
### 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 ModelingToolkit
import Markdown
import Moshi
using ModelingToolkit: t_nounits as t
using OrdinaryDiffEqDefault
using RuntimeGeneratedFunctions
RuntimeGeneratedFunctions.init(@__MODULE__)

if isfile(joinpath((@__DIR__) |> Base.dirname, "dyad", "definitions.jl"))
  include(joinpath((@__DIR__) |> Base.dirname, "dyad", "definitions.jl"))
end

import RotationalComponents
import ThermalComponents
import BlockComponents
import TranslationalComponents
import DyadInterface
@doc Markdown.doc"""
This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively.
"""
@connector function __Dyad__Pin(; name=nothing)
  isnothing(name) && throw(ArgumentError("""
        The `name` keyword must be provided. Please consider using the `@named` macro,
        like so:

        @named model = Pin()
        """))
  __params = Symbolics.SymbolicT[]
  __vars = @variables begin
    (v(t)::Real), []
    (i(t)::Real), [connect = Flow]
  end
  __metadata = Dict{DataType, Any}(
  )
  return System(Equation[], t, __vars, __params; name, metadata = __metadata)
end
@doc Markdown.doc"""
This connector represents a thermal node with temperature and heat flow as the potential and flow variables, respectively.
"""
@connector function __Dyad__HeatPort(; name=nothing)
  isnothing(name) && throw(ArgumentError("""
        The `name` keyword must be provided. Please consider using the `@named` macro,
        like so:

        @named model = HeatPort()
        """))
  __params = Symbolics.SymbolicT[]
  __vars = @variables begin
    (T(t)::Real), []
    (Q_flow(t)::Real), [connect = Flow]
  end
  __metadata = Dict{DataType, Any}(
  )
  return System(Equation[], t, __vars, __params; name, metadata = __metadata)
end
@doc Markdown.doc"""
This connector represents a mechanical flange with position and force as the potential and flow variables, respectively.
"""
@connector function __Dyad__Flange(; name=nothing)
  isnothing(name) && throw(ArgumentError("""
        The `name` keyword must be provided. Please consider using the `@named` macro,
        like so:

        @named model = Flange()
        """))
  __params = Symbolics.SymbolicT[]
  __vars = @variables begin
    (s(t)::Real), []
    (f(t)::Real), [connect = Flow]
  end
  __metadata = Dict{DataType, Any}(
  )
  return System(Equation[], t, __vars, __params; name, metadata = __metadata)
end
@doc Markdown.doc"""
This connector represents a rotational spline with angle and torque as the potential and flow variables, respectively.
"""
@connector function __Dyad__Spline(; name=nothing)
  isnothing(name) && throw(ArgumentError("""
        The `name` keyword must be provided. Please consider using the `@named` macro,
        like so:

        @named model = Spline()
        """))
  __params = Symbolics.SymbolicT[]
  __vars = @variables begin
    (phi(t)::Real), []
    (tau(t)::Real), [connect = Flow]
  end
  __metadata = Dict{DataType, Any}(
  )
  return System(Equation[], t, __vars, __params; name, metadata = __metadata)
end
@doc Markdown.doc"""
Coordinate system (2-dim.) fixed to the component with one cut-force and cut-torque.
All variables are resolved in the planar world frame.
"""
@connector function __Dyad__Frame2D(; name=nothing)
  isnothing(name) && throw(ArgumentError("""
        The `name` keyword must be provided. Please consider using the `@named` macro,
        like so:

        @named model = Frame2D()
        """))
  __params = Symbolics.SymbolicT[]
  __vars = @variables begin
    (x(t)::Real), []
    (y(t)::Real), []
    (phi(t)::Real), []
    (fx(t)::Real), [connect = Flow]
    (fy(t)::Real), [connect = Flow]
    (tau(t)::Real), [connect = Flow]
  end
  __metadata = Dict{DataType, Any}(
  )
  return System(Equation[], t, __vars, __params; name, metadata = __metadata)
end
@doc Markdown.doc"""
Frame3D is the fundamental 3D connector used for 6DOF motion. Most components have one or several `Frame`
connectors that can be connected together
"""
@connector function __Dyad__Frame3D(; name=nothing)
  isnothing(name) && throw(ArgumentError("""
        The `name` keyword must be provided. Please consider using the `@named` macro,
        like so:

        @named model = Frame3D()
        """))
  __params = Symbolics.SymbolicT[]
  __vars = @variables begin
    (r_0(t)[1:3]::Real), [description = "The position vector from the world frame to the frame origin, resolved in the world frame"]
    (R(t)[1:3,1:3]::Real), [description = "This is the Rotation matrix used to represent orientation"]
    (f(t)[1:3]::Real), [description = "The cut force resolved in the connector frame", connect = Flow]
    (tau(t)[1:3]::Real), [description = "The cut torque resolved in the connector frame", connect = Flow]
  end
  __metadata = Dict{DataType, Any}(
ModelingToolkit.FrameOrientation => ModelingToolkit.RotationMatrix(collect(unwrap(R))::Matrix{Symbolics.SymbolicT}, ModelingToolkit.get_w(unwrap(R), t)),
ModelingToolkit.IsFrame => true,
  )
  return System(Equation[], t, __vars, __params; name, metadata = __metadata)
end

include("BrakeThermalAnalysis_Constant_definition.jl")
include("BrakeThermalAnalysis_Step_definition.jl")
include("BrakeThermalTest_Constant_definition.jl")
include("BrakeThermalTest_Step_definition.jl")
include("BrakeThermal_definition.jl")
include("Driver_definition.jl")
include("FrictionBrakeTestAnalysis_definition.jl")
include("FrictionBrakeTest_definition.jl")
include("FrictionBrake_definition.jl")
include("SimplePowertrain_definition.jl")
include("SimpleVehicleTestAnalysis_CoastDown_definition.jl")
include("SimpleVehicleTestAnalysis_Constant_definition.jl")
include("SimpleVehicleTest_CoastDown_definition.jl")
include("SimpleVehicleTest_Constant_definition.jl")
include("SimpleVehicle_definition.jl")
include("TestDriverAnalysis_Braking_definition.jl")
include("TestDriverAnalysis_Constant_definition.jl")
include("TestDriverWithBraking_definition.jl")
include("TestDriver_Constant_definition.jl")
include("TestPowertrainTransient_definition.jl")
include("TestPowertrain_definition.jl")
include("VehicleCycleAnalysis_definition.jl")
include("VehicleCycleTest_definition.jl")