Précédent   Forum des professionnels en informatique > Autres langages > Pascal
Pascal Forum d'entraide sur la programmation en langage Pascal et sur les EDI. Avant de poster -> la F.A.Q Pascal, les cours
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 27/12/2011, 01h59   #1
Invité de passage
 
Homme
DUT genie informatique
Inscription : décembre 2011
Messages : 2
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : Sénégal

Informations professionnelles :
Activité : DUT genie informatique

Informations forums :
Inscription : décembre 2011
Messages : 2
Points : 0
Points : 0
Par défaut Résolution d'un système linéaire par la méthode de Gauss

Salut,
Voilà mon code mais en l'exécutant ça ne marche pas : je me suis arrêté juste à la triangularisation.
Code :
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
program resolution_Systeme_Lineaire;
uses crt;
var
	i,j,k,m,n,z,io:integer;
	q:real;
	matrice:array[1..10,1..10] of real;
	b:array[1..10] of real;
begin
clrscr;
{RAFETALLLL}
	begin
		writeln('**************************************************************************');
		writeln('****                              X                                  *****');
		writeln();
		writeln('   RESOlUTION SYSTEME LINEAIRE DE LA FORME Ax=b PAR LA METHODE DE GAUSS   ');
		writeln();
		writeln('****                              X                                  *****');
		writeln('**************************************************************************');
		writeln();
		writeln();
		delay(1000);
		clrscr;
		writeln('**************************************************************************');
		writeln('****                              X                                  *****');
		writeln();
		writeln('   RESOlUTION SYSTEME LINEAIRE DE LA FORME Ax=b PAR LA METHODE DE GAUSS   ');
		writeln();
		writeln('****                              X                                  *****');
		delay(1000);
		clrscr;
		writeln('**************************************************************************');
		writeln('****                              X                                  *****');
		writeln();
		writeln('   RESOlUTION SYSTEME LINEAIRE DE LA FORME Ax=b PAR LA METHODE DE GAUSS   ');
		writeln();
		writeln();
		delay(1000);
		clrscr;
		writeln();
		writeln();
		writeln('..:: RESOlUTION SYSTEME LINEAIRE DE LA FORME Ax=b PAR LA METHODE DE GAUSS ::.. ');
		writeln();
		writeln();
		delay(700);
		clrscr;
		delay(500);
 
 
{entrée nbre de ligne et de colonne}
		clrscr;
		write('entrer le nombre de ligne de la matrice  |---->  ');readln(m);
		write('entrer le nombre de colonne de la matrice  |---->  ');readln(n);
{entrée des données	de la matrice}
		writeln();
		writeln();
		writeln('entrer les Donnes de la Matrice   A');
	for i:=1 to m do
	begin
		for j:=1 to n do
		begin
		gotoxy(j*10,i+7);
		readln(matrice[i,j]);
 
		end;
		writeln();
		writeln();
		writeln();
	end;
 
		end;
{entrée des composant de b}
	begin
	writeln('donner les composant du vecteur ~ b ~ ');
	  for i:=1 to m do
		begin
			readln(b[i]);
		end;	
	end;
{afficher le sstm lineaire}
	{begin
		clrscr;
		writeln('le systeme lineaire est:');
		for i:=1 to m do
		begin
			for j:=1 to n do
			begin
				z:=j+1;
				gotoxy(j*7,i+2);
				writeln(matrice[i,j]:0:0,'y',j,'+',matrice[i,z]:0:0,'y',z,'=',b[i]:0:0);
			end;
		end;	
	end;}		
{Gauss}
begin
			k:=1;
	repeat
if matrice[k,k]<>0 then
	io:=k+1;	q:=matrice[io,k]/matrice[k,k];
		for i:=io to m do
		begin
			for j:= 1 to n-1 do
			begin
			matrice[i,j]:=matrice[i,j]-q*matrice[k,j];
			b[io]:=b[io]-q*b[k];
			end;
		end;
		k:=k+1;
	until k=n	
end;
clrscr;
for i:=1 to m do
begin
for j:=1 to n do
begin
gotoxy(j*10,i+3);
writeln(matrice[i,j]:0:0);
end;
end;
end.
nureyni est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 18h53.


 
 
 
 
Partenaires

Hébergement Web