blob: d614bbc3fa14a32fb1f165bd3c28c7637c6e0215 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
clc
// Fundamental of Electric Circuit
// Charles K. Alexander and Matthew N.O Sadiku
// Mc Graw Hill of New York
// 5th Edition
// Part 1 : DC Circuits
// Chapter 2: Basic Laws
// Example 2 - 5
clear; clc; close;
//
// Given data
v = 20.00;
R1 = 2.00;
R2 = 3.00;
//
// Calculations Current
i = v/(R1 + R2);
// Calculations Voltage (v1)
v1 = i * R1;
// Calculations Voltage (v2)
v2 = i * R2;
//
// Display the result
disp("Example 2-5 Solution : ");
printf(" \n i : Current = %.3f A ", i);
printf(" \n v1 : Voltage = %.3f Volt",v1);
printf(" \n v2 : Voltage = %.3f Volt",v2);
|