Construct circuit for nodal analysis
37 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am supposed to develop a Matlab script that can read an electric circuit description from a text file, construct the nodal matrix Y and current vector J then calculate the nodal voltage vector V and display it in the command line. The circuit is assumed to consist of resistors and independent DC current sources only. The text file is supposed to be formatted as follows: 10 1 50 2 4 2 4 3 7 1 100 4 10 The first line contains the total number of nodes in the circuit including the reference node. The nodes in the circuit will take the numbers 1, 2, … and the last node is the reference node. Subsequent lines will describe the contents of the circuit. The first number identifies the type of the element, 1 means this is a resistor while 2 is to identify a current source.The second number is the value and The last two numbers are the nodes to which the element is connected. Now I don't what commands to use to explain that to matlab!
0 commentaires
Réponses (1)
Florian Rössing
le 24 Nov 2022
Afaik, you should write a parser that reads the lines of your input file and converts the data into the format you need for calculations. But your questions seems very hard to read to me
0 commentaires
Voir également
Catégories
En savoir plus sur Circuits and Systems dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!