Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*#########################
- Нелинейный случай
- ###########################*/
- // пока omega = 0
- double del; // нужно для нормы
- double x = x_begin; // тоже нужно для нормы
- begin_value(V, length);
- for (int i = 0; i < n; ++i)
- {
- begin_value_pristrel(V_pr, length);
- V_pr[0] = 1;
- V_pr[m-1] = 0;
- while (norma_for_G > 1e-12) {
- // printf("%g - NORMAAAAAAAAAAAAAAAAAAAAAAAAAA GGGGGGGGGGGGG\n\n", norma_for_G);
- matrix_G(&V_pr, &G_1, &V);
- equal_G2_G1(&G_1, &G_2);
- matrix_J(&U_1, &U_2, &V_pr, &G_2);
- new_vector_X(&U_1, &U_2, &G_2, &X);
- new_V_pr(&X, &V_pr);
- matrix_G(&V_pr, &G_1, &V); // изменение G для нового вектора пристреленного
- norma_for_G = norma_G(&G_1);
- }
- norma_for_G = 1;
- norma_DELTA_c_line = 0; norma_delta_c_line = 0; //начальное максимальное значение [c]
- norma_DELTA_l_line = 0; norma_delta_l_line = 0; //начальное значение [l]
- for (int j = 0; j < m-1; ++j)
- {
- del = delta_nel(V_pr[j], x_by_stepx(j), (i+1)*tao); // разность между численным решением и точным решением
- printf("%s %f %f %f \n", "X and T and del",x_by_stepx(j), (i+1)*tao, del);
- norma_c(del, &norma_DELTA_c_line); //[c]
- norma_c(V_pr[j], &norma_delta_c_line); //[c]
- norma_l(del, &norma_DELTA_l_line); //[l]
- norma_l(V_pr[j], &norma_delta_l_line); //[l]
- }
- print_block(V_pr, m);
- equal_V_Vpr(&V, &V_pr);
- printf("I : %d\n", i);
- }
- printf("tao h DeltaC DeltaL deltaC delta l\n");
- printf("%g & %g & %e & %e & %e & %e \n", tao, h, norma_DELTA_c_line, h*norma_DELTA_l_line, norma_DELTA_c_line/norma_delta_c_line, norma_DELTA_l_line/norma_delta_l_line);
- // print_block_to_file(V_pr, length, fout);
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement