Construct circuit for nodal analysis

조회 수: 28 (최근 30일)
Ethar
Ethar 2022년 11월 6일
답변: Florian Rössing 2022년 11월 24일
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!

답변 (1개)

Florian Rössing
Florian Rössing 2022년 11월 24일
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

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by