home *** CD-ROM | disk | FTP | other *** search
-
-
- Program DC_Circuits2;
-
- Var Xlow,Yhi,Vlen,Hlen,I : Integer; (* Box locator and lengths.*)
- Xpos,Ypos : Integer; (* Locate circit diagrams. *)
- Low,High,Nres : Integer; (* Circuit choice. *)
- V,A,R,W : Real; (* Circuit totals. *)
- V1,A1,R1,W1 : Real;
- V2,A2,R2,W2 : Real;
- V3,A3,R3,W3 : Real;
- Zh,Ch : Char;
- Serflag,Parflag,Spflag : Boolean;
- Ccontrol : File;
- Label Mainlab;
- {========================================================================}
-
- Procedure Key; Begin
- Gotoxy(27,25); Write(' Press any key ');
- Repeat until Keypressed;
- Gotoxy(26,25); Write(' ');
- end; (* Procedure Key.*)
-
- {========================================================================}
-
- Procedure MainControl; forward;
- Procedure Node; Begin
-
- Gotoxy(22,25);Write('Press `M` for Menu, `Q` to Quit.');
-
- Repeat
- Read(Kbd,ch);
- ch:=UpCase(ch);
- until (Ch in ['M','Q']);
- Gotoxy(14,25);Write(' ');
-
- If (Ch='M') then MainControl;
- If (Ch='Q') then begin
- Textmode(2); Halt;
- end;
- end; (* Procedure Node. *)
-
- {========================================================================}
- Procedure ShortCircuit;
- Var I : Integer;
- Begin ClrScr;
-
- TextMode(0);
- For I:= 1 to 6 do begin
- Gotoxy(12,12);
- Write('Short Circuit!');
- Delay(100);
- ClrScr;
- Delay(100);
- end;
- Textmode(2);
- end;
- {-----------------------------------------------------------------------}
-
- (* Box drawing procedure. Define by upper left corner and
- lengths of horizontal and vertical lines. Xlow,Yhi
- and lengths input just before Boxes call.
- *)
- Procedure Boxes; (* Upper left corner x,y and side *)
- (* lengths come from calling program. *)
-
- Var Hl, Vl, Ur, Ul, Ll, Lr : Char; (* Lines and Corners. *)
-
- Begin
-
- Hl:=Char(196); Vl:=Char(179);
- Ur:=Char(191); Ul:=Char(218); Ll:=Char(192); Lr:=Char(217);
-
- Gotoxy(Xlow, Yhi); Write(Ul); (* Position upper left corner. *)
- For I:=1 to Hlen do begin (* Write top line and corners. *)
- Write(Hl);
- end;
- Write(Ur);
-
- Xlow:=Xlow+Hlen+1; (* X is same for vertical. *)
- For I:=1 to Vlen do begin (* Write R vertical and corner.*)
- Yhi:=Yhi+1;
- Gotoxy(Xlow, Yhi);
- Write(Vl);
- end;
- Gotoxy(Xlow, Yhi+1); Write(Lr);
-
- Yhi:=Yhi+1;
- For I:=1 to Hlen do begin (* Y same for horizontal.*)
- Xlow:=Xlow-1;
- Gotoxy(Xlow, Yhi);
- Write(Hl);
- end;
- Gotoxy(Xlow-1, Yhi); Write(Ll);
-
- Xlow:=Xlow-1; (* X same for vertical. *)
- For I:=1 to Vlen do begin
- Yhi:=Yhi-1;
- Gotoxy(Xlow, Yhi);
- Write(Vl);
- end;
- end; (* Procedure Boxes. *)
- {---------------------------------------------------------------------}
-
- Procedure SerDraw; (* Draws diagram for Series Circuit. *)
-
- Var Hline : Char;
-
- Begin
- Hline:=Char(196);
- Gotoxy(Xpos,Ypos);
-
- For I:=1 to 17 do begin
- Write(Hline);
- end;
-
- Gotoxy(Xpos-2, Ypos); Write('V+');
- Gotoxy(Xpos+2, Ypos); Write('R1');
- Gotoxy(Xpos+7, Ypos); Write('R2');
- Gotoxy(Xpos+12,Ypos); Write('R3');
- Gotoxy(xPos+16,Ypos); Write('-' );
- End; (* SerDraw *)
- {-------------------------------------------------------------------}
-
- Procedure ParDraw; (* Draws diagram for Parallel Circuit. *)
-
- Var Hline : Char;
-
- Begin
-
- Xlow:= Xpos+4; Yhi:=Ypos-2; (* Box corner position. *)
- Vlen:=3; Hlen:=6; (* Side lengths (globals). *)
-
- Boxes; (* Call Boxes. *)
-
- Hline:=Char(196);
-
- Gotoxy(Xpos,Ypos);
- Write('V+');
- For I:=1 to 12 do begin
- Write(Hline);
- end;
- Write('-');
-
- Gotoxy(Xpos+ 4, Ypos); Write(char(197));
- Gotoxy(Xpos+11, Ypos); Write(char(197));
-
- Gotoxy(Xpos+7, Ypos-2); Write('R1');
- Gotoxy(Xpos+7, Ypos ); Write('R2');
- Gotoxy(Xpos+7, Ypos+2); Write('R3');
- End; (* ParDraw. *)
- {-----------------------------------------------------------------}
-
- Procedure SPDraw; (* Draws Series-Parallel diagram. *)
-
- Var Hline : Char;
-
- Begin
- Hline:=Char(196);
- Gotoxy(Xpos,Ypos);
- Write('V+');
- For I:=1 to 6 do begin
- Write(Hline);
- end;
- Write(char(180));
-
- Gotoxy(Xpos+15,Ypos);
- Write(char(195));
- For I:=1 to 2 do begin
- Write(Hline);
- end;
- Write('-');
- Xlow:=Xpos+8; Yhi:=Ypos-2;
- Vlen:=3; Hlen:=6;
- Boxes; (* Call Boxes. *)
-
- Gotoxy(Xpos+11, Ypos-2); Write('R2');
- Gotoxy(Xpos+ 4, Ypos ); Write('R1');
- Gotoxy(Xpos+11, Ypos+2); Write('R3');
- End; (* SPDraw *)
- {-------------------------------------------------------------------}
-
- Procedure TableBod;
- begin
-
- Gotoxy(25,6);
- Writeln(' Flow is Amps V = AR ');
- Writeln(' ~~~~~~~~~~~~ ~~~~~~ ');
- Writeln('----------|---------|--------|--------|--------| ');
- Writeln(' | Total | R1 | R2 | R3 | ');
- Writeln('==========|=========|========|========|========| ');
- Writeln('Resistors | | | | | ');
- Writeln(' Amps | | | | | ');
- Writeln(' Volts | | | | | ');
- Writeln('----------|---------|--------|--------|--------| ');
- Writeln(' Watts | | | | | ');
- Writeln('------------------------------------------------ ');
- end;
- {---------------------------------------------------------------}
-
- Procedure ResRead; (* Input Resistors and Volts. *)
- Begin (* SEE PAGE 94 of Zwass. *)
-
- (* Different for each circuit! *)
- If (Spflag=false) then Read(Nres);
- If (Spflag=true) then Nres:=3;
-
- If (Serflag=true) and (Nres<=0) then Nres:=1;
- If (Serflag=true) and (Nres>3) then Nres:=3;
-
- If (Parflag=True) and (Nres<2) then Nres:=2;
- If (Parflag=True) and (Nres>3) then Nres:=3;
-
- Gotoxy(52,11); Write('Ohms of R1 is: '); Read(R1);
- Gotoxy(22,11); Write(R1:6:0);
- R:=R1;
- If Nres >=2 then begin
- Gotoxy(52,12); Write('Ohms of R2 is: '); Read(R2);
- Gotoxy(31,11); Write(R2:6:0);
- R:=R+R2;
- end;
- If Nres=3 then begin
- Gotoxy(52,13); Write('Ohms of R3 is: '); Read(R3);
- Gotoxy(40,11); Write(R3:6:0);
- R:=R+R3;
- end;
- Gotoxy(51,15); Write('Circuit volts is: '); Read(V);
- Gotoxy(14,13); Write(V:5:2);
- Gotoxy(13,11); If Serflag=true then Write(R:6:0);
- end; (* ResRead *)
- {----------------------------------------------------------------}
-
- Procedure SerMath;
- Begin
-
- Writeln(' Series Circuits (Volts sum). ');
- Writeln(' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ');
- Writeln(' Total Resistance : R = R1 + R2 + R3. ');
- Writeln(' Total Amps : A = V/R. ');
- Writeln(' Volts drops : V1 = AR1 [AR2, AR3]. ');
- Writeln(' Watts : W = A',#253,'R. ');
- end;
- {--------------------------------------------------------}
-
- Procedure Parmath;
- Begin
- Writeln(' PARALLEL CIRCUITS (Amps sum). ');
- Writeln(' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ');
- Writeln(' Total Resistance: Rt = 1/(1/R1+1/R2+1/R3)');
- Writeln(' Total Amps : A = V/R. ');
- Writeln(' Amps for each R: A1 = V/R1 [V/R2, V/R3]');
- Writeln(' Watts : W = A',#253,'R. ');
- end;
- {-----------------------------------------------------------------}
-
- Procedure SPmath;
- Begin
-
- Writeln(' SERIES-PARALLEL ');
- Writeln(' ~~~~~~~~~~~~~~~ ');
- Writeln(' * Equivalent Res.: Rp = R2xR3/(R2 + R3). ');
- Writeln(' Total Resistance : R = R1 + Rp. ');
- Writeln(' Total Amps : A = V/R. ');
- Writeln(' R1 volts drop : V1 = AR1. ');
- Writeln(' Parallel`s Amps : A2 = (V-V1)/R2 [(V-V1)/R3]');
- Writeln(' Watts : W = A',#253,'R. ');
- end;
- {---------------------------------------------------------------}
-
- Procedure Series; (* All math variables global. *)
-
- Begin
- Clrscr; Ch:='Z'; Serflag:=true;
- Parflag:=false; Spflag:=false;
-
- Gotoxy(27,2); Write('SERIES CIRCUIT');
-
- Xpos:=6; Ypos:=4; Serdraw;
-
- Tablebod;
- Gotoxy(1,18); SerMath;
- Xlow:=2; Yhi:=17;
- Vlen:=6; Hlen:=42; Boxes; (* Around SerMath. *)
-
- Gotoxy(51,9); Write('How many Resistors? ');
- ResRead; (* Read resistors and volts. *)
-
- If R=0 then ShortCircuit;
- If R=0 then Series;
-
- A:=V/R; (* Compute body of table. *)
- Gotoxy(14,12); Write(A:6:3);
- W:=A*A*R;
- Gotoxy(14,15); Write(W:6:2);
- If Nres>=2 then begin
- Gotoxy(23,12); Write(A:6:3);
- Gotoxy(32,12); Write(A:6:3);
- V1:=A*R1;
- V2:=A*R2;
- Gotoxy(24,13); Write(V1:5:2);
- Gotoxy(33,13); Write(V2:5:2);
- W1:=A*A*R1;
- W2:=A*A*R2;
- Gotoxy(23,15); Write(W1:6:2);
- Gotoxy(32,15); Write(W2:6:2);
- end;
-
- If Nres=3 then begin
- V3:=A*R3;
- W3:=A*A*R3;
- Gotoxy(41,12); Write(A:6:3);
- Gotoxy(42,13); Write(V3:5:2);
- Gotoxy(41,15); Write(W3:6:2);
- end;
- end; (* Series*)
- {---------------------------------------------------------------}
-
- Procedure Parallel;
- Begin
- Clrscr; Ch:='Z'; Parflag:=true;
- Serflag:=false; Spflag:=false;
-
- Gotoxy(27,2); Write('PARALLEL CIRCUIT');
-
- Xpos:=6; Ypos:=4; Pardraw; (* Call procedures.*)
- Tablebod;
- Gotoxy(1,18); ParMath;
- Xlow:=1; Yhi:=17;
- Vlen:=6; Hlen:=44; Boxes;
-
- Gotoxy(51,8);
- Write('Choose 2 or 3 R`s! ');
- Resread;
- Gotoxy(23,13); Write(V:5:2); (* Write volts in all cells. *)
- Gotoxy(32,13); Write(V:5:2);
- If Nres=3 then begin
- Gotoxy(41,13); Write(V:5:2);
- end;
-
- If (Nres=2) and ((R1=0) or (R2=0)) then begin (* Short Circuit!. *)
- ShortCircuit;
- Parallel;
- end;
- If (Nres=3) and ((R1=0) or (R2=0) or (R3=0)) then begin
- ShortCircuit;
- Parallel;
- end;
-
- R:=1/R1+1/R2; (* Compute and write total R. *)
-
- If Nres=3 then begin
- R:=R+1/R3;
- end;
- R:=1/R;
-
- Gotoxy(12,11); Write(R:7:1);
-
- A:=V/R; (* Compute and write A`s. *)
- If R1>0 then A1:=V/R1;
- If R2>0 then A2:=V/R2;
-
- If (Nres=3) and (R3>0) then A3:=V/R3;
-
- Gotoxy(13,12); Write(A:7:3);
- Gotoxy(23,12); Write(A1:6:3);
- Gotoxy(32,12); Write(A2:6:3);
- If Nres=3 then begin
- Gotoxy(41,12); Write(A3:6:3);
- end;
-
- W:=A*A*R; W1:=A1*A1*R1; W2:=A2*A2*R2; (* Compute & write watts.*)
- If Nres=3 then W3:=A3*A3*R3;
-
- Gotoxy(13,15); Write(W:7:2);
- Gotoxy(23,15); Write(W1:6:2);
- Gotoxy(32,15); Write(W2:6:2);
- If Nres=3 then begin
- Gotoxy(41,15); Write(W3:6:2);
- end;
-
- end; (* Parallel *)
- {---------------------------------------------------------------}
-
- Procedure SerPar;
-
- Var Re,Vp : Real;
- Begin
- Clrscr; Ch:='Z'; Spflag:=true;
- Serflag:=false; Parflag:=false;
-
- Gotoxy(28,2); Write('SERIES-PARALLEL');
-
- Xpos:=3; Ypos:=4; Spdraw;
- Tablebod;
- Gotoxy(1,17); Spmath;
- Xlow:=1; Yhi:=16;
- Vlen:=7; Hlen:=46; Boxes;
- Gotoxy(51,8);
- Write('Enter values for 3 R`s:');
- Resread;
- If (R1=0) and ((R2=0) or (R3=0)) then
- begin
- ShortCircuit;
- SerPar;
- end;
-
- If (R2+R3)<>0 then Re:=R2*R3/(R2+R3); (* Total resistance.*)
- R :=R1+Re;
- Gotoxy(12,11); Write(R:7:1);
-
- A:=V/R; V1:=A*R1; (* Amps and volts. *)
- Vp:=V-V1;
-
- If R2<>0 then A2:=Vp/R2;
- If R3<>0 then A3:=Vp/R3;
-
- Gotoxy(13,12); Write(A:7:3);
- Gotoxy(23,12); Write(A:6:3);
- Gotoxy(32,12); Write(A2:6:3);
- Gotoxy(41,12); Write(A3:6:3);
-
- Gotoxy(23,13); Write(V1:6:2);
- Gotoxy(32,13); Write(Vp:6:2);
- Gotoxy(41,13); Write(Vp:6:2);
-
- W:=A*A*R; (* Watts. *)
- If R1<>0 then W1:= A*A*R1 else W1:=0;
- If R2<>0 then W2:=A2*A2*R2 else W2:=0;
- If R3<>0 then W3:=A3*A3*R3 else W3:=0;
-
- Gotoxy(13,15); Write(W:7:2);
- Gotoxy(23,15); Write(W1:6:2);
- Gotoxy(32,15); Write(W2:6:2);
- Gotoxy(41,15); Write(W3:6:2);
-
-
- end; (* SerPar *)
- {---------------------------------------------------------------}
-
- Procedure AllMath; (* Puts all math computing on screen. *)
- Begin
- ClrScr; Ch:='Z';
-
- Gotoxy(1,2); Sermath;
- Xlow:=1; Yhi:=1;
- Vlen:=5; Hlen:=44; Boxes;
-
- Gotoxy(1,9); Parmath;
- Xlow:=1; Yhi:=8;
- Vlen:=6; Hlen:=44; Boxes;
-
- Gotoxy(1,17); Spmath;
- Xlow:=1; Yhi:=16;
- Vlen:=8; Hlen:=46; Boxes;
-
- Gotoxy(51,19); Write('Press key for choice.');
- Gotoxy(52,22); Write('`M` Back to Menu.');
- Gotoxy(52,23); Write('`Q` Quit.');
-
- Repeat
- Read(Kbd,ch);
- ch:=UpCase(ch);
- until (Ch IN ['M','Q']);
-
- If Ch='M' then MainControl;
- If Ch='Q' then Halt;
-
- end; (* AllMath *)
-
- {===================================================================}
- { Procedure Maincontrol; Forward; }
- Procedure MathExplain;
- Begin
- Clrscr;
- Gotoxy(1,5);
- Writeln(' The Mathematics of Flow in Circuits. ');
- Writeln(' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ');
- Writeln(' Electronics is about electron-flow in circuits or `loops.` ');
- Writeln(' We discussed Ohm`s law in the program Ohm1. It is a math ');
- Writeln(' expression to relate the 3 parts of flow: ');
- Writeln(' Volts (pressure), Ohms (resistance), and Amps (amount). ');
- Key;Gotoxy(1,12);
- Writeln(' Flow rates (amps per second) are enormously different in var- ');
- Writeln(' ious sitations. Tiny trickles of current occur in some. In ');
- Writeln(' others, huge quantities flow. We saw that one math express- ');
- Writeln(' ion, a linear equation, describes many situations. ');
- Key;Gotoxy(1,17);
- Writeln(' For most applications, however, we have just one `flow pattern.`');
- Writeln(' We design the pattern (circuit) to provide the proper pressure ');
- Writeln(' and current where we want it. With good design, the circuit ');
- Writeln(' does something useful. That`s what design is about! ');
- Key;Gotoxy(1,25); For I:=1 to 5 do writeln;
- Gotoxy(1,17);
- Writeln(' To understand circuits, we must look at them from two view- ');
- Writeln(' points: First, the circuit a whole, and Second, its various ');
- Writeln(' parts. Ohm`s law describes flow everywhere, so it applies to ');
- Writeln(' the whole circuit and its parts. The pressure and current ');
- Writeln(' that gets to each resistor depends on the design. There are ');
- Writeln(' 2 basic configurations. We consider details next. ');
- Writeln(' -------------------------------------------------- ');
-
- Key;Clrscr;
-
- Xpos:=9; Ypos:=6; Serdraw;
- Xpos:=30; Ypos:=6; Pardraw;
- Xpos:=50; Ypos:=6; SPdraw;
- Xlow:=3; Yhi:=3;
- Vlen:=7; Hlen:=69; Boxes;
- Gotoxy(13,10);Write('SERIES PARALLEL BOTH');
- Gotoxy(20,1);Write('Overview of Flow and Mathematics.');
- Gotoxy(20,2);Write('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
- {-------------------------------------------------------}
- Gotoxy(1,13);
- Writeln(' Our 3 basic circuits again. Study them as you ponder these facts. ');
- Key;Gotoxy(1,13);
- Writeln(' Power is needed to push electrons, so start with the power source. ');
- Key;Gotoxy(1,15);
- Writeln(' All current leaving the power source returns to it, like water ');
- Writeln(' pumped in a closed pipe loop. ');
- Key;Gotoxy(1,18);
- Writeln(' The current is in one loop (series), or it`s divided (parallel). ');
- Key;Gotoxy(1,20);
- Writeln(' Our math arises from these facts, and it`s simple. Most circuits ');
- Writeln(' are intricate, however, so careful attention to the symbols for ');
- Writeln(' circuit parts is essential. But never forget FLOW! ');
- Writeln(' --------------------------------------------------- ');
- Key;Clrscr;
- Xpos:=12; Ypos:=6; Serdraw;
- Xlow:=6; Yhi:=3;
- Vlen:=7; Hlen:=66; Boxes;
- Gotoxy(16,9);Write('SERIES');
- Gotoxy(26,3); Write('* Series Circuits Math *');
- Gotoxy(34,5); Write(' V = AR or A = V/R. Flow anywhere.');
- Gotoxy(34,6); Write(' ~~~~~~ ~~~~~~~~ ');
- Key;
-
- Gotoxy(1,13);
- Writeln(' First, a reminder about mathematics. ');
- Key; Gotoxy(1,13);
- Writeln(' A math equation, like A = B, is a statement that A and B ');
- Writeln(' have the same value. Thus we may freely substitute either ');
- Writeln(' for the other. ');
- Writeln;
- Writeln(' In addition, to BOTH SIDES of an equation we may add, sub- ');
- Writeln(' ract, multiply, or divide by the same quantity. This fact ');
- Writeln(' is the heart of manipulating equations. Since we treat ');
- Writeln(' both sides the same, they remain equal in value. ');
- Writeln;
- Writeln(' The above are used to put Ohm`s law in different forms. ');
- Writeln(' Different forms are useful for various situations. ');
- Writeln(' -------------------------------------------------- ');
- Key;
- Gotoxy(38,7); Write('1. V = A(R1 + R2)');
- Gotoxy(38,8); Write('2. V = AR1 + AR2');
- Gotoxy(38,9); Write('3. V = V1 + V2 [Volts drops.]');
- Key; Gotoxy(1,22);
- Writeln(' Study the above until the `why` of the math is clear. ');
- Writeln(' In parallel flow coming next, the math is different. ');
- {---------------------------------------------------------------}
- Key;Clrscr;
-
- Xpos:=12; Ypos:=6; Pardraw;
- Xlow:=8; Yhi:=3;
- Vlen:=7; Hlen:=64; Boxes;
- Gotoxy(16,10);Write('PARALLEL');
- Gotoxy(28,3); Write('* Parallel Circuits Math *');
- Gotoxy(34,5); Write(' V = AR or A = V/R. Flow anywhere.');
- Gotoxy(34,6); Write(' ~~~~~~ ~~~~~~~~ ');
-
- Key;Gotoxy(1,13);
- Writeln(' Before looking at the parallel circuit math, remember this ');
- Writeln(' from series circuits: Each resistor reduces volts along ');
- Writeln(' the circuit loop, so the total is their sum. ');
- Writeln;
- Writeln(' In parallel flow, the current is separated into branches. ');
- Writeln(' The total is therefore the sum of the branch currents. Our ');
- Writeln(' math starts with this fact. Here it is. ');
- Key;Gotoxy(1,21);
- Gotoxy(36,7); Write('1. A = A1 + A2 ');
- Gotoxy(36,8); Write('2. V/R = V/R1 + V/R2');
- Gotoxy(36,9); Write('3. 1/R = 1/R1 + 1/R2');
- Key;Gotoxy(1,21);
- Writeln(' What happened to our resistors? Now they are fractions! ');
- Writeln(' And their sum is the reciprocal of the total circuit res- ');
- Writeln(' istance. We discuss why this is so. ');
- Key;Gotoxy(1,13); For I:= 1 to 11 do
- Writeln(' ');
- Gotoxy(1,13);
- Writeln(' Resistors reduce flow and pressure. But we could call them ');
- Writeln(' conductors, since they conduct current. `Adjustors` might ');
- Writeln(' be a better word, because we use them to adjust flow. ');
- Writeln;
- Writeln(' Each parallel branch is somewhat like a separate circuit. ');
- Writeln(' Current flows through each. So every branch added to the ');
- Writeln(' circuit increases total flow. Our homes are wired for ');
- Writeln(' parallel use. Plug in a light, another parallel circuit. ');
- Writeln;
- Writeln(' So each resistor added in parallel increases flow, and thus ');
- Writeln(' decreases TOTAL circuit resistance. That`s the fact. ');
-
- {---------------------------------------------------------------}
- Key;Clrscr;
-
- Xpos:=12; Ypos:=6; Spdraw;
- Xlow:=8; Yhi:=3;
- Vlen:=7; Hlen:=64; Boxes;
- Gotoxy(16,10);Write('SERIES-PARALLEL');
- Gotoxy(30,3); Write('* Series-Parallel Math *');
- Gotoxy(34,5); Write(' V = AR or A = V/R. Flow anywhere.');
- Gotoxy(34,6); Write(' ~~~~~~ ~~~~~~~~ ');
-
- Gotoxy(34,7);Write(' 1. Find equivalent resistance for the ');
- Gotoxy(34,8);Write(' parallel part. ');
- Gotoxy(34,9);Write(' 2. Compute volts drops (now series). ');
- Gotoxy(34,10);Write(' 3. Volts now known for parallel part. ');
-
- Key; Gotoxy(1,13);
- Writeln(' As summarized above, computing is just successively using ');
- Writeln(' the things already developed. First compute the `equiva- ');
- Writeln(' lent resistance` of the parallel part. ');
- Writeln;
- Writeln(' Put it in the circuit in place of the parallel part. We ');
- Writeln(' now have a series circuit and can compute the volts drops ');
- Writeln(' across each resistor. ');
- Writeln;
- Writeln(' The volts drop across the parallel part is the volts avail- ');
- Writeln(' able in all parts of the parallel part. Hand compute a few ');
- Writeln(' circuits, and this will be clear. ');
- Writeln(' --------------------------------- ');
- Node;
-
- end; (* Procedure MathExplain. *)
- {---------------------------------------------------------------}
- Procedure TailEnd; Forward;
- Procedure Hardware;
- Begin Clrscr;
- Gotoxy(1,1);
- Writeln(' Hardware Demonstrations of Electronics. ');
- Writeln(' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ');
- Writeln(' Home demonstrations of flow in circuits can be done with a ');
- Writeln(' modest amount of equipment. To start, a multimeter, batt- ');
- Writeln(' ery, and a few resistors are the only essentials. All are ');
- Writeln(' easy to find. For further details about equipment, see any ');
- Writeln(' books on basic electronics. ');
- Writeln;
- Writeln(' Emphasized here is how to approach designing your own experi- ');
- Writeln(' ments. You won`t find this discussed in books. In addition, ');
- Writeln(' the few demonstrations given in books range from poor to lou- ');
- Writeln(' sy. Worse is that mostly they are meant to be done in `elec- ');
- Writeln(' tronics laboratories.` Make the best of them that you can. ');
- Writeln;
- Writeln(' But you have an advantage over the authors of present books. ');
- Writeln(' The advantage is this computer, and these programs. The comp- ');
- Writeln(' uter routines will allow you to `design and perform` endless ');
- Writeln(' experiments. Just select the circuit type wanted, and input ');
- Writeln(' your values. The computer does the rest. Up to a point. ');
- Writeln;
- Writeln(' You can`t learn anything in science unless you do much hands- ');
- Writeln(' on demonstrating yourself. That`s why science laboratories ');
- Writeln(' are included in formal training too. Theory and practice are ');
- Writeln(' both essential. Now for specific suggestions. ');
- Key;Clrscr;
-
- Writeln(' Start `doing experiments` with computer simulations. Use ');
- Writeln(' small numbers so that it is easy to see what`s happening. ');
- Writeln(' For instance, start with 1 resistor. Add another of the ');
- Writeln(' same value in series, then in parallel; then use a third. ');
- Writeln;
- Writeln(' Get a notebook and write down results of your studies, in- ');
- Writeln(' cluding questions and problems encountered. Review your ');
- Writeln(' notebook from time to time. Find others with whom to dis- ');
- Writeln(' cuss electronics and experiments. ');
- Writeln;
- Writeln(' Computer simulations of experiments will suggest many cir- ');
- Writeln(' cuits for testing with hardware. Do it! With hardware, ');
- Writeln(' however, you will encounter many things hardly mentioned ');
- Writeln(' in books. Here are some of them. ');
- Writeln;
- Writeln(' Different kinds of batteries have different voltages, even ');
- Writeln(' for the same cell size. The more load you put on a battery ');
- Writeln(' the more the voltage decreases. Batteries themselves have ');
- Writeln(' a certain amount of `internal resistance.` They are just ');
- Writeln(' small chemical factories producing electron flow. Each ');
- Writeln(' can produce only so much until the chemicals are used up. ');
- Key; Gotoxy(1,25);For I:=1 to 14 do Writeln;
- Gotoxy(1,9);
-
- Writeln(' Be cautious about buying kits and umpteen easy electronic pr- ');
- Writeln(' ojects to amaze and mystify your friends. They are monkey- ');
- Writeln(' see-monkey-do kinds of things. Little electronics can be ');
- Writeln(' learned from them. The subject is too complex to be treated ');
- Writeln(' so lightly. The 4 programs on this disk are only the begin- ');
- Writeln(' ning of many more needed - and to come, I hope. ');
- Writeln;
- Writeln(' Throughout these programs, we emphasize the unity of science ');
- Writeln(' within itself, and with its mathematics. Here are more ');
- Writeln(' suggestions to help understand that unity. ');
- Writeln(' ------------------------------------------ ');
- Key;Clrscr;
-
- Writeln(' Relating Electronics to Other Science Topics. ');
- Writeln(' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ');
- Writeln(' At the end of the program Math22 is a list of recommended ');
- Writeln(' books. You won`t get very far in science without at least ');
- Writeln(' some of them, or the subject matter they contain. I hope ');
- Writeln(' you have some of them. ');
- Writeln;
- Writeln(' Especially important are the books on Physics. Don`t be ');
- Writeln(' bothered by the word. It`s quite a good word that refers to ');
- Writeln(' our understanding of matter and energy. Physics, chemistry ');
- Writeln(' and mathematics are the foundation subjects of all of scien- ');
- Writeln(' ce. There is vital and fascinating stuff in these subjects. ');
- Writeln;
- Writeln(' What people have not done, however, is to prepare easy intro- ');
- Writeln(' ductions to the good stuff. Here is an example of an easy ');
- Writeln(' introduction, related to electronics too. ');
- Key; Clrscr; Gotoxy(1,1);
- Writeln(' The Pendulum. ');
- Writeln(' ~~~~~~~~~~~~~ ');
- Writeln(' Get a small weight, like a nut from a 3/8 inch bolt. Tie ');
- Writeln(' about a 3 foot length of string or heavy thread to the ');
- Writeln(' nut. This is your pendulum `experimental apparatus.` ');
- Writeln;
- Writeln(' Wrap the free end of the string around your finger. Pull ');
- Writeln(' the weight to one side and let it go. Watch the motion of ');
- Writeln(' the pendulum as it swings back and forth - back and forth. ');
- Writeln(' Sort of hypnotic, isn`t it? ');
- Writeln;
- Writeln(' Now change the length of the string. Just wrap it around ');
- Writeln(' your finger at a different point. Again watch the motion. ');
- Writeln(' What happens when long versus short lengths are used? ');
- Writeln(' Why are their motions different? ');
- Writeln(' -------------------------------- ');
- Key; Gotoxy(1,25); For I:= 1 to 13 do Writeln;
- Gotoxy(1,5);
- Writeln(' Pendulum motions, and the math needed to describe them, ');
- Writeln(' comprise other parts of the foundations of science and ');
- Writeln(' mathematics. Look again at the section `Beyond triangles ');
- Writeln(' (Math22).` You will see some of the math to be develop- ');
- Writeln(' ed for describing these motions. ');
- Writeln;
- Writeln(' The programs on this disk describe flow in resistor circu- ');
- Writeln(' its. This is Direct current. Alternating current is just ');
- Writeln(' as important, so we want to learn about it too. Alternat- ');
- Writeln(' ing current is described with pendulum motion math! ');
- Writeln;
- Writeln(' So keep your simple apparatus. In later programs we will ');
- Writeln(' sketch experiments for it, measurements to be made, and ');
- Writeln(' develop the mathematics. Perhaps you might want to do at ');
- Writeln(' least some of this yourself. The essential information is ');
- Writeln(' in the books recommended. ');
- Writeln;
- Writeln(' These are long-term projects too (Math21): ');
- Writeln(' Experimenting, observing, and learning. ');
- Writeln(' --------------------------------------- ');
-
- Key;
- Tailend;
- end; (* Procedure Hardware. *)
-
- {---------------------------------------------------------------}
- Procedure TailEnd;
- Begin
-
- Clrscr;
- Gotoxy(20,9); Write(' End Of Program Ohm2 of the Series:');
- Gotoxy(20,10); Write('Foundations of Science and Mathematics.');
- Xlow:=17; Yhi:=7; Hlen:=42; Vlen:=4; Boxes;
-
- Gotoxy(20,15); Write('Ohm3 will cover resistor networks, and ');
- Gotoxy(21,16); Write(' Maxwell`s Loop Equations. ');
- Gotoxy(21,17); Write(' ------------------------- ');
- Gotoxy(23,24);
- Write('Press `M` for Menu, `Q` to Quit.');
- Repeat
- Read(Kbd,Ch);
- Ch:=Upcase(Ch);
- until (Ch in ['M','Q']);
- If Ch='M' then MainControl;
- Halt;
- end;
- {====================================================================}
- Procedure MainControl; Label 99; (******** MAIN CONTROL **********)
- Begin
- Assign(Ccontrol,'Control.com');
-
- 99: Clrscr;
- Writeln(' SERIES AND PARALLEL CIRCUITS ');
- Writeln(' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ');
- Writeln(' You input Volts and Resistor values for ');
- Writeln(' these circuits: ');
- Gotoxy(1,15);
- Writeln(' Series Parallel Series-Parallel ');
-
- Gotoxy(1,18);
- Writeln(' Press key for topic wanted. ');
- Writeln(' ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ');
- Writeln(' 1 Series. 4 Math Summary. ');
- Writeln(' 2 Parallel. 5 Math Explanation. ');
- Writeln(' 3 Series-Parallel. 6 Hands-on hardware.');
- Writeln(' C Control program. ');
- Writeln(' ____________________________ ');
- Xpos:=11; Ypos:=10; Serdraw;
- Xpos:=32; Ypos:=10; Pardraw;
- Xpos:=52; Ypos:=10; SPdraw;
- Xlow:=5; Yhi:=6;
- Vlen:=9; Hlen:=69; Boxes;
- {-------------------------------------------------------}
-
- Gotoxy(7,20);Write('I want no. ');
-
- Repeat
- Read(Kbd,Zh);
- Zh:=UpCase(zh);
- until (Zh in ['1','2','3','4','5','6','C']);
-
- Case Zh of (* Calls procedure wanted. *)
- '1': Series;
- '2': Parallel;
- '3': SerPar;
- '4': AllMath;
- '5': MathExplain;
- '6': Hardware;
- 'C': Execute(Ccontrol);
- end; (* Case *)
- {---------------------------------------------------------------}
- Repeat
- Gotoxy(51,19); Write('Press letter for next job.');
- Gotoxy(52,21); Write('`A` Another of these.');
- Gotoxy(52,22); Write('`M` Back to Menu.');
- Gotoxy(52,23); Write('`Q` Quit.');
-
- Repeat
- Read(Kbd,ch);
- ch:=UpCase(ch);
- until (Ch IN ['A','M','Q']);
-
- If (Ch='A') then begin
- if (Zh='1') then Series;
- if (Zh='2') then Parallel;
- if (Zh='3') then SerPar;
- end; (* Same circuit computing. *)
-
- If (Ch='M') then goto 99;
-
- until (Ch='Q');
-
- End; (* procedure MainControl. *)
- {====================================================================}
-
- Begin (* *** MAIN PROGRAM *** *)
-
- Clrscr;
- Gotoxy(1,6);
- Writeln(' Electronics #2 Series & Parallel Circuits. ');
- Writeln(' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ');
- Gotoxy(1,11);
- Writeln(' Second electronics program. Covers electron ');
- Writeln(' flow in Series and Parallel Circuits. ');
- Writeln;
- Writeln(' A mathematics section explains why Ohm`s law is different ');
- Writeln(' for the circuits, and relates it to other math. ');
-
- Xlow:=7; Yhi:=9; Hlen:=61; Vlen:=7; Boxes;
-
- Gotoxy(70,25);Write('Oct 1985');
- Gotoxy( 1,25);Write('Ohm2');
- Key;
- Maincontrol;
-
-
- End. (* Main Program. *)
- {====================================================================}