C++ Code Simulating Circuit Components?
-
- KVRist
- 48 posts since 5 Jul, 2011
I was just wondering if anyone knows of a source to get bits of code that would, for example, simulate a capacitor or resistor? If not, could anyone recommend some reading material on this subject?
And allow me to include a few conditions: I am only interested in comments and materials relating to circuit SIMULATION. I may not an electrical or software engineer, but I am a mechanical engineer. I have taken linear algebra, differential equations, as well as circuits, and electrical physics.
And allow me to include a few conditions: I am only interested in comments and materials relating to circuit SIMULATION. I may not an electrical or software engineer, but I am a mechanical engineer. I have taken linear algebra, differential equations, as well as circuits, and electrical physics.
Last edited by djomni on Fri Jun 08, 2012 6:54 am, edited 1 time in total.
-
- Skunk Mod
- 21249 posts since 10 Jun, 2004 from Pony Pasture
Disclaimer: This isn't exactly what you want, but might help.
The cool kids use SPICE.
http://en.wikipedia.org/wiki/SPICE <--(this kind)
Other circuit emulators exist. See the link at the bottom of that Wikipedia page for more. I don't know about the translation from SPICE to code, but bet there are people here who are very familiar with it.
Or you could learn some basic electronic engineering and write your own lib. :-}
The cool kids use SPICE.
http://en.wikipedia.org/wiki/SPICE <--(this kind)
Other circuit emulators exist. See the link at the bottom of that Wikipedia page for more. I don't know about the translation from SPICE to code, but bet there are people here who are very familiar with it.
Or you could learn some basic electronic engineering and write your own lib. :-}
-
- KVRist
- Topic Starter
- 48 posts since 5 Jul, 2011
This may potentially be helpful, but will it output code for the individual components? I'm building custom blocks for simulink models, so I do need code.
Nevermind. You beat me to it. I appreciate it
Nevermind. You beat me to it. I appreciate it
-
- Skunk Mod
- 21249 posts since 10 Jun, 2004 from Pony Pasture
I've reached the limit of my knowledge of this. (Wow, that wasn't far, was it?) I'd love to dig into circuit emulation software, but every time I think there'll be time something else comes up. I'll keep an eye on the thread because I'd like to know more too. Glad you asked.
-
- KVRist
- Topic Starter
- 48 posts since 5 Jul, 2011
Oh, definitely. If I can find a resource for this, I'll be able to make hardware emulator plugins in no-time flat with nothing but a circuit diagram. It will be beautiful.
-
- Skunk Mod
- 21249 posts since 10 Jun, 2004 from Pony Pasture
Might be more to it than that, or they'd be all over the place. :-} My understanding is that CPU power is the limiting factor. That changes every year though, so last February's discussion could be obsolete today. I'll be interested in seeing what people who use this kind of software have to say. I'll shut up now and wait for them.
-
- KVRist
- Topic Starter
- 48 posts since 5 Jul, 2011
I used to do it in college all the time. But, the EE computer lab had endless custom blocks. The models are not hard to export to pretty much any language you'd like. I haven't yet attempted to integrate one of these code models into the steinberg architecture yet, but at worst it's just a little ratio mapping.
The reason they aren't all over the place is that the individual license for matlab/simulink cost me about $2000.
The reason they aren't all over the place is that the individual license for matlab/simulink cost me about $2000.
Last edited by djomni on Fri Jun 08, 2012 4:39 am, edited 1 time in total.
-
- KVRist
- Topic Starter
- 48 posts since 5 Jul, 2011
This is pimp: http://www.mathworks.com/matlabcentral/ ... -interface
-
- KVRist
- Topic Starter
- 48 posts since 5 Jul, 2011
On the same note: http://www.mathworks.com/matlabcentral/ ... ice3import
- KVRAF
- 8476 posts since 12 Feb, 2006 from Helsinki, Finland
I think "code for individual components" is a fundamentally flawed concept; there are much better ways to do it. Sorry for not being more helpful this time, but I'd like to ask: why do you want to use Simulink in the first place? Is that just because it'll generate you the complete code?
- KVRAF
- 8476 posts since 12 Feb, 2006 from Helsinki, Finland
CPU power isn't a limiting factor for circuit simulation. Unless something terrible happens, I'll be able to prove it soon enough.Meffy wrote:My understanding is that CPU power is the limiting factor.
-
- KVRist
- Topic Starter
- 48 posts since 5 Jul, 2011
How is this a flawed concept? The way I see it having these blocks allow for the creation of hardware emulation systems in a way that accurately represents the original product allowing for a more accurate emulation. What other methods are you referring to? Maybe a software engineer would find a different method easier, but as a mechanical engineer, I find HUGE strings of code a little tiresome.mystran wrote:I think "code for individual components" is a fundamentally flawed concept
- KVRAF
- 8476 posts since 12 Feb, 2006 from Helsinki, Finland
Well, here's some useful insights into circuit simulation; it should probably get you started: http://qucs.sourceforge.net/tech/technical.html
