Skip to content
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

singular matrix with voltage contribution #135

Open
gjcoram opened this issue Jul 5, 2024 · 5 comments
Open

singular matrix with voltage contribution #135

gjcoram opened this issue Jul 5, 2024 · 5 comments

Comments

@gjcoram
Copy link

gjcoram commented Jul 5, 2024

When I have a voltage branch contribution that connects implicitly to ground:
V(a) <+ dc;
OpenVAF does not properly construct the circuit matrix, such that I get a singular matrix error from ngspice.

If I change this to
V(a,b) <+ dc;
and connect 'b' to ground in the netlist, it works fine.

@gjcoram
Copy link
Author

gjcoram commented Jul 5, 2024

v_contrib.zip
v_contrib.zip contains:
v_contrib_1.va v_contrib_1.sp -- shows singular matrix
v_contrib_2.va v_contrib_2.sp -- analysis runs properly

@gjcoram
Copy link
Author

gjcoram commented Jul 5, 2024

I'm still new at Rust, but I am curious about the function below, where 3 of the 5 cases have "cursor.ins()". Case 1, we're adding 0 to something (I think "dst" is "destination"), and we don't need anything there. But in case 3, (F_ZERO, _) when negate is false, should there be a cursor.ins()? Without it, the variable that's used for KCL in the matrix stamp is dropped (it does not seem to be marked as being used, and thus is not in the "live_params" in sim_unknown_reads that are considered when building the jacobian.

pub fn add(cursor: &mut FuncCursor, dst: &mut Value, val: Value, negate: bool) {
match (*dst, val) {
(_, F_ZERO) => (),
(F_ZERO, _) if negate => *dst = cursor.ins().fneg(val),
(F_ZERO, _) => *dst = val,
(old, _) if negate => *dst = cursor.ins().fsub(old, val),
(old, _) => *dst = cursor.ins().fadd(old, val),
}
}

gjcoram added a commit to gjcoram/OpenVAF that referenced this issue Jul 5, 2024
@georgtree
Copy link

Hello, I also faced with this issue, and the only solution is to add explicit ground reference everywhere.

@gjcoram
Copy link
Author

gjcoram commented Jul 9, 2024

Hello, I also faced with this issue, and the only solution is to add explicit ground reference everywhere.

The commit I made solves the issue.

@georgtree
Copy link

georgtree commented Jul 9, 2024

I will check it out, thank you.

arpadbuermen pushed a commit to arpadbuermen/OpenVAF that referenced this issue Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants