--- title: "Solving Simultaneous Equations" id: 76616 type: "computer_media" slug: "solving-simultaneous-equations" url: "http://localhost/computer_media/solving-simultaneous-equations/" markdown_url: "http://localhost/computer_media/solving-simultaneous-equations.md" published_at: "2026-11-11T08:02:22+00:00" modified_at: "2026-11-11T08:02:22+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/solving-simultaneous-equations-1.png" excerpt: "Solve a set of simultaneous linear equations on the ZX81: enter the number of unknowns and the coefficients, and get the values." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" - name: "ZX81" slug: "zx81" taxonomy: "post_tag" url: "http://localhost/tag/zx81/" model: - name: "Sinclair ZX81" slug: "zx81" taxonomy: "model" url: "http://localhost/model/zx81/" - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Lori Olson" slug: "lori-olson" taxonomy: "indiv" url: "http://localhost/indiv/lori-olson/" genre: - name: "Mathematics" slug: "mathematics" taxonomy: "genre" url: "http://localhost/type/mathematics/" media_type: "Program" programmers: - name: "Lori Olson" slug: "lori-olson" taxonomy: "indiv" url: "http://localhost/indiv/lori-olson/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Solving%20Simultaneous%20Equations%20%281982%29%28Olson%2C%20Lori%29%28TS1000%29%28US%29%28Program%29.zip" mediadate: "1982" images: - url: "http://localhost/wp-content/uploads/2026/11/solving-simultaneous-equations-1.png" - url: "http://localhost/wp-content/uploads/2026/11/solving-simultaneous-equations-2.png" article_media: - id: 52518 title: "Solving Simultaneous Equations" type: "article" url: "http://localhost/article/solving-simultaneous-equations/" related_content: - id: 26922 title: "Syntax Error" type: "article" url: "http://localhost/article/syntax-error-6/" media_type_tags: "Mathematics" license: false --- # Solving Simultaneous Equations Answer INPUT N with the number of unknowns, then enter the coefficients and the constant of each equation as K(1,1), K(1,2) and so on. The program solves the set by elimination and prints the value of each unknown. The article also prints changes that turn it into a polynomial curve fit. As printed, line 80 reads FOR H=I TO I-1 and line 110 NEXT H, so the elimination step is skipped and the answers are wrong. The March 1982 Syntax Errors column corrected them to FOR H=1 TO I-1 and NEXT J, and the printed Syntactic Sum is that of the corrected program. The download has both versions. In lines 2 and 25 the word INPUT inside the quotes is the INPUT keyword (as the article says to type it). Published in Syntax February 1982 ([Solving Simultaneous Equations](https://timexsinclair.com/article/solving-simultaneous-equations/)). ## Source Code ``` 2 PRINT " INPUT N" 4 INPUT N 6 CLS 8 DIM K(N,N+1) 10 FOR I=1 TO N 20 FOR J=1 TO N+1 25 PRINT " INPUT K(";I;",";J;")" 30 INPUT K(I,J) 35 CLS 40 NEXT J 50 NEXT I 60 FOR I=1 TO N 70 FOR J=I TO N 80 FOR H=I TO I-1 90 LET K(J,I)=K(J,I)-K(J,H)*K(H,I) 100 NEXT H 110 NEXT H 120 FOR J=I+1 TO N+1 130 FOR H=1 TO I-1 140 LET K(I,J)=K(I,J)-K(I,H)*K(H,J) 150 NEXT H 160 LET K(I,J)=K(I,J)/K(I,I) 170 NEXT J 180 NEXT I 190 FOR I=N TO 1 STEP -1 200 FOR H=I+1 TO N 210 LET K(I,N+1)=K(I,N+1)-K(I,H)*K(H,N+1) 220 NEXT H 230 NEXT I 240 FOR I=1 TO N 250 PRINT "U(";I;")=";K(I,N+1) 260 NEXT I ```