-
-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning: Internal error #2920
Labels
bug
Something isn't working
Comments
It should be eqs = reduce(vcat, Symbolics.scalarize.(eqs)); |
Thanks for suggesting this workaround. But it does not help: # Example two: Falling mass, attached to linear spring
using ModelingToolkit, OrdinaryDiffEq, LinearAlgebra
using ModelingToolkit: t_nounits as t, D_nounits as D
G_EARTH::Vector{Float64} = [0.0, 0.0, -9.81] # gravitational acceleration [m/s²]
L0::Float64 = -10.0 # initial spring length [m]
# defing the model, Z component upwards
@parameters mass=1.0 c_spring=50.0 damping=0.5 l0=L0
@variables pos(t)[1:3] = [0.0, 0.0, L0]
@variables vel(t)[1:3] = [0.0, 0.0, 0.0]
@variables acc(t)[1:3] = G_EARTH
@variables unit_vector(t)[1:3] = [0.0, 0.0, -sign(L0)]
@variables spring_force(t)[1:3] = [0.0, 0.0, 0.0]
@variables spring_vel(t) = 0.0
eqs = vcat(D(pos) ~ vel,
D(vel) ~ acc,
unit_vector ~ -pos/norm(pos), # direction from point mass to origin
spring_vel ~ -unit_vector ⋅ vel,
spring_force ~ (c_spring * (norm(pos) - abs(l0)) + damping * spring_vel) * unit_vector,
acc ~ G_EARTH + spring_force/mass)
eqs = reduce(vcat, Symbolics.scalarize.(eqs))
@named sys = ODESystem(eqs, t)
simple_sys = structural_simplify(sys)
nothing Running this script gives even more error messages than before:
I am now using ModelingToolkit v9.30.1. Can you please re-open this issue? |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug 🐞
ModelingToolkit v9.28.0 prints a lot of warnings (Internal error) for a script that was running fine with older versions of ModelingToolkit.
Expected behavior
No warning for the code that worked before.
Minimal Reproducible Example 👇
Error & Stacktrace⚠️
Environment (please complete the following information):
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()
Additional context
The simulation result still looks correct.
The text was updated successfully, but these errors were encountered: