Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasPlacentino committed Jun 12, 2024
1 parent 9710940 commit ae3ccc1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion BA2/ANANUM/entrainementHeun2024.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

%%%fi = f(t(i),y(i)); % pour simplifier l'eq d'en dessous, pas besoin

y(i+1) = y(i) + (h/2)*( f(t(i),y(i)) + f(t(i+1), y(i) + h*f(t(i),y(i)) );
y(i+1) = y(i) + (h/2)*( f(t(i),y(i)) + f(t(i+1), y(i) + h*f(t(i),y(i)) ) );

endfor

Expand Down
32 changes: 16 additions & 16 deletions BA2/ANANUM/entrainementJuin2024.m
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,17 @@

% Faire un mesh:

F = @(x) [x(1).^2 - x(2) - 1; (x(1)-2).^2 + (x(2)-0.5).^2 - 1]
%Fp = @(x) [2.*x(1),-1; 2.*(x(1)-2), 2.*x(2)-1]
X = -1:0.1:3;
Y = -1:0.1:3;
for i = 1:length(X)
for j = 1:length(Y)
Z(i,j) = min(norm(F([X(i);Y(j)])),1); % ou min( ,0.5)
endfor
endfor
mesh(X,Y, Z) % (set(gca,'Zlim',[-0.5,0.5]) dans command window)
xlabel ("x"); ylabel ("y"); zlabel ("z")
##F = @(x) [x(1).^2 - x(2) - 1; (x(1)-2).^2 + (x(2)-0.5).^2 - 1]
##%Fp = @(x) [2.*x(1),-1; 2.*(x(1)-2), 2.*x(2)-1]
##X = -1:0.1:3;
##Y = -1:0.1:3;
##for i = 1:length(X)
## for j = 1:length(Y)
## Z(i,j) = min(norm(F([X(i);Y(j)])),1); % ou min( ,0.5)
## endfor
##endfor
##mesh(X,Y, Z) % (set(gca,'Zlim',[-0.5,0.5]) dans command window)
##xlabel ("x"); ylabel ("y"); zlabel ("z")

% puis on peut faire les Newton-Raphson avec x0 = [x,y] approximatif trouvés
% visuellement avec le mesh
Expand All @@ -272,11 +272,11 @@
%% 6 --- integration ---

% Trapèzes (Newton-Cotes d'ordre 1 en gros):
f = @(x) [];
a=
b=
ni= % nombre de sous-intervalles (entier > 0)
val = entrainementTrapezes2024(f,a,b,ni)
%f = @(x) [];
%a=
%b=
%ni= % nombre de sous-intervalles (entier > 0)
%val = entrainementTrapezes2024(f,a,b,ni)

% E_glob = (-1/12) * (b-a) * h^2 * f''(c) où c appartient à ]a,b[
% mais c ? on prend majorant, selon la fonction
Expand Down

0 comments on commit ae3ccc1

Please sign in to comment.