-
Notifications
You must be signed in to change notification settings - Fork 1
/
FORT_with_subprograms.hp42s
1478 lines (1459 loc) · 21 KB
/
FORT_with_subprograms.hp42s
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ FORT: Main FORT calculation program
00 { 3174-Byte Prgm }
01▸LBL "FORT"
02 SF 04
03 SF 05
04 SF 25
05 RCL "FTYPE"
06 FC?C 25
07 XSTR "1 μm"
08 STO "FTYPE"
09 DROP
10 0
11 STO "UMIN"
12 STO "UMAX"
13 CLST
14▸LBL A
15 CLMENU
16 "H-VLT"
17 KEY 1 XEQ 11
18 "V-VLT"
19 KEY 2 XEQ 12
20 "CALC"
21 KEY 3 XEQ B
22 "G SAG"
23 KEY 4 XEQ 06
24 "FREQ"
25 KEY 5 XEQ D
26 "PLOT"
27 KEY 6 XEQ E
28 KEY 7 GTO a
29 KEY 8 GTO a
30 KEY 9 XEQ 99
31 MENU
32 GTO 10
33▸LBL a
34 CLMENU
35 "Er"
36 XSTR "168Er"
37 X=? "ATOM"
38 ├"•"
39 DROP
40 KEY 1 GTO 41
41 "Yb"
42 XSTR "174Yb"
43 X=? "ATOM"
44 ├"•"
45 DROP
46 KEY 2 GTO 42
47 "7Li"
48 XSTR "7Li"
49 X=? "ATOM"
50 ├"•"
51 DROP
52 KEY 3 GTO 43
53 "6Li"
54 XSTR "6Li"
55 X=? "ATOM"
56 ├"•"
57 DROP
58 KEY 4 GTO 44
59 CLA
60 ARCL "FTYPE"
61 KEY 5 GTO 45
62 "PRNT"
63 KEY 6 XEQ 51
64 KEY 7 GTO A
65 KEY 8 GTO A
66 KEY 9 XEQ 99
67 MENU
68 GTO 10
69▸LBL 10
70 STOP
71 GTO 10
72▸LBL 11
73 INPUT "H-VOLT"
74 XSTR "1.5 μm"
75 X≠? "FTYPE"
76 1
77 X=? "FTYPE"
78 2
79 X<>Y
80 DROP
81 RCL "H-VOLT"
82 XEQ "V2P"
83 "H-FORT at "
84 ARCL ST X
85 ├" W"
86 AVIEW
87 RCL "PWRH"
88 X≠Y?
89 SF 04
90 X≠Y?
91 SF 05
92 DROP
93 STO "PWRH"
94 RTN
95▸LBL 12
96 INPUT "V-VOLT"
97 XSTR "1.5 μm"
98 X≠? "FTYPE"
99 3
100 X=? "FTYPE"
101 4
102 X<>Y
103 DROP
104 RCL "V-VOLT"
105 XEQ "V2P"
106 "V-FORT at "
107 ARCL ST X
108 ├" W"
109 AVIEW
110 RCL "PWRV"
111 X≠Y?
112 SF 04
113 X≠Y?
114 SF 05
115 R↓
116 STO "PWRV"
117 RTN
118▸LBL B
119 3
120 1
121 NEWMAT
122 STO "VR"
123 CF 03
124 CF 02
125 XEQ C
126 FS?C 03
127 RTN
128 CF 05
129 RCL "VR"
130 STO "VRMIN"
131 SF 01
132 XEQ "UDERIV"
133 STO "H"
134 CF 01
135 XEQ "UFORT"
136 1380649ᴇ-29
137 ÷
138 1ᴇ6
139 ×
140 STO "UMIN"
141 SF 02
142 XEQ C
143 FS?C 03
144 GTO 21
145 RCL "VR"
146 STO "VRMAX"
147 CF 02
148 XEQ "UFORT"
149 1380649ᴇ-29
150 ÷
151 1ᴇ6
152 ×
153 STO "UMAX"
154 CF 04
155▸LBL 21
156 PSE
157 XEQ D
158 XEQ 06
159 RTN
160▸LBL C
161 6
162 LSTO "N"
163 30
164 LSTO "M"
165 100
166 FS? 02
167 +/-
168 LSTO "VAL"
169▸LBL 02
170 XEQ "UFORT"
171 RCL "VAL"
172 FS? 02
173 X<>Y
174 X<Y?
175 GTO 01
176 FC? 02
177 R↓
178 LSTO "VAL"
179 -1
180 RCL+ "M"
181 X=0?
182 GTO 03
183 LSTO "M"
184 INDEX "VR"
185 3
186 1
187 STOIJ
188 RCLEL
189 2ᴇ-6
190 -
191 STOEL
192 GTO 02
193▸LBL 01
194 RCL "N"
195 X=0?
196 GTO 08
197 1
198 STO- "N"
199 CF 01
200 XEQ "UDERIV"
201 LSTO "J"
202 SF 01
203 XEQ "UDERIV"
204 CF 01
205 INVRT
206 RCL "J"
207 ×
208 LSTO "DELTA"
209 STO- "VR"
210 FNRM
211 5ᴇ-8
212 X>Y?
213 GTO 07
214 GTO 01
215▸LBL 03
216 "No extremum "
217 ├"found."
218 AVIEW
219 CF 02
220 SF 03
221 RTN
222▸LBL 07
223 "Converged after"
224 ├" "
225 6
226 RCL- "N"
227 AIP
228 AVIEW
229 RTN
230▸LBL 08
231 "Not converged"
232 AVIEW
233 CF 02
234 RTN
235▸LBL 06
236 CLA
237 FS? 04
238 GTO 22
239 "Trap depth: "
240 RCL "UMAX"
241 RCL- "UMIN"
242 ARCL ST X
243 ├" μK[LF]"
244▸LBL 22
245 FS? 05
246 RTN
247 ├"Grav. sag: "
248 INDEX "VRMIN"
249 3
250 1
251 STOIJ
252 RCLEL
253 1ᴇ6
254 ×
255 +/-
256 ARCL ST X
257 ├" μm"
258 AVIEW
259 RTN
260▸LBL D
261 FS? 05
262 RTN
263 RCL "H"
264 RAD
265 LSTO "A"
266 INDEX "A"
267 1
268 2
269 STOIJ
270 RCLEL
271 X↑2
272 J+
273 RCLEL
274 X↑2
275 +
276 I+
277 RCLEL
278 X↑2
279 +
280 LSTO "P1"
281 1
282 1
283 STOIJ
284 RCLEL
285 I+
286 J+
287 RCLEL
288 +
289 I+
290 J+
291 RCLEL
292 +
293 3
294 ÷
295 LSTO "Q"
296 1
297 1
298 STOIJ
299 RCLEL
300 RCL- "Q"
301 X↑2
302 I+
303 J+
304 RCLEL
305 RCL- "Q"
306 X↑2
307 +
308 I+
309 J+
310 RCLEL
311 RCL- "Q"
312 X↑2
313 +
314 2
315 RCL× "P1"
316 +
317 6
318 ÷
319 SQRT
320 LSTO "P"
321 3
322 3
323 NEWMAT
324 LSTO "B"
325 INDEX "B"
326 1
327 1
328 STOIJ
329 RCL "Q"
330 STOEL
331 I+
332 J+
333 STOEL
334 I+
335 J+
336 STOEL
337 RCL "A"
338 RCL- "B"
339 RCL÷ "P"
340 LSTO "B"
341 DET
342 2
343 ÷
344 ACOS
345 3
346 ÷
347 LSTO "PHI"
348 COS
349 RCL× "P"
350 2
351 ×
352 RCL+ "Q"
353 LSTO "EIG1"
354 2
355 PI
356 ×
357 3
358 ÷
359 RCL+ "PHI"
360 COS
361 RCL× "P"
362 2
363 ×
364 RCL+ "Q"
365 LSTO "EIG3"
366 3
367 RCL× "Q"
368 RCL- "EIG1"
369 RCL- "EIG3"
370 LSTO "EIG2"
371 DEG
372 3
373 1
374 NEWMAT
375 STO "TRAPF"
376 INDEX "TRAPF"
377 1
378 1
379 STOIJ
380 RCL "EIG1"
381 STOEL
382 J+
383 RCL "EIG2"
384 STOEL
385 J+
386 RCL "EIG3"
387 STOEL
388 RCL "TRAPF"
389 RCL "MASS"
390 166053886ᴇ-35
391 ×
392 ÷
393 SQRT
394 2
395 ÷
396 PI
397 ÷
398 STO "TRAPF"
399 INDEX "TRAPF"
400 1
401 1
402 STOIJ
403 CLST
404 RCLEL
405 J+
406 RCLEL
407 J+
408 RCLEL
409 "Trap freqs. "
410 ├"below (Hz)"
411 AVIEW
412 RTN
413▸LBL E
414 3
415 1
416 NEWMAT
417 LSTO "VDIR"
418 STO "VR"
419 INDEX "VDIR"
420 3
421 1
422 STOIJ
423 1
424 STOEL
425 FS? 04
426 GTO 30
427 RCL "VRMIN"
428 RCL- "VRMAX"
429 ENTER
430 FNRM
431 ÷
432 LSTO "VDIR"
433▸LBL 30
434 3ᴇ-5
435 STO "XMAX"
436 -3ᴇ-5
437 STO "XMIN"
438 RCL "XMAX"
439 XEQ c
440 STO "YMAX"
441 RCL "XMIN"
442 XEQ c
443 STO "YMIN"
444 RCL "UMIN"
445 1
446 -
447 X<Y?
448 STO "YMIN"
449 FS? 06
450 XEQ d
451 FS?C 06
452 RTN
453 HEIGHT
454 1
455 -
456 RCL "YMAX"
457 RCL- "YMIN"
458 ÷
459 STO 10
460 RCL "XMIN"
461 STO 11
462 1
463 WIDTH
464 1ᴇ3
465 ÷
466 +
467 STO 12
468 EXITALL
469 CLLCD
470 RCL "UMAX"
471 X≠0?
472 XEQ 34
473 RCL "UMIN"
474 X≠0?
475 XEQ 34
476 INDEX "VRMIN"
477 3
478 1
479 STOIJ
480 RCLEL
481 INDEX "VDIR"
482 3
483 1
484 STOIJ
485 RCLEL
486 X<>Y
487 R↓
488 X<>Y
489 R↓
490 ÷
491 +/-
492 XEQ 33
493▸LBL 31
494 RCL 11
495 XEQ c
496 XEQ 32
497 RCL 12
498 PIXEL
499 RCL "XMAX"
500 RCL- "XMIN"
501 WIDTH
502 ÷
503 STO+ 11
504 ISG 12
505 GTO 31
506 PRLCD
507 STOP
508 MENU
509 RTN
510▸LBL 32
511 RCL- "YMIN"
512 RCL× 10
513 HEIGHT
514 -
515 X>0?
516 CLX
517 ABS
518 RTN
519▸LBL 33
520 RCL- "XMIN"
521 RCL "XMAX"
522 RCL- "XMIN"
523 ÷
524 WIDTH
525 ×
526 +/-
527 1
528 X<>Y
529 PIXEL
530 RTN
531▸LBL 34
532 XEQ 32
533 +/-
534 1
535 PIXEL
536 RTN
537▸LBL c
538 RCL× "VDIR"
539 RCL+ "VRMIN"
540 STO "VR"
541 XEQ "UFORT"
542 1380649ᴇ-29
543 ÷
544 1ᴇ6
545 ×
546 RTN
547▸LBL 41
548 XSTR "1.5 μm"
549 X≠? "FTYPE"
550 166
551 X=? "FTYPE"
552 163
553 X<>Y
554 DROP
555 RCL "POLARI"
556 X≠Y?
557 SF 04
558 X≠Y?
559 SF 05
560 R↓
561 STO "POLARI"
562 168
563 STO "MASS"
564 "168Er"
565 ASTO "ATOM"
566 "Set to 168Er"
567 AVIEW
568 GTO a
569▸LBL 42
570 XSTR "1.5 μm"
571 X≠? "FTYPE"
572 162.5
573 X=? "FTYPE"
574 150.4
575 X<>Y
576 DROP
577 RCL "POLARI"
578 X≠Y?
579 SF 04
580 X≠Y?
581 SF 05
582 R↓
583 STO "POLARI"
584 174
585 STO "MASS"
586 "174Yb"
587 ASTO "ATOM"
588 "Set to 174Yb"
589 AVIEW
590 GTO a
591▸LBL 43
592 XSTR "1.5 μm"
593 X≠? "FTYPE"
594 269
595 X=? "FTYPE"
596 201.3
597 X<>Y
598 DROP
599 RCL "POLARI"
600 X≠Y?
601 SF 04
602 X≠Y?
603 SF 05
604 R↓
605 STO "POLARI"
606 7
607 STO "MASS"
608 "7Li"
609 ASTO "ATOM"
610 "Set to 7Li"
611 AVIEW
612 GTO a
613▸LBL 44
614 XSTR "1.5 μm"
615 X≠? "FTYPE"
616 269
617 X=? "FTYPE"
618 201
619 X<>Y
620 DROP
621 RCL "POLARI"
622 X≠Y?
623 SF 04
624 X≠Y?
625 SF 05
626 R↓
627 STO "POLARI"
628 6
629 STO "MASS"
630 "6Li"
631 ASTO "ATOM"
632 "Set to 6Li"
633 AVIEW
634 GTO a
635▸LBL 45
636 "1 μm"
637 XSTR "1 μm"
638 X=? "FTYPE"
639 "1.5 μm"
640 DROP
641 SF 04
642 SF 05
643 ASTO "FTYPE"
644 "Set to "
645 ARCL "FTYPE"
646 ├" FORT"
647 ├"[LF]Reselect "
648 ├"species pls."
649 AVIEW
650 GTO a
651▸LBL 51
652 PRON
653 FIX 01
654 SF 12
655 "FORT summary"
656 PRA
657 "============"
658 PRA
659 CF 12
660 ADV
661 "Species: "
662 ARCL "ATOM"
663 PRA
664 "FORT: "
665 ARCL "FTYPE"
666 PRA
667 "Polariz.: "
668 ARCL "POLARI"
669 ├" a.u."
670 PRA
671 FIX 03
672 ADV
673 "H-FORT U = "
674 ARCL "H-VOLT"
675 ├" V"
676 PRA
677 " P = "
678 ARCL "PWRH"
679 ├" W"
680 PRA
681 "V-FORT U = "
682 ARCL "V-VOLT"
683 ├" V"
684 PRA
685 " P = "
686 ARCL "PWRV"
687 ├" W"
688 PRA
689 ADV
690 XEQ 06
691 ADV
692 FS? 05
693 GTO 64
694 "Trap "
695 ├"frequencies:"
696 PRA
697 INDEX "TRAPF"
698▸LBL 52
699 "• "
700 RCLEL
701 1000
702 X>Y?
703 ├" "
704 R↓
705 100
706 X>Y?
707 ├" "
708 R↓
709 10
710 X>Y?
711 ├" "
712 R↓
713 ARCL ST X
714 ├" Hz"
715 PRA
716 J+
717 FC? 77
718 GTO 52
719 ADV
720▸LBL 64
721 FIX 01
722 SF 06
723 XEQ E
724 FIX 03
725 "→ "
726 DATE
727 ADATE
728 ├" "
729 TIME
730 ATIME24
731 ├" ←"
732 PRA
733 ADV
734 ADV
735 ADV
736 PROFF
737 RTN
738▸LBL d
739 RCL "GrMod"
740 LSTO "_GrMod"
741 0
742 STO "GrMod"
743 10ᴇ-6
744 HEIGHT
745 ÷
746 LSTO "_DX"
747 RCL "XMIN"
748 LSTO "_XPOS"
749 CLLCD
750 "←Potential"
751 ├" (μK)"
752 XEQ 61
753 PRLCD
754 CLLCD
755 1
756 XEQ 57
757 XEQ 59
758 XEQ 60
759▸LBL 53
760 HEIGHT
761 1000
762 ÷
763 1
764 +
765 LSTO "_YSCR"
766▸LBL 54
767 RCL "_DX"
768 STO+ "_XPOS"
769 XEQ 56
770 RCL "_XPOS"
771 X≥? "XMAX"
772 GTO 55
773 RCL "_YSCR"
774 XEQ 58
775 ISG "_YSCR"
776 GTO 54
777 PRLCD
778 CLLCD
779 XEQ 59
780 GTO 53
781▸LBL 55
782 RCL "_YSCR"
783 XEQ 57
784 SF 01
785 XEQ 60
786 PRLCD
787 CLLCD
788 2
789 2
790 "←Z (μm)"
791 XEQ "DISPLAY"
792 PRLCD
793 ADV
794 GTO 63
795▸LBL 56
796 RCL "_XPOS"
797 XEQ c
798 RCL- "YMIN"
799 X<0?
800 0
801 WIDTH
802 RCL "YMAX"
803 RCL- "YMIN"
804 ÷
805 ×
806 RCL "_YSCR"
807 X<>Y
808 PIXEL
809 RTN
810▸LBL 57
811 +/-
812 0
813 PIXEL
814 R↓
815 +/-
816 RTN
817▸LBL 58
818 1
819 PIXEL
820 R↓
821 WIDTH
822 PIXEL
823 R↓
824 RTN
825▸LBL 59
826 "××××"
827 1
828 2
829 AGRAPH
830 1
831 WIDTH
832 4
833 -
834 AGRAPH
835 4
836 +
837 2
838 ÷
839 PIXEL
840 "←"
841 1ᴇ6
842 RCL× "_XPOS"
843 ARCL ST X
844 3
845 1
846 XEQ "DISPLAY"
847 RTN
848▸LBL 60
849 FUNC 00
850 "→"
851 1
852 +
853 FC? 01
854 0
855 FS? 01
856 5
857 -
858 WIDTH
859 2
860 ÷
861 AGRAPH
862 X<>Y
863 FC? 01
864 0
865 FS?C 01
866 2
867 +
868 X<>Y
869 2
870 ÷
871 "∫"
872 AGRAPH
873 3
874 ×
875 AGRAPH
876 RTN
877▸LBL 61
878 WIDTH
879 XEQ 62
880 -
881 2
882 ÷
883 1
884 XEQ "DISPLAY"
885 1
886 HEIGHT
887 7
888 -
889 "←"
890 ARCL "YMIN"
891 XEQ "DISPLAY"
892 CLA
893 X<>Y
894 R↓
895 RCL "YMAX"
896 RCL+ "YMIN"
897 2
898 ÷
899 ARCL ST X
900 XEQ 62
901 X<>Y
902 "←"
903 ARCL ST X
904 FP
905 X=0?
906 0
907 X≠0?
908 4
909 X<>Y
910 R↓
911 -
912 2
913 ÷
914 +/-
915 WIDTH
916 2
917 ÷
918 +
919 X<>Y
920 XEQ "DISPLAY"
921 X<>Y
922 R↓
923 CLA
924 WIDTH
925 ARCL "YMAX"
926 XEQ 62
927 -
928 1
929 +
930 X<>Y
931 "←"
932 ARCL "YMAX"
933 XEQ "DISPLAY"
934 RTN
935▸LBL 62
936 ALENG
937 4
938 ×
939 RTN
940▸LBL 63
941 RCL "_GrMod"
942 STO "GrMod"
943 CLLCD
944 MENU
945 RTN
946▸LBL 99
947 CF 04
948 CF 05
949 CLMENU
950 EXITALL
951 END
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ V2P: Convert FORT setpoint voltages to power values.
@@@@ Actually just calculates a polynom or arbitrary order. The x value
@@@@ (that is set voltage) is in ST X. The coefficients of the polynomial
@@@@ are in a row of the V2P matrix and the row to be used is in ST Y.
@@@@ The return is the evaluated function (that is power) in ST X.
00 { 65-Byte Prgm }
01▸LBL "V2P"
02 LSTO "_V" @ setpoint voltage from ST X as x value
03 DROP
04 INDEX "V2P" @ contains the coefficients of the polynomial
05 1
06 STOIJ @ get row from (the initial) ST Y
07 DROP
08 DROP
09 RCLEL @ get zero-order term
10 J+
11 FC? 76
12 XEQ 01 @ process higher orders if available
13 GTO 99
14▸LBL 01 @ main calculation loop start
15 RCLIJ
16 X<>Y
17 DROP @ array column position in ST X now
18 1
19 - @ converted to current polynomial order
20 RCL "_V"
21 X<>Y
22 Y↑X @ calculate x^(current polynomial order)
23 RCLEL
24 × @ multiply with coefficient from array
25 +
26 J+
27 FC? 76
28 GTO 01 @ proceed with next element if available
29▸LBL 99
30 END
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ UDERIV: Calculate Jacobian (FLAG 01 is 0) or Hessian (FLAG 01 is 1) matrix
@@@@ of crossed FORT potential at position VR
00 { 484-Byte Prgm }