REM Programme en cours d'‚laboration REM fichier PARCELL1.BAS REM Ce programme est ‚crit en qbasic. Il est compatible (sauf pour REM les accents dans les commentaires) avec le freebasic. REM L'interface de d‚veloppement de ce dernier (joint au compilateur) REM peut ˆtre t‚l‚charg‚ … partir du site http://www.freebasic.net REM L'environnement qbasic, form‚ des fichiers qbasic.exe et REM qbasic.hlp, qui offre plus de facilit‚s pour la mise au point, REM fait partie du DOS … partir de la version 5. Il se trouve sur le REM cd d'installation de windows95/98 bien qu'il ne soit pas install‚ REM de fa‡on standard. L'usage de l'interpr‚teur qbasic.exe est REM d‚conseill‚ en windows XP car la copie d'‚cran est alors REM impossible et des pertes de contr“le ont ‚t‚ observ‚es. REM DEFSNG A-Z DECLARE SUB basin (a$, g!, b$) DECLARE SUB minv (a(), n1%, d, n2%) SCREEN 9 DIM a(1 TO 5, 1 TO 6) esk = 1.6021E-19 / 1.381E-23 'charge ‚lectron / cst Boltzmann nbiter% = 100 'nombre d'it‚rations maximum debut: CLS PRINT " E. Matagne 09-07-2007" PRINT PRINT " Ce programme permet de d‚terminer les paramŠtres d'une" PRINT " cellule photovolta‹que conform‚ment … un modŠle … simple" PRINT " exponentielle en utilisant uniquement les caract‚ristiques" PRINT " nominales de cette cellule" PRINT GOSUB pourconti choixcell% = 2 entree0: CLS PRINT " choix des valeurs par d‚faut" PRINT PRINT " entrez" PRINT " 1 pour le module Conergy C 167P" PRINT " 2 pour le module Solarex MSX60" PRINT " 3 pour le module SM55 Siemens" PRINT " 4 pour le module Ase 165" PRINT " 5 pour le module Bp 350u" PRINT " 6 pour le module Shell 36 S" PRINT " 7 pour le module PVL-136" PRINT " 8 pour le module GTO136-80/2" PRINT " 9 pour le module Conergy PowerPlus 200P" PRINT " 10 pour le module Siemens SM 110-24" PRINT " 11 pour le module MSK AJG055-B" PRINT " 12 pour le module Photovoltech MITHRAS 200Wp" PRINT " 13 pour le module Sanyo HIP-210 NHE5" PRINT " 14 pour la cellule mesur‚e en DICE 2009-10" PRINT " 15 pour la cellule identifi‚e par Rafil" PRINT PRINT " votre choix df("; choixcell%; ") ="; INPUT in$ IF in$ <> "" THEN choixcell% = VAL(in$) IF choixcell% < 0 OR choixcell% > 15 THEN GOTO entree0: drssdtref = 0! ' coefficient de temp‚rature de rs en ohm/K csh = 0! 'conductance shunt sauf pour SM55 IF choixcell% = 1 THEN tcref = 25! 'Conergy C 167p uocref = 43.1 / 72! 'tension … vide. upref = 34.6 / 72! 'tension au point optimum dans les conditions de r‚f. V ipref = 4.83 'courant " " " " " " " " A iscref = 5.37 'courant de court-circuit A duocsdtref = -.156 / 72! 'coeff. de temp‚rature de la tension … vide V/K discsdtref = .002846 'coeff. de temp‚rature du courant de court-circuit A/K cas% = 1! dppsdtref = -.00485 * upref * ipref 'coeff. de temp‚rature de la puissance maximum W/K choixmat% = 1 'caract‚ristiques du mat‚riau des cellules ELSEIF choixcell% = 2 THEN tcref = 25! 'Solarex MSX60 uocref = 21.1 / 36! 'tension … vide. upref = 17.1 / 36! 'tension au point optimum dans les conditions de r‚f. V ipref = 3.5 'courant " " " " " " " " A iscref = 3.8 'courant de court-circuit A duocsdtref = -.08 / 36! 'coeff. de temp‚rature de la tension … vide V/K discsdtref = .00065 * iscref 'coeff. de temp‚rature du courant de court-circuit A/K cas% = 1 dppsdtref = -.005 * upref * ipref 'coeff. de temp‚rature de la puissance maximum W/K choixmat% = 1 'caract‚ristiques du mat‚riau des cellules ELSEIF choixcell% = 3 THEN tcref = 25! 'SM55 Siemens uocref = 21.7 / 36! 'tension … vide. upref = 17.4 / 36! 'tension au point optimum dans les conditions de r‚f. V ipref = 3.15 'courant " " " " " " " " A iscref = 3.45 'courant de court-circuit A duocsdtref = -.077 / 36! 'coeff. de temp‚rature de la tension … vide V/K discsdtref = .0012 'coeff. de temp‚rature du courant de court-circuit A/K cas% = 0! dppsdtref = 0! 'coeff. de temp‚rature de la puissance maximum W/K choixmat% = 1 'caract‚ristiques du mat‚riau des cellules csh = 1! / 6500! * 36! ELSEIF choixcell% = 4 THEN tcref = 25! 'Ase 165 uocref = 43.8 / 72! 'tension … vide. upref = 36! / 72! 'tension au point optimum dans les conditions de r‚f. V ipref = 4.58 'courant " " " " " " " " A iscref = 5.18 'courant de court-circuit A duocsdtref = -.0038 / uocref 'coeff. de temp‚rature de la tension … vide V/K discsdtref = .001 * iscref 'coeff. de temp‚rature du courant de court-circuit A/K cas% = 1! dppsdtref = -.0047 * upref * ipref 'coeff. de temp‚rature de la puissance maximum W/K choixmat% = 1 'caract‚ristiques du mat‚riau des cellules ELSEIF choixcell% = 5 THEN tcref = 25! 'Bp 350u uocref = 21.8 / 36! 'tension … vide. upref = 17.5 / 36! 'tension au point optimum dans les conditions de r‚f. V ipref = 2.9 / 2! 'courant " " " " " " " " A iscref = 3.17 / 2! 'courant de court-circuit A duocsdtref = -.08 / 36! 'coeff. de temp‚rature de la tension … vide V/K discsdtref = .00065 * iscref 'coeff. de temp‚rature du courant de court-circuit A/K cas% = 1! dppsdtref = -.005 * upref * ipref 'coeff. de temp‚rature de la puissance maximum W/K choixmat% = 1 'caract‚ristiques du mat‚riau des cellules ELSEIF choixcell% = 6 THEN tcref = 25! 'Shell 36 S uocref = 21.4 / 36! 'tension … vide. upref = 16.5 / 36! 'tension au point optimum dans les conditions de r‚f. V ipref = 1! / upref'courant " " " " " " " " A iscref = 2.3 'courant de court-circuit A duocsdtref = -.076 / 36! 'coeff. de temp‚rature de la tension … vide V/K discsdtref = .001 'coeff. de temp‚rature du courant de court-circuit A/K cas% = 1! dppsdtref = -.0045 'coeff. de temp‚rature de la puissance maximum W/K choixmat% = 1 'caract‚ristiques du mat‚riau des cellules csh = 0! ELSEIF choixcell% = 7 THEN tcref = 25! 'PVL-136 uocref = 46.2 / 66! 'tension … vide. upref = 33! / 66! 'tension au point optimum dans les conditions de r‚f. V ipref = 4.1 'courant " " " " " " " " A iscref = 5.1 'courant de court-circuit A duocsdtref = -.176 / 66! 'coeff. de temp‚rature de la tension … vide V/K discsdtref = .00051 'coeff. de temp‚rature du courant de court-circuit A/K cas% = 1! dppsdtref = -.286 / 66! 'coeff. de temp‚rature de la puissance maximum W/K choixmat% = 2 'caract‚ristiques du mat‚riau des cellules ELSEIF choixcell% = 8 THEN tcref = 25! 'GRO136-80/2 uocref = 21.5 / 36! 'tension … vide. upref = 16.9 / 36! 'tension au point optimum dans les conditions de r‚f. V ipref = 4.25 'courant " " " " " " " " A iscref = 4.73 'courant de court-circuit A duocsdtref = -.082 / 36! 'coeff. de temp‚rature de la tension … vide V/K discsdtref = .003 'coeff. de temp‚rature du courant de court-circuit A/K cas% = 0! dppsdtref = 0! 'coeff. de temp‚rature de la puissance maximum W/K choixmat% = 1 'caract‚ristiques du mat‚riau des cellules ELSEIF choixcell% = 9 THEN tcref = 25! 'Conergy PowerPlus 200P uocref = 36.2 / 60! 'tension … vide. upref = 28.6 / 60! 'tension au point optimum dans les conditions de r‚f. V ipref = 7.01 'courant " " " " " " " " A iscref = 7.86 'courant de court-circuit A duocsdtref = -.127 / 60! 'coeff. de temp‚rature de la tension … vide V/K discsdtref = .0021 'coeff. de temp‚rature du courant de court-circuit A/K cas% = 1! dppsdtref = -.0045 * upref * ipref 'coeff. de temp‚rature de la puissance maximum W/K choixmat% = 1 'caract‚ristiques du mat‚riau des cellules ELSEIF choixcell% = 10 THEN tcref = 25! 'Siemens SM 110-24 uocref = 43.5 / 72! 'tension … vide. upref = 35! / 72! 'tension au point optimum dans les conditions de r‚f. V ipref = 3.15 'courant " " " " " " " " A iscref = 3.45 'courant de court-circuit A duocsdtref = -.152 / 72! 'coeff. de temp‚rature de la tension … vide V/K discsdtref = .0014 'coeff. de temp‚rature du courant de court-circuit A/K cas% = 0 dppsdtref = 0! 'coeff. de temp‚rature de la puissance maximum W/K choixmat% = 1 'caract‚ristiques du mat‚riau des cellules ELSEIF choixcell% = 11 THEN tcref = 25! 'MSK AJG055-B stabilis‚ supposant 108 cellules en s‚rie uocref = 91.8 / 108! 'tension … vide. upref = 67! / 108! 'tension au point optimum dans les conditions de r‚f. V ipref = .82 'courant " " " " " " " " A iscref = 1.19 'courant de court-circuit A duocsdtref = -.00305 * uocref 'coeff. de temp‚rature de la tension … vide V/K discsdtref = .00075 * iscref 'coeff. de temp‚rature du courant de court-circuit A/K cas% = 0 dppsdtref = 0! 'coeff. de temp‚rature de la puissance maximum W/K choixmat% = 2 'caract‚ristiques du mat‚riau des cellules ELSEIF choixcell% = 12 THEN tcref = 25! 'Photovoltech MITHRAS 200Wp uocref = 32.8 / 54! 'tension … vide. upref = 26.7 / 54! 'tension au point optimum dans les conditions de r‚f. V ipref = 7.49 'courant " " " " " " " " A iscref = 8.25 'courant de court-circuit A duocsdtref = -.107 / 54! 'coeff. de temp‚rature de la tension … vide V/K discsdtref = .0055 'coeff. de temp‚rature du courant de court-circuit A/K cas% = 0 dppsdtref = 0! 'coeff. de temp‚rature de la puissance maximum W/K choixmat% = 1 'caract‚ristiques du mat‚riau des cellules ELSEIF choixcell% = 13 THEN tcref = 25! 'Sanyo HIP-210NHE5 uocref = 50.9 / 72! 'tension … vide. upref = 41.3 / 72! 'tension au point optimum dans les conditions de r‚f. V ipref = 5.09 'courant " " " " " " " " A iscref = 5.57 'courant de court-circuit A duocsdtref = -.127 / 72! 'coeff. de temp‚rature de la tension … vide V/K discsdtref = .00167 'coeff. de temp‚rature du courant de court-circuit A/K cas% = 1 dppsdtref = -.003 * upref * ipref 'coeff. de temp‚rature de la puissance maximum W/K choixmat% = 2 'caract‚ristiques du mat‚riau des cellules ELSEIF choixcell% = 14 THEN tcref = 25! 'cellule r‚alis‚e en DICE 2009-10 uocref = .377938 'tension … vide. upref = .26714 'tension au point optimum dans les conditions de r‚f. V ipref = 8.1432E-05 'courant " " " " " " " " A iscref = 1.09289E-04 'courant de court-circuit A duocsdtref = -.077 / 36! 'coeff. de temp‚rature de la tension … vide V/K discsdtref = 0! 'coeff. de temp‚rature du courant de court-circuit A/K cas% = 0! dppsdtref = 0! 'coeff. de temp‚rature de la puissance maximum W/K choixmat% = 1 'caract‚ristiques du mat‚riau des cellules csh = 1.141E-05 ELSEIF choixcell% = 15 THEN tcref = 25! 'cellule test Rafil uocref = .35284 'tension … vide. upref = .2587 'tension au point optimum dans les conditions de r‚f. V ipref = 2.8352E-05 'courant " " " " " " " " A iscref = 3.6656E-05 'courant de court-circuit A duocsdtref = -.077 / 36! 'coeff. de temp‚rature de la tension … vide V/K discsdtref = 0! 'coeff. de temp‚rature du courant de court-circuit A/K cas% = 0! dppsdtref = 0! 'coeff. de temp‚rature de la puissance maximum W/K choixmat% = 1 'caract‚ristiques du mat‚riau des cellules csh = 0! END IF REM point quelconque tc = 25! u = 0! entree1: CLS basin "Temp‚rature de r‚f‚rence de la jonction tcref", tcref, "øC" tkref = 273.15 + tcref PRINT PRINT " Valeurs nominales par cellule ( … 1000 W/m^2 et "; tcref; "øC)" PRINT basin "Tension … vide uocref", uocref, " V" basin "Tension au r‚gime optimal upref", upref, "V" basin "Courant au r‚gime optimal ipref", ipref, "A" basin "Courant de court-circuit iscref", iscref, "A" PRINT GOSUB pourconti CLS REM initialisation basin "Conductance shunt", csh, "siemens" PRINT gamma1 = .1 'gamma2 = 25! gamma2 = 4! 'introduit le 18/02/2011 iter1% = 0 iter1: iter1% = iter1% + 1 gamma = .5 * (gamma1 + gamma2) ' calcul de rsref 'rsmax = uocref / iscref rsmax = (uocref - upref) / ipref 'introduit le 18/02/2011 rs1 = -rsmax rs2 = rsmax iter2% = 0 DO iter2% = iter2% + 1 rsref = (rs1 + rs2) / 2 esgktref = esk / tkref / gamma expo0 = EXP(esgktref * uocref) a(1, 1) = 1! a(1, 2) = -(expo0 - 1!) a(1, 3) = uocref * csh fem = rsref * iscref expocc = EXP(esgktref * fem) a(2, 1) = 1! a(2, 2) = -(expocc - 1!) a(2, 3) = iscref + fem * csh CALL minv(a(), 2, d, 3) ilref = a(1, 3) i0ref = a(2, 3) ' r‚gime nominal fem = upref + rsref * ipref expop = EXP(esgktref * fem) ijonct = i0ref * (expop - 1!) erreur = ilref - ijonct - fem * csh - ipref IF erreur < 0! THEN rs2 = rsref ELSE rs1 = rsref END IF LOOP UNTIL (ABS(erreur) < .0000001 * ipref) OR (iter2% > 100) 'pente du point nominal zut = i0ref * expop * esgktref + csh pente = -zut / (1 + zut * rsref) erreur = pente + ipref / upref IF erreur > 0! THEN gamma2 = gamma ELSE gamma1 = gamma END IF IF (ABS(erreur) > .0001 * ipref / upref) AND (iter1% < nbiter%) THEN GOTO iter1 IF iter2% > 100 THEN CLS PRINT " nombre maximum d'it‚rations sur rsref atteint" INPUT in$ END IF IF iter1% > nbiter% THEN PRINT " nombre maximum d'it‚rations sur gamma d‚pass‚" INPUT in$ END IF PRINT " ParamŠtres internes calcul‚s pour Tref = "; tcref; " øC" PRINT PRINT " ilref = "; ilref; " A" PRINT " i0ref = "; i0ref; " A" PRINT " gamma = "; gamma PRINT " rsref = "; rsref; " ohms par cellule" PRINT PRINT -rsmax; " ohms < rs < "; rsmax; " ohms" PRINT " v‚rification du r‚gime nominal" PRINT " courant de jonction = "; ijonct; " A" zut = upref + ipref * rsref PRINT " courant fourni par le module = "; ilref - ijonct - zut * csh; PRINT " A au lieu de"; ipref; " A" PRINT " pente ="; pente; "au lieu de "; -ipref / upref; " A/V" GOSUB pourconti entree2: CLS PRINT "Coefficients de temp‚rature des valeurs nominales" PRINT basin "Coeff. de temp‚rature de la tension … vide duocsdtref", duocsdtref, "V/K" basin "Coeff. de temp‚rature du courant de c-c discsdtref", discsdtref, "A/K" esgktref = esk / gamma / tkref i0esgktref = i0ref * esgktref PRINT entcas: PRINT "Connaissez-vous le coefficient de temp‚rature de la puissance de"; PRINT " crˆte (0/1) (def"; cas%; ") ="; INPUT in$ IF in$ <> "" THEN cas% = VAL(in$) IF cas% < 0 OR cas% > 1 THEN GOTO entcas IF cas% = 1 THEN GOTO nouveau basin "Coefficient de temp‚rature de rs = ", drssdtref, " ohm/øK" PRINT " drssdtref ="; drssdtref; " ohm/øK" a(1, 1) = 1! a(1, 2) = 1! - expo0 zut = i0esgktref * expo0 + csh a(1, 3) = zut * (duocsdtref - uocref / tkref) a(2, 1) = 1! a(2, 2) = 1! - expocc zut = i0esgktref * expocc + csh zut1 = drssdtref * iscref + rsref * discsdtref - rsref * iscref / tkref a(2, 3) = discsdtref + zut * zut1 CALL minv(a(), 2, d, 3) dilsdtref = a(1, 3) di0sdtref = a(2, 3) GOTO derpar nouveau: basin "Coefficient de temp‚rature de la puissance de crˆte", dppsdtref, " W/K" a(1, 1) = 1! a(1, 2) = 1! - expo0 a(1, 3) = 0! a(1, 4) = 0! a(1, 5) = 0! zut = i0esgktref * expo0 * (duocsdtref - uocref / tkref) a(1, 6) = zut + csh * duocsdtref a(2, 1) = 1! a(2, 2) = 1! - expocc a(2, 3) = -(i0esgktref * expocc + csh) * iscref a(2, 4) = 0! a(2, 5) = 0! zut = rsref * (discsdtref - iscref / tkref) a(2, 6) = discsdtref + i0esgktref * expocc * zut + csh * rsref * discsdtref a(3, 1) = 1! a(3, 2) = 1! - expop a(3, 3) = -(i0esgktref * expop + csh) * ipref a(3, 4) = -(i0esgktref * expop + csh) a(3, 5) = -(i0esgktref * expop + csh) * rsref - 1! a(3, 6) = -i0esgktref * expop * (upref + rsref * ipref) / tkref a(4, 1) = 0! zut1 = esgktref * (upref - rsref * ipref) a(4, 2) = zut1 * expop zut = i0esgktref * expop a(4, 3) = (zut * (zut1 - 1!) - csh) * ipref a(4, 4) = (zut * (zut1 + 1!) + csh) a(4, 5) = (zut * (zut1 - 1!) - csh) * rsref - 1! zut2 = esgktref * (upref + rsref * ipref) a(4, 6) = zut * (zut2 + 1!) * (upref - rsref * ipref) / tkref a(5, 1) = 0! a(5, 2) = 0! a(5, 3) = 0! a(5, 4) = ipref a(5, 5) = upref a(5, 6) = dppsdtref CALL minv(a(), 5, det, 6) dilsdtref = a(1, 6) di0sdtref = a(2, 6) drssdtref = a(3, 6) dupsdtref = a(4, 6) dipsdtref = a(5, 6) PRINT GOSUB pourconti derpar: CLS PRINT " Effet de la temp‚rature sur les paramŠtres internes" PRINT PRINT "dilsdtref = "; dilsdtref; " A/K" PRINT "di0sdtref = "; di0sdtref; " A/K" PRINT "drssdtref = "; drssdtref; " ohm/K" IF cas% = 1 THEN PRINT PRINT "dupsdtref = "; dupsdtref; " V/K" PRINT "dipsdtref = "; dipsdtref; " A/K" END IF PRINT GOSUB pourconti entree3: CLS PRINT "mod‚lisation physique" PRINT PRINT " Mat‚riau : 1 pour le silicium cristallin" PRINT " 2 pour le silicium amorphe" PRINT PRINT " Votre choix (df"; choixmat%; ") :"; INPUT in$ IF in$ <> "" THEN choixmat% = VAL(in$) IF choixmat% <> 1 AND choixmat% <> 2 THEN GOTO entree3 IF choixmat% = 1 THEN gap0! = 1.16 gapa! = .000702 gapb! = 1108! ELSEIF choixmat% = 2 THEN gap0! = 1.7 gapa! = 0! gapb! = 0! END IF basin "Largeur de bande interdite … 0øK", gap0!, "V" basin "Coefficient gapalpha", gapa!, "" basin "Coefficient gapbeta", gapb!, "" PRINT egref = gap0! - gapa! * tkref * tkref / (tkref + gapb!) PRINT " largeur de bande interdite … "; tcref; " øC = "; egref; " V" PRINT zut = tkref + gapb! denom = zut * zut numer = tkref * (tkref + 2 * gapb!) degsdtref = -gapa! * numer / denom PRINT " coeff. de temp‚rature de la bande interdite : "; degsdtref; " V/K" PRINT GOSUB pourconti CLS denom = di0sdtref * tkref - i0esgktref * (egref - degsdtref * tkref) gammap = 3! * i0ref / denom beta = drssdtref * tkref / rsref PRINT PRINT " dilsdtref = "; dilsdtref; " A/K" PRINT " gammap = "; gammap PRINT " exposant de la r‚sistance beta ="; beta PRINT GOSUB pourconti menu: CLS COLOR 10 PRINT " paramŠtres de la cellule … "; tcref; " øC" PRINT PRINT " courant photog‚n‚r‚: "; ilref; " A" COLOR 12 PRINT " coeff. de temp‚rature du courant photog‚n‚r‚ : "; dilsdtref; " A/K" COLOR 10 PRINT " courant de fuite de la jonction : "; i0ref; " A" COLOR 12 PRINT " gammap = "; gammap COLOR 10 PRINT " gamma = "; gamma COLOR 12 PRINT " gamma est suppos‚ constant" COLOR 10 PRINT " r‚sistance s‚rie : "; rsref; " ohms" COLOR 12 PRINT " beta ="; beta COLOR 15 PRINT PRINT " menu principal" PRINT PRINT " entrez pour recommencer tout" PRINT " pour changer les valeurs par d‚faut" PRINT " pour changer les valeurs … temp‚rature de r‚f‚rence" PRINT " pour changer les coefficients de temp‚rature" PRINT " pour refaire la mod‚lisation physique" PRINT " pour calculer un point quelconque" PRINT " pour quitter le programme" INPUT menu$ IF menu$ = "r" OR menu$ = "R" THEN GOTO debut IF menu$ = "d" OR menu$ = "D" THEN GOTO entree0 IF menu$ = "c" OR menu$ = "C" THEN GOTO entree1 IF menu$ = "a" OR menu$ = "A" THEN GOTO entree2 IF menu$ = "m" OR menu$ = "M" THEN GOTO entree3 IF menu$ = "s" OR menu$ = "S" THEN GOTO analyse IF menu$ = "f" OR menu$ = "F" THEN GOTO fin GOTO menu analyse: CLS PRINT basin "Temp‚rature de travail", tc, "øC" il = ilref + dilsdtref * (tc - tcref) basin "courant photog‚n‚r‚ il = ", il, "A" tk = 273.15 + tc rs = rsref * (tk / tkref) ^ beta PRINT " r‚sistance s‚rie rs = "; rs; " ohms" eg = gap0! - gapa! * tk * tk / (tk + gapb!) zut = tk / tkref zut1 = EXP(esk / gamma * (egref / tkref - eg / tk)) i0 = i0ref * zut ^ (3! / gammap) * zut1 esgkt = esk / gamma / tk basin "Tension u", u, "V" IF u >= 0! THEN ujonctbas = 0! ujoncthaut = u + il * rs ELSE ujonctbas = u ujoncthaut = il * rs END IF DO ujonct = .5 * (ujoncthaut + ujonctbas) expo = EXP(esgkt * ujonct) ijonct = i0 * (expo - 1!) i = il - ijonct - csh * ujonct ut = ujonct - rs * i IF ut > u THEN ujoncthaut = ujonct ELSE ujonctbas = ujonct END IF LOOP UNTIL ABS(ujoncthaut - ujonctbas) < .0000001 PRINT PRINT " courant = "; i; " A" PRINT " puissance = "; u * i; " W" GOSUB pourconti GOTO menu pourconti: PRINT PRINT " pressez pour continuer"; INPUT in$ RETURN fin: END SUB basin (a$, g!, b$) PRINT " "; a$; " (df "; g!; " "; b$; ")= "; INPUT in$ IF in$ <> "" THEN g! = VAL(in$) END SUB SUB minv (a(), n1%, d, n2%) n% = n1% IF n2% < n1% THEN n% = n2% DIM ll%(1 TO n%), mm%(1 TO n%) d0# = 1! k% = 0 9800 : k% = k% + 1 biga = 0! FOR i% = k% TO n% FOR j% = k% TO n% IF ABS(biga) >= ABS(a(i%, j%)) THEN 9880 biga = a(i%, j%) ll%(k%) = i% mm%(k%) = j% 9880 : NEXT j% NEXT i% d0# = d0# * biga IF d0# = 0! THEN 10230 i% = ll%(k%) IF i% <= k% THEN 10000 d0# = -d0# FOR j% = 1 TO n2% hold = a(k%, j%) a(k%, j%) = a(i%, j%) a(i%, j%) = hold NEXT j% 10000 : j% = mm%(k%) IF j% <= k% THEN 10080 d0# = -d0# FOR i% = 1 TO n1% hold = a(i%, k%) a(i%, k%) = a(i%, j%) a(i%, j%) = hold NEXT i% 10080 : FOR i% = 1 TO n1% IF i% = k% THEN GOTO 10160 hold = -a(i%, k%) / biga a(i%, k%) = hold FOR j% = 1 TO n2% IF j% = k% THEN 10150 a(i%, j%) = a(i%, j%) + hold * a(k%, j%) 10150 : NEXT j% 10160 : NEXT i% FOR j% = 1 TO n2% IF j% = k% THEN GOTO 10200 a(k%, j%) = a(k%, j%) / biga 10200 : NEXT j% a(k%, k%) = 1! / biga IF k% < n% THEN 9800 10230 : k% = k% - 1 IF k% = 0 THEN 10400 i% = mm%(k%) IF i% <= k% THEN 10320 FOR j% = 1 TO n2% hold = a(k%, j%) a(k%, j%) = a(i%, j%) a(i%, j%) = hold NEXT j% 10320 : j% = ll%(k%) IF j% <= k% THEN 10230 FOR i% = 1 TO n1% hold = a(i%, k%) a(i%, k%) = a(i%, j%) a(i%, j%) = hold NEXT i% GOTO 10230 10400 : IF d0# <> 0! THEN 10420 PRINT "d‚terminant nul lors d'une inversion de matrice" 10420 : IF d0# > 1E+30 THEN d0# = 1E+30 IF d0# < -1E+30 THEN d0# = -1E+30 d = d0# END SUB