home *** CD-ROM | disk | FTP | other *** search
- 10 rem mpk1 lineare gleichungssysteme
- 15 :
- 20 rem iterationsverfahren
- 25 :
- 30 rem werte nach den gleichungen:
- 40 rem a1*x+b1*y=c1 und a2*x+b2*y=c2
- 50 rem y0 - startwert
- 60 rem ge - genauigkeit
- 65 :
- 70 rem vorgaben:
- 75 :
- 80 a1=60:b1=-1:c1=0
- 90 a2=30:b2=-1:c2=-30
- 100 y0=30: ge=0.01
- 105 :
- 110 rem anfangswert/startwert:
- 115 :
- 120 y=y0
- 130 i=1 :rem zaehler (iterationnr.)
- 135 :
- 140 rem wiederholungsanweisung:
- 145 :
- 150 x=(c1-b1*y)/a1
- 160 y=(c2-a2*x)/b2
- 165 :
- 170 print "annaeherung nr.";i
- 180 print "x=";x
- 190 print "y=";y
- 200 print
- 205 :
- 210 rem abbruchbedingung:
- 220 d=abs((c1-a1*x)/b1-(c2-a2*x)/b2)
- 230 if d<=ge then 260
- 235 :
- 240 i=i+1
- 250 goto 150 :rem naechste annaeherung
- 255 :
- 260 print "gewuenschte genauigkeit erreicht."
- 270 end
-