blob: 0e69e173fa2c3b85a2881a33a9af5a9eba2ad5e3 (
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
|
//Example 21.4
emf=12;//Emf of battery (V)
r=0.1;//Internal resistance (ohm)
R_load=10;//Load resistance (ohm)
I=emf/(R_load+r);//Current (A)
V=emf-I*r;//Terminal voltage (V)
printf('a.Terminal voltage = %0.1f V',V)
R_load=0.5;//Load resistance (ohm)
I=emf/(R_load+r);//Current (A)
V=emf-I*r;//Terminal voltage (V)
printf('\nb.Terminal voltage = %0.1f V',V)
P_load=I^2*R_load;//Power dissipated (W)
printf('\nc.Power dissipated by the load = %0.2e W',P_load)
r=0.5;//Internal resistance (ohm)
I=emf/(R_load+r);//Current (A)
printf('\nd.Current = %0.1f A',I)
V=emf-I*r;//Terminal voltage (V)
printf('\n Terminal voltage = %0.2f V',V)
P_load=I^2*R_load;//Power dissipated (W)
printf('\n Power dissipated by the load = %0.1f W',P_load)
//Openstax - College Physics
//Download for free at http://cnx.org/content/col11406/latest
|