home *** CD-ROM | disk | FTP | other *** search
- 10 rem mpk1 quadratische gleichungen
- 15 :
- 20 rem iterationsverfahren
- 25 :
- 30 rem werte nach der gleichung:
- 40 rem a*x^2+b*x+c=0
- 45 :
- 50 rem vorgaben:
- 55 :
- 60 a=1: b=-20: c=51
- 70 ge=.01
- 75 :
- 80 rem berechnungen startpunkte:
- 85 :
- 90 lx=0: ly=-b
- 100 rx=-b/a: ry=0
- 105 :
- 110 rem iterationen
- 115 :
- 120 rem von links (1.schnittpunkt)
- 125 :
- 130 i=1
- 140 y=ly
- 145 :
- 150 x=c/y: rem x-wert hyperbel
- 160 y=-a*x-b: rem y-wert gerade
- 165 :
- 170 print"iteration nr.";i
- 180 print"x1=";x
- 190 print
- 205 :
- 210 d=abs(-a*x-b-c/x)
- 220 if d<=ge then 240
- 225 :
- 230 i=i+1: goto150
- 235 :
- 240 print"gewuenschte genauigkeit erreicht.":print
- 245 :
- 250 rem von rechts (2.schnittpunkt)
- 255 :
- 260 i=1
- 270 x=rx
- 275 :
- 280 y=c/x: rem y-wert hyperbel
- 290 x=-(y+b)/a: rem x-wert gerade
- 295 :
- 300 print"iteration nr.";i
- 310 print"x2=";x
- 320 print
- 335 :
- 340 d=abs(-a*x-b-c/x)
- 350 if d<=ge then 370
- 355 :
- 360 i=i+1: goto 280
- 365 :
- 370 print"gewuenschte genauigkeit erreicht."
- 380 end
-