We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd6280a commit 1260f41Copy full SHA for 1260f41
src/systems/nonlinear/nonlinear_system.jl
@@ -5,10 +5,12 @@ struct NLEq
5
rhs::Expression
6
end
7
function Base.convert(::Type{NLEq}, eq::Equation)
8
- isequal(eq.lhs, Constant(0)) || throw(ArgumentError("nonzero lhs received"))
+ isequal(eq.lhs, Constant(0)) || return NLEq(eq.rhs - eq.lhs)
9
return NLEq(eq.rhs)
10
11
Base.convert(::Type{Equation}, eq::NLEq) = Equation(0, eq.rhs)
12
+Base.:(==)(a::NLEq, b::NLEq) = a.rhs == b.rhs
13
+get_args(eq::NLEq) = Expression[eq.rhs]
14
15
struct NonlinearSystem <: AbstractSystem
16
eqs::Vector{NLEq}
0 commit comments