Skip to content

Commit 06e31ce

Browse files
committed
more fixes
1 parent ea125ed commit 06e31ce

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

src/systems/connectors.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,7 @@ function generate_connection_equations_and_stream_connections(csets::AbstractVec
282282

283283
for cset in csets
284284
v = cset.set[1].v
285-
if hasmetadata(v, Symbolics.GetindexParent)
286-
v = getparent(v)
287-
end
285+
v = getparent(v, v)
288286
vtype = get_connection_type(v)
289287
if vtype === Stream
290288
push!(stream_connections, cset)

src/utils.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ function collect_ivs_from_nested_operator!(ivs, x, target_op)
213213
end
214214

215215
function iv_from_nested_derivative(x, op = Differential)
216-
if istree(x)
216+
if istree(x) && operation(x) == getindex
217+
iv_from_nested_derivative(arguments(x)[1], op)
218+
elseif istree(x)
217219
operation(x) isa op ? iv_from_nested_derivative(arguments(x)[1], op) : arguments(x)[1]
218220
elseif issym(x)
219221
x

test/latexify/20.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
\begin{align}
2-
\frac{du_1(t)}{dt} =& \left( - \mathrm{u_1}\left( t \right) + \mathrm{u_2}\left( t \right) \right) p_3 \\
3-
0 =& - \mathrm{u_2}\left( t \right) + \frac{1}{10} \left( - \mathrm{u_1}\left( t \right) + p_1 \right) \mathrm{u_1}\left( t \right) p_2 p_3 \\
4-
\frac{du_3(t)}{dt} =& \left( \mathrm{u_2}\left( t \right) \right)^{\frac{2}{3}} \mathrm{u_1}\left( t \right) - \mathrm{u_3}\left( t \right) p_3
2+
\mathrm{\frac{d}{d t}}\left( u(t)_1 \right) =& \left( - u(t)_1 + u(t)_2 \right) p_3 \\
3+
0 =& - u(t)_2 + \frac{1}{10} \left( - u(t)_1 + p_1 \right) p_2 p_3 u(t)_1 \\
4+
\mathrm{\frac{d}{d t}}\left( u(t)_3 \right) =& u(t)_2^{\frac{2}{3}} u(t)_1 - p_3 u(t)_3
55
\end{align}

test/latexify/30.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
\begin{align}
2-
\frac{du_1(t)}{dt} =& \left( - \mathrm{u_1}\left( t \right) + \mathrm{u_2}\left( t \right) \right) p_3 \\
3-
\frac{du_2(t)}{dt} =& - \mathrm{u_2}\left( t \right) + \frac{1}{10} \left( - \mathrm{u_1}\left( t \right) + p_1 \right) \mathrm{u_1}\left( t \right) p_2 p_3 \\
4-
\frac{du_3(t)}{dt} =& \left( \mathrm{u_2}\left( t \right) \right)^{\frac{2}{3}} \mathrm{u_1}\left( t \right) - \mathrm{u_3}\left( t \right) p_3
2+
\mathrm{\frac{d}{d t}}\left( u(t)_1 \right) =& \left( - u(t)_1 + u(t)_2 \right) p_3 \\
3+
\mathrm{\frac{d}{d t}}\left( u(t)_2 \right) =& - u(t)_2 + \frac{1}{10} \left( - u(t)_1 + p_1 \right) p_2 p_3 u(t)_1 \\
4+
\mathrm{\frac{d}{d t}}\left( u(t)_3 \right) =& u(t)_2^{\frac{2}{3}} u(t)_1 - p_3 u(t)_3
55
\end{align}

test/variable_parsing.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ D1 = Differential(t)
4545
t[1:2]
4646
s[1:4, 1:2]
4747
end
48-
@parameters σ[1:2](..)
48+
@parameters σ(..)[1:2]
4949

5050
@test all(ModelingToolkit.isparameter, collect(t))
5151
@test all(ModelingToolkit.isparameter, collect(s))

0 commit comments

Comments
 (0)