4-Amali mashg’ulot topshiriqlari 4-masala. Firma bosh og‘rig‘ini qoldiruvchi va o‘lchamdagi tabletkalarni ishlab chiqaradi. o‘lcham 2 dona asprin, 5 dona bikarbonat va 1 dona kodeinlardan tashkil topadi. o‘lcham 1 dona asprin, 8 dona bikarbonat va 6 dona kodeinlardan tashkil topgan. Iste’molchilar darhol samara berishi uchun kamida 12 dona aspirin, 74 dona bikarbonat va 24 dona kodein talab qilinishini aniqlashdi. Iste’molchilar darhol ta’sir qilishi uchun qabul qilishi mumkin bo‘lgan eng kam tabletkalar sonini aniqlash zarur. Ushbu masalani standart chiziqli dasturlash masalasi sifatida rasmiylashtiring
#include #include using namespace std;
int main() {
//Input Data
cout<<"\n\nUzgaruvchilar sonini kiriting..";
int n;
cin>>n;
double x[n];
int ER;
int c;
cout<<"\n\nTenglamalar sonini kiriting..";
cin>>c;
for(int i=0; iratio[i] = C[i][t]/C[i][Ce];
cout<}
//Compute min Ratio
cout<<"\n\n\nMinimum value f ratio is ";
ratio_min = 2500;
Re = 0;
for (int i=0; i if(ratio_min > fabs(ratio[i]) ){
ratio_min = fabs(ratio[i]) ;
Re = i;
}
}
cout< double Iter_C[c][t+1];
while(Zfin_max>0){
cout<<"\n\n\nIteration "<
//Entering column and exiting row
cout<<"\n\nEntering column is "<cout<<"\n\nKeyElement is "<Bv[Re] = Zc[Ce];
//Calculation for rows
// cout<<"\n\nEntering row coeff are ";
cout<<"\n\nFor entering row, old values and new values are ";
for(int i=0; i for(int j=0; j<=t; j++){
cout<}
cout<<"\n";
}
cout< return 0;
}
5 Amaliy mashg’ulot topshiriqlari Berilgan masalalarni simpleks usulda yechish algoritmini tuzing. Masalalarni matematik hisoblashlarni o’zingiz (qo’lda) bajaring va har bir qadamdagi simpleks jadvallarni keltiring
#include #include using namespace std;
int main() {
//Input Data
cout<<"\n\nUzgaruvchilar sonini kiriting..";
int n;
cin>>n;
double x[n];
int ER;
int c;
cout<<"\n\nTenglamalar sonini kiriting..";
cin>>c;
for(int i=0; iratio[i] = C[i][t]/C[i][Ce];
cout<}
//Compute min Ratio
cout<<"\n\n\nMinimum value f ratio is ";
ratio_min = 2500;
Re = 0;
for (int i=0; i if(ratio_min > fabs(ratio[i]) ){
ratio_min = fabs(ratio[i]) ;
Re = i;
}
}
cout< double Iter_C[c][t+1];
while(Zfin_max>0){
cout<<"\n\n\nIteration "<
//Entering column and exiting row
cout<<"\n\nEntering column is "<cout<<"\n\nKeyElement is "<Bv[Re] = Zc[Ce];
//Calculation for rows
// cout<<"\n\nEntering row coeff are ";
cout<<"\n\nFor entering row, old values and new values are ";