-
Notifications
You must be signed in to change notification settings - Fork 156
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
Symbolically solving a system of equations… “Matrix is not square” error #1336
Comments
@n0rbed do you have a idea for this one? I guess we only support square linear subsystems because non-square could only give the L2 solution? It might be good to throw a more informative error on that. |
@ChrisRackauckas The author didnt use ERROR: DomainError with The monomial ordering is invalid.: For symbolic_linear_solve, yes you're right |
also, @linuxguy123 , fyi: |
If we input
instead of
For eq9, we get: 1-element Vector{Any}:
Dict{Num, Any}(R2 => R2, i2 => (R3*R5*Vin - R3*Requ*Vin + R4*R5*Vin - R5*Requ*Vin) / (R2*R3*Requ + R2*R4*Requ + R3*R4*Requ + R4*R5*Requ), R1 => (-R2*R3*R5 + R2*R3*Requ - R2*R4*R5 + R2*R4*Requ + R2*R5*Requ - R3*R4*R5 + R3*R4*Requ + R4*R5*Requ) / (R2*R3 + R2*R4 - R2*Requ + R3*R4 + R3*R5 - R3*Requ + R4*R5 - R5*Requ), R5 => R5, Requ => Requ, Vin => Vin, iIn => Vin / Requ, i1 => (R2*R3*Vin + R2*R4*Vin - R2*Requ*Vin + R3*R4*Vin + R3*R5*Vin - R3*Requ*Vin + R4*R5*Vin - R5*Requ*Vin) / (R2*R3*Requ + R2*R4*Requ + R3*R4*Requ + R4*R5*Requ), i4 => (R2*Requ*Vin - R3*R5*Vin + R3*Requ*Vin + R5*Requ*Vin) / (R2*R3*Requ + R2*R4*Requ + R3*R4*Requ + R4*R5*Requ), R4 => R4…) So solve_multivar suffers a bit when fractions are present. It's a bit difficult to validate this because we have some correctness issues with transendence_basis and the output solely depends on that for nonsquare systems. |
Right, non-square are supported, but with a caveat. In transcendence_basis, the heuristic choice is not correct for systems whose irreducible components have different transcendence bases Symbolics.jl/ext/SymbolicsGroebnerExt.jl Line 297 in 2bc3c54
I had plans to fix this when I had time; for now we can perhaps put a note in the docs that non-square solution is not proven. Btw, do we get 0 if we substitute the solution back in this example? |
I’m trying to find Requ(ivalent) for a circuit in terms of the 5 resistors in the circuit.
I’ve written out the equations for the circuit as follows:
I get a “DimensionMismatch: matrix is not square: dimensions are (9, 1)” error.
What am I doing wrong ?
The text was updated successfully, but these errors were encountered: