summaryrefslogtreecommitdiff
path: root/3648/CH17/EX17.10/Ex17_10.sce
blob: 17a4b7dc78a9575fc1de8b602227ce0f3ef27a1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//Example 17_10
clc();
clear;
//To find the current in battery
r1=3  //Units in Ohms
r2=6    //Units in Ohms
ra=(r1*r2)/(r1+r2) //Units in Ohms
r3=2         //Units in Ohms
r4=4     //Units in Ohms
rb=r3+r4        //Units in Ohms
r5=6           //Units in Ohms
rc=(r5*rb)/(r5+rb)    //Units in Ohms
r6=9            //Units in Ohms
r=r6+rc           //Units in Ohms
v=6               //Units in V
i=v/r                //Units in Ohms
printf("The current in battery is I=%.2f A",i)