Форум — Development помогите!!!! 0 0 Вычислить несобственный интеграл от 0 до бесконечности е в степени -2x. Пробовала разложением в ряд, не очень получилось:(( Люди, выручайте!!! Ссылка
e^(-2x) == (-0.5*e^(-2x))' дальше продолжать, знаток разложений в ряды? anonymous (13.01.08 11:14:48 MSK) Ссылка
// test.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <cmath> const double DELTA = 1e-3; const double DELTA_MULTIPLIER = 2; const double INCREASE_DELTA_CONDITION = 1e-4; double f(double x); int _tmain(int argc, _TCHAR* argv[]) { double prev_result; double result = 0; double x = 0; double delta = DELTA; unsigned counter = 0; for (;;) { prev_result = result; result += delta * f(x + delta / 2); x += delta; if (result - prev_result < INCREASE_DELTA_CONDITION) { delta *= DELTA_MULTIPLIER; } if (++counter > 100) { printf("%.20f %.20f %.20f\n", result, x, delta); getchar(); counter = 0; } } return 0; } double f(double x) { return exp(-(x * x)); } У меня получилось стремление к 0.88621122322029700000 anonymous (13.01.08 12:56:32 MSK) Показать ответ Ссылка
// test.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <cmath> const double DELTA = 1e-3; const double DELTA_MULTIPLIER = 2; const double INCREASE_DELTA_CONDITION = 1e-4; double f(double x); int _tmain(int argc, _TCHAR* argv[]) { double prev_result; double result = 0; double x = 0; double delta = DELTA; unsigned counter = 0; for (;;) { prev_result = result; result += delta * f(x + delta / 2); x += delta; if (result - prev_result < INCREASE_DELTA_CONDITION) { delta *= DELTA_MULTIPLIER; } if (++counter > 100) { printf("%.20f %.20f %.20f\n", result, x, delta); getchar(); counter = 0; } } return 0; } double f(double x) { return exp(-(x * x)); } У меня получилось стремление к 0.88621122322029700000 anonymous (13.01.08 12:57:09 MSK) Показать ответы Ссылка
Ответ на: комментарий от anonymous 13.01.08 12:57:09 MSK тока не -x*x, а -2*x anonymous (13.01.08 13:02:24 MSK) Показать ответ Ссылка
Ответ на: комментарий от anonymous 13.01.08 12:57:09 MSK >#include "stdafx.h" >int _tmain(int argc, _TCHAR* argv[]) охтунг... generatorglukoff ★★ (13.01.08 13:07:50 MSK) Показать ответы Ссылка
Ответ на: комментарий от anonymous 13.01.08 13:02:24 MSK Блин, перепутал. Тогда 0.5 получается. anonymous (13.01.08 13:22:01 MSK) Ссылка
Ответ на: комментарий от generatorglukoff 13.01.08 13:07:50 MSK cat > stdafx.h << EOF #define _tmain main #define _TCHAR char EOF где ахтунг то? anonymous (13.01.08 13:37:00 MSK) Показать ответы Ссылка
Ответ на: комментарий от anonymous 13.01.08 13:37:00 MSK >где ахтунг то? в запутывании кода и попытках изкривить стандарты. эти переобозначения не нужны в принципе generatorglukoff ★★ (13.01.08 13:44:35 MSK) Ссылка
Ответ на: комментарий от anonymous 13.01.08 13:37:00 MSK > cat > stdafx.h << EOF #define _tmain main #define _TCHAR char EOF смысл? asgard ★ (13.01.08 15:50:37 MSK) Показать ответ Ссылка
Ответ на: комментарий от asgard 13.01.08 15:50:37 MSK Просто это стандартно VS2005 рожает =) theos ★★★ (13.01.08 16:29:18 MSK) Ссылка
Ответ на: комментарий от generatorglukoff 13.01.08 13:07:50 MSK +1 anonymous (13.01.08 20:15:18 MSK) Ссылка
Ответ на: комментарий от anonymous 13.01.08 12:56:32 MSK #include "stdafx.h" int _tmain(int argc, _TCHAR* argv[]) ГГГ тру линуксоид )) aton ★ (14.01.08 18:31:29 MSK) Ссылка
Это же п***ц, господа! Такими темпами скоро и секретаршу толковую не найдешь! cobold ★★★★★ (15.01.08 01:33:26 MSK) Ссылка
Никто тебе не поможет. Одиночество. Уныние. Беспомощность. Страх. Неизвесность. Равнодушие. СЕССИЯ! bugmaker ★★★★☆ (15.01.08 01:53:28 MSK) Ссылка