-
Notifications
You must be signed in to change notification settings - Fork 85
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
Documentation User defined element #36
Comments
Stephan - I'll make time to look into this, see if I can't point you in the right direction. Rgds! |
Stephan - I believe the documentation you're searching for may be found at http://ahkab.readthedocs.org/en/latest/devices.html. The "elem class" should, as best I can tell, be the "Component" class. You will need to define a subclass of "Component" and implement a small set of builtin methods. |
Many thanks, BR Stephan |
@asraelis Any luck? |
Not yet - Although I think i got a working dummy class, but I could not test it yet since the circuit.add_user_defined() method makes some problems. Tryed to make some changes but I just run into other issues, which seem to be linked with the "imp" module. At the moment i do not know if it is a issue of ahkab or of my coding skill. BR Stephan |
Great, I'll keep an eye out for your update, looking forward to helping you work through this! BR, |
Hello again, here is my short report: I have saved my classfile own_ahkab_classes.py in my actual wd and I tried to add a userdefined element with:
then python says " name 'module_name' is not defined". As mentioned above I tried to make some little changes to "circuit.py" since "module_name" is used within circuit.py (see below) but I just managed it to get other errors within the imp.py file (after importing it) on my system: Error: File "C:\Anaconda3\lib\site-packages\ahkab\circuit.py", line 995, in add_user_defined File "C:\Anaconda3\lib\imp.py", line 297, in find_module ImportError: No module named "<module 'own_ahkab_classes' from 'F:\\Python Scripts\\own_ahkab_classes.py'> File:
APPENDIX: own_ahkab_classes.py is basically a capacitor elem with little changes to test "add_user_defined()" and has no special purpose yet. It looks like this right now:
BR Stephan |
Not sure whether this is still open, but I was successful in adding my own element using the original method, e.g. below I add the element ant.ant to the circuit.
Cheers, |
Yes it is still open for me altough i found a workaround by means of ltspice. I am testing your solution at the moment hopefully figuring out how it works BR stephan |
Hey,
Great package! I am really glad that I found your package. I want to simulate nonlinear devices and their transient behaviour. Therefore, I would need two types of elements CCVS and VCVS. If I understand it correct the CCVS and VCVS are linear elements which cannot be changed (easily).
I thought that a user defined element would be perfect. Unfortunately the documentation is very little so far
" """
Adds a user defined element.
"
Could you tell me what exactly is meant by elem class? or could you give an example of a user defined element.
Thanks a lot!
BR Stephan
The text was updated successfully, but these errors were encountered: