Mavzu: Tenglamalar sestemasini yechishning Zeydel va Nyuton usuli
Download 104.31 Kb.
|
#include using namespace std; int main() { float f1,f2,f1xhosila,f2xhosila,f1yhosila,f2yhosila,D, D1, D2,x[10],y[10]; int n; cout< cout<<"Ikkita chiziqsiz tenglamalar sistemasini taqribiy yechishda NYUTON usuli"< cout< x[0]=1; y[0]=0.5;
for(n=0; ;n++) {
f1=pow(x[n],2)-2*x[n]-y[n]+1; f1xhosila=2*x[n]-2; f1yhosila=-1;
f2xhosila=2*x[n]; f2yhosila=2*y[n];
D=f1xhosila*f2yhosila-f1yhosila*f2xhosila; D1=f1*f2yhosila-f2*f1yhosila;
D2=f2*f1xhosila-f1*f2xhosila; x[n+1]=x[n]-D1/D;
y[n+1]=y[n]-D2/D; cout<<"x["< if(sqrt(pow(x[n+1]-x[n],2)+pow(y[n+1]-y[n],2))<0.004) break;
}
|
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling