Construct circuit for nodal analysis

16 visualizaciones (últimos 30 días)
Ethar
Ethar el 6 de Nov. de 2022
Respondida: Florian Rössing el 24 de Nov. de 2022
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!

Respuestas (1)

Florian Rössing
Florian Rössing el 24 de Nov. de 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

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by