Simulate Random Resistor Networks: What Language Do I Need?

  • Thread starter RossJJ
  • Start date
  • Tags
    Language
In summary, Ross recommends using a ready-made software package like SPICE to simulate resistor networks.
  • #1
RossJJ
3
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
  • #2


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.
 
  • #3


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:
  • #4


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.
 
  • #5


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.
 
  • #6


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.
 
  • #7


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.
 

1. How do I simulate random resistor networks?

To simulate random resistor networks, you will need to use a programming language. There are many options available, including Python, Java, and C++. You will also need to have a basic understanding of circuit theory and programming concepts to effectively simulate these networks.

2. What is the purpose of simulating random resistor networks?

The purpose of simulating random resistor networks is to study the behavior and properties of these networks. This can provide insights into the behavior of complex systems and help in the design and optimization of electronic circuits.

3. Do I need a specific programming language to simulate random resistor networks?

No, there is no specific programming language that is required to simulate random resistor networks. However, certain languages may have built-in functions or libraries that make the simulation process easier. It is recommended to choose a language that you are familiar with and that has the necessary tools for the simulation.

4. Are there any pre-existing codes or programs for simulating random resistor networks?

Yes, there are many open-source codes and programs available for simulating random resistor networks. These can be found online and can be used as a starting point for your own simulations. However, it is important to understand the code and make necessary modifications for your specific needs.

5. How accurate are the results of simulating random resistor networks?

The accuracy of the results will depend on various factors, such as the complexity of the network, the precision of the simulation code, and the accuracy of the input parameters. It is important to validate the results by comparing them to theoretical calculations or experimental data.

Similar threads

Replies
4
Views
855
  • Programming and Computer Science
Replies
10
Views
2K
Replies
46
Views
6K
  • Programming and Computer Science
Replies
14
Views
4K
  • Math Proof Training and Practice
2
Replies
38
Views
9K
  • Programming and Computer Science
Replies
14
Views
3K
  • STEM Academic Advising
Replies
25
Views
2K
  • Programming and Computer Science
Replies
5
Views
3K
  • Programming and Computer Science
Replies
14
Views
3K
Back
Top