We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Using the clipping opamp model in a circuit description throws a MethodError when calling the method DiscreteModel.
circ=@circuit begin j_in=voltagesource() R1=resistor(10e3) R2=resistor(100e3) A=opamp(Val{:macak}, 1000, -4, 4) #A=opamp() j_out=voltageprobe() j_in[+]==R1[1] R1[2]==R2[1]==A["in-"] R2[2]==A["out+"]==j_out[+] A["in+"]==A["out-"]==j_in[-]==j_out[-] end model=DiscreteModel(circ, 1/fs)
The error is: LoadError: MethodError: no method matching dcat(::Float64, ::StaticArrays.SArray{Tuple{0,0},Float64,2,0})
The text was updated successfully, but these errors were encountered:
I think the fix is simple:
--- a/src/elements.jl +++ b/src/elements.jl @@ -527,6 +527,7 @@ Pins: `in+` and `in-` for input, `out+` and `out-` for output vi_scaled = vi * (gain/scale) res = @SVector [tanh(vi_scaled) * scale - vo] J = @SMatrix [gain / cosh(vi_scaled)^2 -1.0] + return (res, J) end return Element(mv=[0 0; 1 0; 0 1], mi=[1 0; 0 0; 0 0], mq=[0 0; -1 0; 0 -1], u0=[0; 0; offset],
But the fact that this has gone unnoticed for so long indicates that this is also missing test coverage...
Sorry, something went wrong.
Fix clipping opamp nonlinear function
opamp
d398207
Somehow this was missing the `return` which rendered it unusable... Fixes #35.
Fix clipping opamp nonlinear function (#36)
9988f6a
Successfully merging a pull request may close this issue.
Using the clipping opamp model in a circuit description throws a MethodError when calling the method DiscreteModel.
The error is:
LoadError: MethodError: no method matching dcat(::Float64, ::StaticArrays.SArray{Tuple{0,0},Float64,2,0})
The text was updated successfully, but these errors were encountered: