Simulate Random Resistor Networks: What Language Do I Need?

  • Thread starter Thread starter RossJJ
  • Start date Start date
  • Tags Tags
    Language
Click For Summary
For simulating a random resistor network in the context of nanomaterials for solar cells, several programming languages and tools are recommended. While C++ and Fortran are powerful, they may not be ideal for beginners due to their complexity. Instead, existing software like SPICE, particularly ngSPICE, is suggested for circuit simulations as it is user-friendly and ready-made for such tasks. Python is highlighted as a versatile and accessible option, with numerous scientific modules available. Matlab is also recommended for its focus on scientific computing, excellent graphical capabilities, and potential free access through academic institutions. Mathematica is another option, though it is more niche and costly. Mathcad is mentioned for its user-friendly mathematical notation. Overall, utilizing established software is advised for efficiency and accuracy, especially for those with limited coding experience.
RossJJ
Messages
1
Reaction score
0
What Langauge do I need??

Hi All,

I'm an experimental physicist working on nanomaterials for solar cells. I am looking at silver nanowires for transparent conductive electrodes.

I'm looking to simulate a random resistor network utilising some data on resistivities I will be measuring using a nano 4 point probe.

Basically first I want to simulate a number of random networks, then if I remember my 2nd year EM course correctly (it was some time ago!) I can use kirchhoffs laws to solve them.

I have a general idea of how this will work using a few basic coding skills I picked up from codeacademy. But I have never written any code/done any simulations before so was wandering what language do I want to use to try and do this. My initial assumptions would be C++ or Fortran.

Any direction in this would be great.

Thanks.

Ross
 
Physics news on Phys.org


If you just want to simulate a resistor network, I don't think you should go to a basic coding language like C or Fortran. You should use existing software designed to simulate circuits, like SPICE. There are free versions of SPICE, like ngSPICE, available online.
 


C++ is a very powerful language but has a steep learning curve. I would not recommend C++ as a first language. If you insist on a compiled language, I recommend starting with C or Fortran.

There are other options. Three come to the top of my head:
  • Python.
    Python is a free, general purpose, and highly extensible scripting language with lots and lots of various specialized modules. The syntax is fairly easy to learn. It's free, as are the modules. Python itself isn't aimed at scientific computing, but there are modules galore that are.
  • Matlab.
    Matlab is a proprietary scripting language aimed specifically at scientific computing. The syntax is once again fairly easy to learn. Matlab has a very nice graphical user interface (GUI). Help is immediately available, and the plots are absolutely fantastic. Matlab has one huge downside: It's not free. It is so very, very far from free. However, being an experimental physicist, you almost certainly have free access to it through your research institute or employer. Ask your sys admin, or ask around via email. One of your coworkers will be more than happy to give a demo.
  • Mathematica.
    Mathematica is a proprietary scripting language aimed specifically at mathematical computing. The syntax is a perhaps a bit bizarre, but it makes sense once you learn it. It, too, has a very nice GUI and it, too, makes absolutely fantastic plots and graphs. Mathematica has the same downside as Matlab: It too is a rather expensive product (but not quite so bad as Matlab). It's also a bit more of a niche product than is Matlab, so you may or may not already have access to it. Once again, ask around.
 
Last edited:


For first programming projects Matlab is excellent in my experience. The help-function is easy to use, it tells you what you're doing wrong, and there are many good tutorials available.
 


Matlab is the most reasonable choice, given likely academic availability.

Mathcad is an alternative that may be available. It has reasonable 2D and 3D graphing capability but offers the major advantage of being largely WYSIWYG as far as mathematical notation goes, making many investigations self-documenting - think of it as a smart mathematical whiteboard. ... caveat: stick to Mathcad 15 until they sort Mathcad Prime out.
 


Hey RossJJ and welcome to the forums.

I would echo phyzguys advice on using something like a SPICE package: the stuff is ready made and ready to use, and if you want to see source code then get an open source project and dig through it.

Also if you have no coding experience, then be aware that if you just need this to get relevant results for your electrical networks, using something that again is ready made, in use already, and ready to use is a much better option.

Also things that are mature in development are usually already developed in an optimum way to get things done quickly where those things are common problems faced in that field, so they will have designed the program and its interface to aid solving problems in an efficient way and learning that interface is going to be much better (and will help you understand the field as well) than trying to create everything from scratch.
 


chiro said:
Also things that are mature in development are usually already developed in an optimum way to get things done quickly where those things are common problems faced in that field, so they will have designed the program and its interface to aid solving problems in an efficient way and learning that interface is going to be much better (and will help you understand the field as well) than trying to create everything from scratch.
Even more importantly, things that are mature in development give the right answer. They have been tested umpteen ways to Sunday. Those commercial packages are accurate, stable, and fast.
 

Similar threads

Replies
4
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 106 ·
4
Replies
106
Views
15K
  • · Replies 12 ·
Replies
12
Views
2K
Replies
46
Views
10K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 38 ·
2
Replies
38
Views
10K