C++ Code Simulating Circuit Components?

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

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.
Last edited by djomni on Fri Jun 08, 2012 6:54 am, edited 1 time in total.

Post

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. :-}

Post

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

Post

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.

Post

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.

Post

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.

Post

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.
Last edited by djomni on Fri Jun 08, 2012 4:39 am, edited 1 time in total.

Post

Incidentally, I really wish they'd figure out that 0 and 1 aren't the only two numbers. haha

Post


Post


Post

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?

Post

Meffy wrote:My understanding is that CPU power is the limiting factor.
CPU power isn't a limiting factor for circuit simulation. Unless something terrible happens, I'll be able to prove it soon enough.

Post

I use simulink because I have it, I'm familiar with it, and I know how to make it do whatever I want.

Post

mystran wrote:I think "code for individual components" is a fundamentally flawed concept
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.

Post

Well, here's some useful insights into circuit simulation; it should probably get you started: http://qucs.sourceforge.net/tech/technical.html

Post Reply

Return to “DSP and Plugin Development”