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 code gives the error LoadError: Could not parse 0 of component vol. Note: `MassVolume() is given to show the working version, when trying to recreate this with @mtkmodel the error is given.
using ModelingToolkitStandardLibrary.Mechanical.Translational
using ModelingToolkitStandardLibrary.Hydraulic.IsothermalCompressible
using ModelingToolkitStandardLibrary.Blocks
mass_flow_fun(t) =cos(2π*10*t)
functionMassVolume(; name)
pars =@parametersbegin
A =0.01#m²
x₀ =1.0#m
M =10_000#kg
g =9.807#m/s²
amp =5e-2#m
f =15#Hz
p_int=M*g/A
end
vars = []
systems =@namedbegin
mass =Mass(;m=M)
vol =DynamicVolume(0; p_int, area=A, x_int=x₀, x_max=10*x₀)
mass_flow =MassFlow(;p_int)
mass_flow_input =TimeVaryingFunction(;f = mass_flow_fun)
end
eqs = [
connect(mass.flange, vol.flange)
connect(vol.port, mass_flow.port)
connect(mass_flow.dm, mass_flow_input.output)
]
returnODESystem(eqs, t, vars, pars; systems, name)
end@named odesys =MassVolume()
@mtkmodel MassVolumeMTK begin@parametersbegin
A =0.01#m²
x₀ =1.0#m
M =10_000#kg
g =9.807#m/s²
amp =5e-2#m
f =15#Hz
p_int=M*g/A
end@componentsbegin
mass =Mass(;m=M)
vol =DynamicVolume(0; p_int, area=A, x_int=x₀, x_max=10*x₀)
mass_flow =MassFlow(;p_int)
mass_flow_input =TimeVaryingFunction(;f = mass_flow_fun)
end@equationsbeginconnect(mass.flange, vol.flange)
connect(vol.port, mass_flow.port)
connect(mass_flow.dm, mass_flow_input.output)
endend
Currently using ModelingToolkit v8.75.0 with Julia v1.10.0
The text was updated successfully, but these errors were encountered:
The following code gives the error
LoadError: Could not parse 0 of component vol
. Note: `MassVolume() is given to show the working version, when trying to recreate this with @mtkmodel the error is given.Currently using ModelingToolkit v8.75.0 with Julia v1.10.0
The text was updated successfully, but these errors were encountered: