You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following produces the error: type SCCNonlinearProblem has no field kwargs
using ModelingToolkit
using ModelingToolkit: D_nounits as D, t_nounits as t
using OrdinaryDiffEq
reg_pow(x, a, delta =0.1) =ifelse(abs(x/delta) >=1, sign(x)*abs(x/delta)^a * delta^a, (delta^a*x)/delta)
functionSystem(; name)
pars =@parametersbegin
ρ₀ =1000
β =2e9
A =0.1
m =100
L =1
p_s =100e5
p_r =10e5
C1 =1.35
C2 =1.35
c =1000
A_p =0.00094
transition=0.1end
vars =@variablesbeginp_1(t) = p_s
p_2(t) = p_r
x(t)=0dx(t)=0ddx(t), [guess=0]
rho_1(t), [guess=ρ₀]
rho_2(t), [guess=ρ₀]
drho_1(t), [guess=0]
drho_2(t), [guess=0]
m_1(t), [guess=0]
m_2(t), [guess=0]
u_1(t), [guess=0]
u_2(t), [guess=0]
end
eqs = [
D(x) ~ dx
D(dx) ~ ddx
D(m_1) ~ u_1*ρ₀*A_p
D(m_2) ~ u_2*ρ₀*A_p
# volume & mass
m_1 ~ rho_1*(L+x)*A
m_2 ~ rho_2*(L-x)*A
# density
rho_1 ~ ρ₀*(1+ p_1/β)
rho_2 ~ ρ₀*(1+ p_2/β)
# actuator force balance
m*ddx ~ (p_1 - p_2)*A - c*dx
# orifices
(p_s - p_1) ~ C1*ρ₀*reg_pow(u_1, 2) # orifice 1
(p_r - p_2) ~ C2*ρ₀*reg_pow(u_2, 2) # orifice 2
]
returnODESystem(eqs, t, vars, pars; name)
end@mtkbuild sys =System()
initprob = ModelingToolkit.InitializationProblem(sys, 0.0)
initsys =solve(initprob)
The full stacktrace is...
julia> initsys =solve(initprob)
ERROR: type SCCNonlinearProblem has no field kwargs
Stacktrace:
[1] getproperty(prob::SCCNonlinearProblem{…}, name::Symbol)
@ SciMLBase C:\Users\bradl\.julia\packages\SciMLBase\XzPx0\src\problems\nonlinear_problems.jl:519
[2] solve(::SCCNonlinearProblem{…}; sensealg::Nothing, u0::Nothing, p::Nothing, wrap::Val{…}, kwargs::@Kwargs{})
@ DiffEqBase C:\Users\bradl\.julia\packages\DiffEqBase\R2Vjs\src\solve.jl:1030
[3] solve(::SCCNonlinearProblem{Vector{…}, false, Vector{…}, Vector{…}, NonlinearFunction{…}, MTKParameters{…}})
@ DiffEqBase C:\Users\bradl\.julia\packages\DiffEqBase\R2Vjs\src\solve.jl:1028
[4] top-level scope
@ c:\Work\Packages\Issue953\initialization.jl:75
Some type information was truncated. Use `show(err)` to see complete types.
Current versions are...
(Issue953) pkg> st
Status `C:\Work\Packages\Issue953\Project.toml`
[961ee093] ModelingToolkit v9.60.0
[1dea7af3] OrdinaryDiffEq v6.90.1
The text was updated successfully, but these errors were encountered:
The following produces the error:
type SCCNonlinearProblem has no field kwargs
The full stacktrace is...
Current versions are...
The text was updated successfully, but these errors were encountered: