You are on page 1of 18

KEK—93-3

JP9401067

KEK Report 93- 3


May 1993
A

Magnetic Field Measurements and Data Acquisition


of a Model Magnet for the B-Factory

W. ZHOU and K. ENDO

NATIONAL LABORATORY FOR


HIGH ENERGY PHYSICS
©National Laboratory for High Energy Physics, 1993

KEK Reports are available from:

Technical Information & Library


National Laboratory for High Energy Physics
1-1 Oho, Tsukuba-shi
Ibaraki-ken, 305
JAPAN
Phone: 0298-64-1171
Telex: 3652-534 (Domestic)
(0)3652-534 (International)
Fax: 0298-64-4604
Cable: KEKOHO
MAGNETIC FIELD MEASUREMENTS AND DATA ACQUISITION
OF A MODEL MAGNET FOR THE B-FACTORY

Zhou Wenming* and Kuninori Endo


National Laboratory for High Energy Physics
1-1 Oho,Tsukuba-shi,Ibaraki-ken 305, Japan

ABSTRACT

In this paper we describe magnetic field measurements and the field data-acquisition
system used to measure the model magnet for the B-factory booster.

The results of the measurements indicate that the method adopted here is good for
acquiring field data . This type of measurement is highly accurate and involves almost no
temperature coefficient. The instrument is used not only for ac, but also dc field
measurements. It is especially good for field measurements in the case of simultaneous ac
and dc field excitation .

DESCRIPTION OF THE DATA ACQUISITION SYSTEM

The proposed B-factory booster will be a rapid cycle-type accelerator. Its repetition rate is
to be 50 Hz. A modified existing dipole magnet for the TRISTAN-AR is being used in the
simulation research concerning the resonant magnet network and the power supply. The
present work is part of a study on the rapid-cycle synchrotron magnet and power-supply
system.
A measurement probe is attached to a table and has a small flip coil with 2065 turns and is
movable over a region of 700 mm x 1500 mm on the measurement table. The positional
error of the probe is about ± 10 \xm at each step and less than ±65 |J.m which is the error
accumulated when traveling the entire table.
The computer controls dynaserv 1 through fineserv 1 in order to change the probe
position J ) An integrator controls dynaserv 2 through fineserv 2 in order to flip and flip
back the probe coil. After the induced voltage of the flip coil is convened to digital data in
the integrator , data is acquired by the computer.
The area of the magnet pole face is 200 mm x 1240 mm. Measurements are automatically
performed point by point at an interval of one centimeter on the medium plane of the
magnet. Data acquisition and the movement of the flip coil are alternatively performed
during the measurement. The data-acquisition systems are shown in figure 1.

The acquired data are plotted and displayed on a screen, stored in the hard disk of the
computer and printed by a printer. If some acquired data is incorrect, it can be found
immediately.

* On leave of absence from the Institute of Modern Physics, Lanzhou, The People's Republic
of China.

1
Figure 1 Data-acquisition system

MAGNETIC FIELD DERIVATION

The synchrotron magnetic-field wave form is shown in figure 2. Its wave form is ex­
pressed as

B(t) = B + B sin cot,


dc ac (1)
where B(t) is the magnetic field ,
B the dc magnetic field,
dc

B the ac magnetic field (amplitude) and


ac

co the angular frequency of the ac field.

Figure 2 Magnetic field wave form

The inductive voltage of the flip coil in a magnetic field is calculated using the following
formula:

tfd>(f) _ dNA{B + B^sinaQcoscOft


Jc

eO)- (2)
dt dt
where c(t) = NA[-co B sinco t
f dc f +B (cocoscotcosco t - cOfSincotsmCO^)] .
a f (3)

Here N is the number of the turns of the probe coil,


A the average area of each turn of the probe coil,
<>>f the angular frequency of the flip and
co the angular frequency of the ac field.
r =^ and 7\=^ (4)
co a f

when
T =kT
f (k=l,2,3,...). (5)
E = I ' e(t)dt
J
Also °
= NA\\ -OifB^ sin co tdt + f

+Bd ' kCDfCoskcOftcoscOjtdt-j ' co sinkco tsinco tdt)]. / ; f (6)


Integrating last two terms from 0 to T H are zero respectively in Equation (6),we obtain
t

E = ^'\{t)dt = -2NAB . dc (7)

When the probe coil is stationary {(Of = 0) the induced voltage is

e,(t) = - = NAB^cocos cot (8)


dt
and E, = C" e(t)dt = lNAB . ac (9)

When B = 0, the induced voltage of the flip coil is


ac

dNAB. COSCOA
eAt) = '- = -NAB^a, sin a,t (10)
dt
n
and E =^' e,(t)dt=-2NAB .
I Jc (11)

Every E is converted to digital data corresponding to the magnetic field, and is then stored.

CONTROL AND DATA-ACQUISITION PROGRAM

All operations are controlled by programs stored in the computer. The probe coil is
returned to the coordinate origin of the measurement table before carrying out any mea­
surement. Data acquisition and control programs are written in assembly and BASIC
languages, respectively.
The probe coil is flipped by 180 degrees, and then flipped back to origin while waiting for
the next flip. Analog-to-digital conversion is carried out during the period of the coil flip.
The data are acquired on-line by the computer. The probe is moved by Ax=10 mm with
dynaserv 1 . This procedure is repeated until the measurement along the x-axis has been
3
completed. The probe coil is then returned to the origin of the x-coordinate and moved by
Ay=10 mm in the y-direction, and measurements along the x-axis are repeated.
The measurements are completed for a total of 1911 points over an area of 120 mm x 1460
mm. Field mapping all over such an area takes about 2.0 hours.
Acquired data are stored in the main memory during the measurements. After all data have
been acquired, they are immediately stored on a hard disk as a data file. The control and
data-acquisition program as well as its block diagram are given in the appendix.

MEASUREMENT

Two kinds of integrators ("a" and "b") are used for the measurements. When no ac field
exists, we use integrator "a" for dc field measurements. Data acquisition follows the
procedure described below:
A trigger pulse from the computer is transmitted to integrator "a". Both gates of the ADC
(analog to digital converter) and the accumulator are opened. The integration timing circuit
begins to work, and within 20 milliseconds the flip coil starts to flip. As soon as the integral
time, which is selected to be within the 0.5 to 0.9 second range, reaches pre-setted one, the
integration timing circuit and ADC are closed. After 10 microseconds the output register
transfers data. Another 100 microseconds later the accumulator is cleared. Then, within 20
milliseconds the flip coil starts to tlip back to the original position. The probe coil is moved
and the next new measurement cycle starts.
DC field measurements are carried out after waiting for a warm-up time of 40 minutes.
Both the accuracy and the reproducibility of the measurements are better than ± Ixl0~4.

When the probe coil is stationary, the induced voltage appears across the coil due to the
time-dependent magnetic field. If the voltage is integrated from the bottom to the top of
the ac field, B a cis obtained. If the probe coil is flipped by 180 degrees, only Bdc is
obtained under both ac and dc excitations of the magnet.

Both B c and Bdc are obtained using integrator "b", in which the induced voltages are
a

convened to frequency by two VFC's (voltage to frequency converter).


The frequency of the induced voltage is about 50 Hz in a B c measurement. The timing
a

circuit, which is based on the same frequency, generates two timing signals. Their periods
correspond to 24.5 and 49.5 times the B c cycle, respectively. The first signal determines
a

the integration time, and the second determines the measurement cycle. The initial time of
every measurement cycle is deferred by ten milliseconds. The measurement cycle is just
one second.

A total of 24.5 cycle's pulses converted from the induced voltage of the probe coil are
counted by a counter . If the induced voltages are symmetric in both half cycles, the pulses
of the positive and negative half cycles of the induced voltages cancel each other every
cycle. The counter gives no output during the first 24 cycles. Only the last half cycle's
pulses of the induced voltage are counted by the counter during the integration time.
After waiting for the integration time and an additional 101 microseconds, the output
register transfers data. After another 101 microseconds delay, data are acquired. The probe
coil is moved and the next measurement cycle starts.
4
dc

180°

50Hz _^
Ref. ^

B
ac
gate

ABdc-
gale

dc
gate
strobe
pulse "
— 101ns
0.45sec.(24.5 cycle)
- IOIJXS
0.5sec.
flip back

Figure 3 Time chart of the field, voltage, flip and integration time

5
When the probe coil is flipped during a maenet-field measurement, from equation (3) the
induced voltage has two parts caused by B and B(j . The pulses caused by B c are
a c c a

canceled in the counter. No contribution is made to Bdc- The measurement procedure is


similar to that of B c- a

The relations between the magnetic field, inductive voltage, flip and integration time in the
integrator "b" are shown in figure 3.
w l s
Bdc ' measured with integrators "a" and "b". The difference between the two kinds of
azimuthal magnetic-field distributions at y=0 is plotted in Figure 4. The maximum
difference is 2.5 x 10"- at the fringing region. The magnet center is located at 66 cm on
the abscissa.

66 99 132 165
Longitudinal Distance (cm)

Figure 4 Difference in the Bdc field whether B c is applied or not a

n
*) difference(.iormalized) = B<jc (Bac <" exist)-Bdc(B;ic exist)

The effective magnetic field length is calculated by the following formulae :

B„=(B_ +B_ +---


s Jl + B +--- +
0 B +B )/\l,
t s (12)
Bl = J " B{x)cix
and (13)
~(B_, + B_ +...+B +...+B,_ +B )&x
ttl 0 1 t

Bl
L=- (14)
B.

where B is the average field at the central region.


a

-x to x is the range of the measurement (x is far from the magnet fringe), and
Ax is the measurement step.

The effective magnetic field lengths under I and I d excit; tion are about one centimeter
a c c

longer than those under only Ifc excitation in the useful radia] region. They are listed in the
table below:

6
Table Effective magnetic field length in cm

y Idc=I000A,I c=566 A
a ldc=1000A, I =OA
ac

-6 126.81 126.01
-5 126.93 126.27
-4 127.15 126.44
-3 127.29 126.54
-2 127.37 126.62
-1 127.67 126.66
0 127.72 126.67
1 127.61 126.66
2 127.57 126.63
3 127.53 126.56
4 127.47 126.46
5 127.57 126.33
6 127.29 126.10

ACKNOWLEDG MENTS

It is our pleasure to thank associate professor T.Kubo and Mr.Y.Ohsawa for their valuable
help in this work.

REFERENCE

I) The words "dynaserv" and "fineserv" are the brand names of the servo motor and its
controller respectively. Products of Yokogawa Precision Co.

7
Appendix

1, Control and data-acquisition program block diagram.


2, Program list:
Program BDC. BAS is for control and data acquisition.
Program READBDC. BAS is for reading data from the disk file.
Program PLOT. BAS is for plotting both the radial and azimuthal field distributions.
Program LENGTH . BAS is for calculating of the effective magnetic length
between y=6cm and y=-6cm .
Program PLODIF. BAS is for plotting the difference in B d when B c is applied or
c a

not.
All of the above program are stored on the hard disk of the computer (PC-9801 ns/t).

(" begin ~)

input m,n
[
initialize

I V= 0
yes
1 y=o | I clear screen]
T
x=0, L=0
lyes
x=0
1 1 JZ
w=l-3
acquire dati
15es
(store q(x,y)| "TntT // lprint //display// q(x,y")7/ P'ot /
1 k=0
| x=x=l |
1 xsiep
|x=x+l,l=l+l~[
i
| y=y+i |
i k=k+l I x to origin I
j a: X
clear screen] y step
I I
C end ") y=y+l

Figure 5 Program BDC.BAS block diagram


10 REM ** control and data acquisition program for model **
20 REM * magnet of b-factorv during field measurement *
30 REM ************ BDC.BAS ************
40 DEFINT A-Z
50 CLEAR &I1200
60 DEF SEG=SEGPTR(2)
70 MFS="\sti\pget.com"
80 ENTRY=0
90 HLOAD MFS.ENTRY
100 AKPORT=&HD0
110 GOSUB "ESTATE
120 PRINT
130 LPR1NT "dc magnetic field measurement"
300 OPEN "crecordc.dat" FOR OUTPUT AS #2
310 INPUT "date: year,month,dav";YEAR,MONTH,DAY
320 PRINT #2,YEAR,MONTH,DAY
330 LPR1NT "date:"YEAR":"MONTH":"DAY
340 INPUT "magnet exciting current Iac,Idc";lAC,IDC
350 PRINT #2,IAC,IDC
360 LPRINT "exciting current:Iac="IAC"a ";"Idc="IDC"a"
370 INPUT "number of point in x-direction";M
380 INPUT "step length in x-direction";SLX
390 PRINT #2,M,SLX
400 IPR1NT "number or point in x-direction:"M
410 LPRINT "step length in x-direction:"SLX"mm"
4'20 INPUT "number of point v-direction";N
430 INPUT "step length in y-d"irection";SLY
440 PRINT #2,N,SLY
450 LPRINT "number of point in y-direetion:"N
460 LrRINT "step length in v-direction:"SLY"mm"
470 CLOSE til
480 LPRINT "acquiring data is stored in oBdc.dat"
500 LPRINT
510 LPRINT " ** ** ** "
520 LPRINT
530 DIMQfN.M)
600 COMMANDS="@7:0:0": GOSUB *FERM : REM no interlock and origin
610 COMMAND$="@20:1:1": GOSUB *FERM : REM servo on of axis x,v
620 COMMAND$="®6:l" : GOSUB *FERM : REM auto mode
630 COMMAND$="@3:5" : GOSUB *FERM : REM v to origin
640 COMMANDS="®3:6" : GOSUB *FERM : REM x to origin
650 PRINT
730 F0RK=1T0 4
740 COMMAND$="@3:4" : GOSUB *FERM
750 NEXTK
760 FORY=0TON
770 A0-300
780 B0=350
790 DA=1NT(300/M)
800 CLS 3
810 SCREEN 3
820 LOCATE 36,22

9
830 PRINT "0"
840 LOCATE 78,22
850 PRINT "X"
8G0 LOCATE 32,15
870 PRINT "5000"
880 LOCATE 31,9
890 PRINT "10000"
900 LOCATE 35,3
910 PRINT "B"
920 LINE (300,350)-(635,350)
930 LINE (625,347)-(635,350)
940 LINE (625,353)-(635,350)
950 UNE (300,350)-(300,50)
960 LINE (297,60)-(300,50)
970 LINE(303,60)-(300,50)
980 LINE (295,150)-(305,150)
990 LINE(295,250)-(305,250)
1010 L=0
1020 I.PRINT "v="Y-6
1030 FOR X=0 TO M
1035 EiyvG%=l
1040 FOR 1=0 TO 300
1050 NEXT I
1060 CALLENTRY(I-'IAG%,DATA1%,DATA2%)
:
1070 IOR 1=0 TO 1000 : NEXT 1
1080 LOCATE 10,5 : PRINT " nag: ";FLAG%
1090 LOCATE 10,6 : PRINT "datul:(" FIX(DATAl%/4) '*)"
1100 LOCATE 10,7 : PRINT "data2:(" FlX(DATA2%/4) ")"
1110 LOCATE 10,8 : PRINT "v="Y-6;' x="X
1120 LPRINT USING "######//#"; FIX(DATA2%/4);
1130 OJY,X)=PIX(DATA2%/4)
1140 A1=A0+DA
1150 C=EIX(DATA2%/4)
1160 B1 = 3 5 0-INT( C* 2 00/10000)
1170 LINE (A0,B0)-(A1,BI)
1180 A0=A1
1190 B0=B1
1200 COMMANDS="^3:l : GOSUB *FERM : REM x STEP
1210 L=L+1
1220 NEXT X
1230 LPRIN1
1240 W=L-3 IFW=<0 GOTO *HOME
1250 FORK=l TOW
1260 COMMAND$="@3:2 GOSUB *FERM : REM x return
1270 NEXT K
1400 *HOME
1410 COMMANDS="@3:6" : GOSUB *FERM : REM x to origin
1420 PRINT "y=";Y-6 : REM stop
1430 COMMANDS="@3:4" : GOSUB *EERM : REM y step
1440 NEXTY
1600 OPEN "c:Bdc.dat" FOR OUTPUT AS #1
1610 FOR Y=0 TO N
1620 FOR X=0 TO M
1630 PRINT ^l.OJY.X)

10
1640 NEXTX
1650 NEXTY
1660 CLOSE 01
1670 CLSS
1680 END
1800 *FERM
1810 OPEN "com:n81nn" AS #1
1820 PRINT #1, COMMANDS
1830 LINE INPUT.VI,ASDS
1840 CLOSE tt\
1850 RETURN
1900 *LSTATE
1910 PRINT "load file name: ";MF$
1920 PRINT "cnirv address: ";HEXS(SEGPTR(2));":";HEX$(ENTRY)" "
1930 FOR 1=1 TO 255
1940 IP (I MOD 16=0) THEN PRINT
1950 HS=HEXS(PEEK(ENTRY+I))
1960 IP (LEN(1IS)<2) THEN HS='0"+M$
1970 PRINT 11$;"";
1980 NEXT!
1990 PRINT " "
2000 PRINT "port status:";HEX$(INP(AKPORT))
2010 PRIN1
2020 PRINT "if ok press anv kev.";
2030 GOSUBMNKEY
2040 RETURN
2050 *INKEY
2060 X$=INKEYS
2070 IF XS="" THEN *INKEY
2080 RETURN

100 ' READBDC.BAS


1 1 0 ' The program is for reading data file from floppy disk
120 OPEN "c.-recordc.dat" FOR INPUT AS #1
130 INPUT #l,YEAR,MONTH,DAY
140 PRINT "date:"YEAR"YEAR"; MONTH"MONTH"; DAY"DAY"
150 LPRINT "date:"YEAR"YEAR"; MONTH"MONTH"; DAY"DAY"
160 LPRINT
170 INPUT #Uac.Idc
180 PRINT "exiting current of magnet:Iac="Iac"a";" ldc="Idc"a"
190 LPRINT "exiting current of magnet:Iac="Iac"a";" Idc="Idc"a"
200 INPUT #1,M,SLX,N,SLY
2! 0 PRINT "number of point in x-direction:"M
2'i.': .PRINT "number of point in x-direction:"M
230 PRINT "step length of x-direction:"SLX
240 LPRINT "step length of x-direction:"SLX
250 PRINT "number of point in y-directin:"N

11
260 LPRINT "number fo point in y-direction:"N
270 PRJNT "step length of y-direction:"SLY
280 LPRINT "step length of v-direction:"SLY
290 LPRINT
300 CLOSE n
310 DIM OJN.M)
320 OPEN "a:bde.dat" FOR INPUT AS #2
330 FORY=0TON
340 PRINT
350 PRINT "v='*Y-6
360 LPRINT
370 LPRINT "v="Y-6
380 FORX=0TOM
390 INPUT til, OiY.X)
400 PRINT USMG"########";QLY,X);
410 LPRINT USING"########";QiY,X);
420 NEXTX.Y
430 CLOSE #2
440 END

100 '** This program compares both data plotting **


110 '* both radial and azimuthal field distribution *
120 '******** PLOT.BAS *****.*.*
210 M=146
220 N=i'i
230 DIK. iA(N,M),QP(N,M)
240 OPEN "a-.bdc.dat" FOR INPUT AS »1
250 FORY=0TON
260 FOR X=0 TO M
270 INPUT #1,QA(Y,X)
280 NEXTX
290 NEXT
300 CLOSE #1
400 OPEN "cbdc.dat" FOR INPUT AS #1
410 FORY=0TON
420 FOR X=0 TO M
430 INPUT #1,QD(Y,X)
440 NEXT X
450 NEXTY
460 CLOSE #1
500 CLS3
510 A0=300
520 E0=320 :F0=320
530 DA=INT(300/M)
540 SCREEN 3
550 LOCATE 36,20 : PRINT "0"
560 LOCATE 78,20 : PRINT "X"
570 LOCATE 33,13 : PRINT "0.50"

12
580 LOCATE 33,7 : PRINT' 1.00"
590 LOCATE 36,4 : PRINT' B/Bo"
700 LINE (300,320)-(635,320)
710 UNE (625,317)-(635,320)
720 LINE (625,323)-(635,320)
730 1JNE(300,320)-(300, 90)
740 LlNE(297,100)-(300,90)
750 LINE ( 3 0 3 , 1 0 0 H 3 0 0 , 90)
7G0 LINE ( 2 9 5 , 1 2 0 H 3 0 5 , 1 2 0 )
770 LINE(295,220)-(305,220)
900 LOCATE 43,21 : PRINT' Bdc azimuihal disiribution"
910 LOCATE 52,15 : PRINT' Y=0"
920 SA=0 : SI)=0
930 EOR X=60 TO 70
950 SA=SA+QA(6,X)
960 SD=SD+QP(6,X)
980 NEXT X
990 AVA=SA/11 AVD=SD/11
1000 EORX=0TOM
1010 A1=A0+DA
1020 El =320-INT(Q_A(6,X)/AVA*200)
1030 E1=320-INT(QP(6,X)/AVD*200)
1040 LINE(A0,E0)-(A1,E1)
1050 LINE(A0,E0)-(A1,F1)
1060 A0=A1 : E0=E1
1070 P0=F1
1080 NEXT X
1090 POR X=0 TO M
1100 LPRINT USING flttttti.fttttt";(lA{(,,X.)/MA;
1110 NEXTX
1120 LPRINT LPRINT
1130 TOR X=0 TO M
1140 LPRINT USING ///W,'./W/";QP(C>,X)/AVL>
1150 NEXT X
1160 LPRINT : LPRINT
1200 B0=60
1210 C0=320 1)0=320
1220 DB=INT(150/N)
1230 SCREEN 3
1240 LOCATE 6,20 PRINT "0"
1250 LOCATE 30,20 PRINT "Y"
1260 LOCATE 3,13 PRINT "0.50"
1270 LOCATE 3,7 PRINT "1.00"
1280 LOCATE 6,4 PRINT "B/Ro"
1290 LINE(60,320)-(250,320)
1300 LINE (240,317)-(250,320)
1310 LINE(240,323)-(250,320)
1320 LINE ( 6 0 . 3 2 0 H 6 0 , 9 0 )
1330 LlNE(57,100)-(60,90)
1340 UNE(63,100)-(60,90)
1350 UNE(55,120)-(65,120)
1360 LlNE(S5,220)-(65,220)
1370 LOCATE 8,21 : PRINT 'Bdc radial distribution"
1380 LOCATE 17,15 : PRINT •x=66"

33
1400 SA=0 : SD=0
1410 FOR Y=0TO N
1420 SA=SA+QA(Y,66) : AVA=SA/13
1430 SD=SD+QD(Y,66) : AVD=SD/13
1440 NEXTY
1500 FORY=0TON
1510 BI=B0+DB
1520 C1=320-INT(QA(Y,66)/AVA*200)
1530 D1=320-INT(QP(Y,66)/AVD*200)
1540 UNE(B0,C0)-(B1,C1)
1550 LINE(B0,D0)-(B1,D1)
1560 B0=B1 : C0=C1
1570 D0=D1
1780 NEXTY
1790 FORY=0TON
1800 LPRINT USING "/W^#.##*"';QA(Y,66)/AVA;
1810 NEXTY
1820 LPRJNT : LPRINT
1830 FORY=0TON
1840 LPRINT USING "#////#.#//#";QP(Y,66)/AVD;
1850 NEXTY
1860 LPRINT
1870 END

100 '****Calculate effective magnetic lengths**


110 '* between y=-6em and y=6cm
120 '**+*****+** LENGTH BAS *+***++++*
130 DEFSNGA-Z
140 M=146 : N=12
150 DIM QA(N.M), QC(N,M), LA(N),I.C(N)
2 0 0 OPEN "a.-Bdc.dat" FOR INPUT AS #1
2 1 0 FORY=0TON
220 FORX=0TOM
230 INPUT #1,QA(Y,X)
240 NEXT X
250 NEXTY
2 6 0 CLOSE #1
300 OPEN "c:Bdc.dat" FOR INPUT AS #1
3 1 0 FORY=0TO
320 FORX=0TOM
330 INPUT #1,QC(Y,X)
340 NEXT X
350 NEXTY
360 CLOSE #1
370 LPRINT "pole dimension is 20cm x 124cm"
380 LPRINT "locate v=0,x=66 is magnet centre"
400 FOR Y=0 TO N '
410 QA=0 : QC=0

14
420 FORX=61 TO 70
430 QA=QA+QA(Y,X)
440 QC=QC+QC(Y,X)
450 NEXTX
460 QA=QA/10
470 QC=QC/10
480 A=0 : C=0
490 FOR X=66 TO M
500 A=A+QA(Y,X)
510 C=C+QC(Y,X)
520 NEXTX
530 A=(A-QA(Y,66)/2)/QA*2
540 IA(Y)=A
550 C=(C-QC(Y,66)/2)/QC*2
560 LC(Y)=C
570 NI-XTY
610 PRINT
620 PRINT" lac=566a Idc=1000a";
630 PRINT" lac=0 Idc= 1000a"
640 PRINT
650 U'RINT
660 LPRINT" Iac=566a Idc=1000a";
670 LPRINT" lac=0 Idc= 1000a"
680 LPRINT
690 FORY=0TON
700 PRINT" Y="Y-6;
710 PRINT USING "##m##M#.##/r;LAW); : PRINT "cm";
720 PRINT USING "ttitttmttltt1tttt}ttttit.tttttt";\JZW); : PRINT "cm"
730 LPRINT" Y="Y-6;
740 LPRINT USING "H1t1imtWiittMU#"\\AW)\ : LPRINT "cm";
750 LPRINT USING "tittmtttttitttunttlHt.Mtr'XCty); : LPRINT "cm"
760 NFXTY
770 END

100 '*** PLODIF.BAS ***


110 'This program is for plotting with difference of both data
120 DIM QA(12,146),QC(12,146),QP(12,146)
130 OPEN "a:Bdc.dat" FOR INPUT AS tt\
140 FORY=0TO12
150 FORX=0TO146
160 INPUT #1,QA(Y,X)
170 NFXTX
180 NEXTY
190 CLOSE #1
200 OPEN "a:Adc.dat" FOR INPUT AS #1
210 FORY=0TO12

15
220 FORX=0TO146
230 INPUT #],QC(Y.X)
240 NEXT X
250 NEXTY
2G0 CLOSE #1
300 CIS
310 SCREEN 3
320 L1NE(100,200)-(550,200)
330 LINE(540,197)-(550,200)
340 LINE(540,203)-(550,200)
350 UNE(100,350)-(100, 50)
360 LINE (103, 60)-(100, 50)
370 LINE (97, 60)-(100, 50)
380 LINE ( 98,300)-( 102,300)
390 LINE (98,250)-( 102,250)
400 LINE(98,150)-(102,150)
410 UNE(98,100)-(102,100)
420 LOCATE 13,71 : PRINT "x"
430 LOCATE 19,8 : PRINT "-0.02"
440 LOCATE 16,8 : PRINT "-0.01"
450 LOCATE 13,1 : PRINT "0"
460 LOCATE 10, 9 : PRINT "0.01"
470 LOCATE 7, 9 : PRINT "0.02"
480 LOCATE 3,12 : PRINT "d"
510 FORY=0TO12
520 AO=100
530 BO=200
540 STEPX=INT(450/146)
550 C0=DO=0
560 FORX=61TO70
570 CO=CO+QA(Y,X)
580 DO=DO+QC(Y,X)
590 NEXT X
600 CO=CO/10
610 DO=DO/10
620 FORX=0TO146
630 E=QA(Y,X)/CO-QC(Y,X)/DO
640 QD(Y,X)=E
650 B=200-INT(E*5000)
660 A=AO+STEPX
670 LINE (AO,BO)-(A,B)
680 AO=A
690 BO=B
700 NEXT X
710 NEXTY
800 OPEN "a.-Bdcd.dat" FOR OUTPUT AS #1
810 FORY=0TO12
820 FORX=0TO146
830 PRINT #1,QP(Y,X)
840 NEXT X
850 NEXTY
860 CLOSE #1
870 END

16

You might also like