Response and Simulation in Matlab
Afficher commentaires plus anciens
Matlab program is under
clear all; format long e; % Solution de l'exercice 2.7 x0=1; y0=1; g0=x0^3-3*x0*y0^2-2*x0+2; h0=3*x0^2*y0-y0^3-2*y0; dgx0=3*x0^2-3*y0^2-2; dgy0=-6*x0*y0; dhx0=6*x0*y0; dhy0=3*x0^2-3*y0^2-2; J0=dgx0*dhy0-dhx0*dgy0; eta=1.e-12; critere=abs(g0)+abs(h0); n=0; while critere>eta n=n+1; % if J0~=0 x1=x0-(g0*dhy0-h0*dgy0)/J0; y1=y0-(h0*dgx0-g0*dhx0)/J0; x0=x1; y0=y1; dgx0=3*x0^2-3*y0^2-2; dgy0=-6*x0*y0; dhx0=6*x0*y0; dhy0=3*x0^2-3*y0^2-2; J0=dgx0*dhy0-dhx0*dgy0; g0=x0^3-3*x0*y0^2-2*x0+2; h0=3*x0^2*y0-y0^3-2*y0; critere=abs(g0)+abs(h0); % else % dispaly('Le jacobien prend la valeur 0! ') % break % end end solution=[x0; y0] iteration=n
Réponses (0)
Catégories
En savoir plus sur Structural Mechanics dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!