Thanks Tim and Mike! I think I will stick with SPICE then for the circuit simulation and analysis portions.<br><br>I am currently running student versions of MATLAB with Simulink and Simscape. Simulink+Simscape offers a nice size library of components to build models of circuits and such so it looked to me like it could be promising, but now I&#39;m not so sure what the benefits of using MATLAB&#39;s Simscape system simulation version SPICE or, from what I read, I&#39;m thinking it&#39;s two different tasks to tackle.<br>
<br><div class="gmail_quote">On Wed, Apr 1, 2009 at 4:01 PM, Tim Slagle <span dir="ltr">&lt;<a href="mailto:tim@slagle.org">tim@slagle.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
MATLAB is great for image processing or matrix math because it has the built-in syntax and libraries to make the source code very compact - just like writing the equations down.  It is interpreted so you pay a price in execution speed for simple loops that don&#39;t use the vector libraries.  Recent MATLAB versions have added a just-in-time compiler to make loops and such run faster, and that has boosted the speed a lot for people who write code C or FORTRAN style instead of using the vectorization.  But considering the cost of the package, unless you will take advantage of the libraries you&#39;d probably better off using C/C++ if you are already comfortable with them.<br>

<br>
MATLAB also has support for sparse matrices, although I haven&#39;t used that feature.  If you look at a circuit as a vector of nodes and the interconnections between nodes as a matrix, most of the matrix elements would be zero (no connection).  So sparse matrices can save memory in big circuits, and I think SPICE uses sparse matrix solvers internally.  But as far as I know there are no built-in or add-on packages for circuit simulation in MATLAB, at least through the MathWorks.<br>

<br>
There is also a sister package Simulink that is typically used for control theory and system simulation, and it is better for time-sequential computations.  You can model your system by drawing block diagrams and then write code for each block&#39;s functions.  And, there is a SimElectronics add-on for it.  But Simulink is even more expensive than MATLAB.  (They are independent products although I&#39;m sure you can go back and forth).<br>

<font color="#888888">--Tim<br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
----- Original Message ----<br>
&gt; From: Mike O&#39;Dell &lt;<a href="mailto:mo@ccr.org">mo@ccr.org</a>&gt;<br>
&gt; To: <a href="mailto:dorkbotdc-blabber@dorkbot.org">dorkbotdc-blabber@dorkbot.org</a><br>
&gt; Cc: HacDC Public Discussion &lt;<a href="mailto:blabber@hacdc.org">blabber@hacdc.org</a>&gt;<br>
&gt; Sent: Wednesday, April 1, 2009 2:38:34 PM<br>
&gt; Subject: Re: [dorkbotdc-blabber] MATLAB Circuit Simulation and Analysis<br>
&gt;<br>
&gt; that sure sounds more like SPICE than Matlab<br>
&gt;<br>
&gt; based on my (admittedly thin) experience, Matlab excels at<br>
&gt; jobs where closed-form analytic solutions exist, ideally in<br>
&gt; matrix form. Signal processing and control theory come to<br>
&gt; mind as natural fits. While one can formulate DC circuits<br>
&gt; in such forms, it&#39;s a lot more natural to do it in SPICE<br>
&gt; since the input form is a transliteration of the schematic.<br>
&gt;<br>
&gt; i&#39;d be interested to find out that similar facilities exist<br>
&gt; for Matlab, but in my experience, Matlab is for system<br>
&gt; dynamics (control loops) and SPICE is for circuit dynamics.<br>
&gt;<br>
&gt;      -mo<br>
&gt; ........................................................................<br>
&gt; .......dorkbot dc: people doing strange things with electricity.........<br>
&gt; ................... <a href="http://dorkbot.org/dorkbotdc" target="_blank">http://dorkbot.org/dorkbotdc</a> .......................<br>
&gt; ...................   SUBSCRIPTION MANAGEMENT    .......................<br>
&gt; ........ <a href="http://dorkbot.org/mailman/listinfo/dorkbotdc-blabber" target="_blank">http://dorkbot.org/mailman/listinfo/dorkbotdc-blabber</a> ........<br>
&gt; ........................................................................<br>
<br>
........................................................................<br>
.......dorkbot dc: people doing strange things with electricity.........<br>
................... <a href="http://dorkbot.org/dorkbotdc" target="_blank">http://dorkbot.org/dorkbotdc</a> .......................<br>
...................   SUBSCRIPTION MANAGEMENT    .......................<br>
........ <a href="http://dorkbot.org/mailman/listinfo/dorkbotdc-blabber" target="_blank">http://dorkbot.org/mailman/listinfo/dorkbotdc-blabber</a> ........<br>
........................................................................<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Andrew Q Righter<br><a href="mailto:q@theqlabs.com">q@theqlabs.com</a><br><br>Founder: The Q Labs<br>CoFounder: HacDC<br><br>