Разработка программы численного интегрирования обыкновенного дифференциального уравнения явным модифицированным методом Эйлера

Разработка прикладного программного обеспечения для решения расчетных задач для компьютера. Численное интегрирование - вычисление значения определённого интеграла. Проектирование алгоритма численного метода. Тестирование работоспособности программы.

Рубрика Программирование, компьютеры и кибернетика
Вид курсовая работа
Язык русский
Дата добавления 03.08.2011
Размер файла 1,1 M

Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже

Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.

Размещено на http://www.allbest.ru/

Министерство образования РБ

Министерство образования и науки РФ

Белорусско-российский университет

Кафедра “Электропривод и АПУ”

Курсовая работа

по дисциплине “Информатика”

Тема работы

“Разработка программы численного интегрирования обыкновенного дифференциального уравнения явным модифицированным методом Эйлера”

Выполнил: Студент гр. ЭОАР-083

Захаренко Н.Н.

Проверил: Овсянников К.В.

Могилев 2009

Оглавление

  • Введение
  • 1. Описание поставленной задачи
  • 1.1 Краткая характеристика численного метода
  • 1.2 Анализ литературы и программ, патентный поиск
  • 1.3 Формирование требований к программе
  • 2. Проектирование схем алгоритмов
  • 2.1 Разработка алгоритма головной программы
  • 2.2 Проектирование алгоритма ввода исходных данных
  • 2.3 Разработка алгоритма вывода результатов
  • 2.4 Проектирование алгоритма численного метода
  • 3. Кодирование программы в среде программирования
  • 3.1 Разработка структуры программирования
  • 3.2 Разработка интерфейса пользователя
  • 3.3 Программирование ввода-вывода данных
  • 3.4 Программная реализация численного метода
  • 4. Тестирование работоспособности программы
  • 4.1 Расчет тестового примера
  • 4.4 Тестовый расчет, сравнение с тестовым примером
  • Заключение
  • Список литературы
  • Приложение А

Введение

Современное состояние науки и техники требует от инженерно-технических и научных работников знания средств вычислительной техники и умения обращения с современными программно-техническими комплексами. Эффективное использование компьютеров для решения инженерных и научных задач невозможно без знаний основных методов составления схем алгоритмов, написания эффективного программного обеспечения на языке программирования, использования пакетов программ инженерной графики, использования математических систем.

Цель данной курсовой работы - закрепление на практике знаний, полученных при изучении курса "Информатика", и приобретение опыта самостоятельной разработки прикладного программного обеспечения для решения расчетных задач для персонального компьютера.

1. Описание поставленной задачи

Численное интегрирование - вычисление значения определённого интеграла, основанное на том, что величина интеграла численно равна площади криволинейной трапеции, ограниченной осью абсцисс, графиком интегрируемой функции и отрезками прямых.

Необходимость применения численного интегрирования чаще всего может быть вызвана отсутствием у первообразной функции представления в элементарных функциях и, следовательно, невозможностью аналитического вычисления значения определённого интеграла по формуле Ньютона-Лейбница. Также возможна ситуация, когда вид первообразной настолько сложен, что быстрее вычислить значение интеграла численным методом.

1.1 Краткая характеристика численного метода

Разработка программы численного интегрирования обыкновенного дифференциального уравнения явным модифицированным методом Эйлера.

В этом методе в точках (Xn, Yn) и (Xn+1, Yn+1) используется значение угла наклона касательной в точке (Xn+1/2, Yn+1/2), расположенной посередине между точками Xn и Xn+1.

Как и ранее, предполагается известным значения решения Yn в точке Xn.

Метод состоит из двух шагов:

1) Первый шаг - расчет значения функции Yn+1/2 в точке (Xn+h/2) по методу Эйлера

(Yn+1=Yn+hf (Xn, Yn), n=1,2,…,N)

Yn+1/2=Yn+f (Xn, Yn) (1.1)

2) Второй шаг - расчет функции y в точке с координатой xn+1 с использованием значения функции

F (xn+1/2,yn+1/2) в точке (xn+1/2,yn+1/2):

Yn+1=Yn+hf (xn+h/2, Yn+1/2) (1.2)

Таким образом, расчетные формулы имеют следующий вид:

Yn+1/2=Yn+f (Xn, Yy) (1.3)

Yn+1=Yn+hf (xn+, Yn+f (Xn,, Yn)) (1.4)

Обозначив через k1=f (Xn, Yn), k2=f (Xn+h/2, Yn+hk 1/2), метод можно представить в обычном для методов Рунге-Кутта виде:

(1.5)

Этот метод также является методом Рунге-Кутта второго порядка. Здесь тоже приходится вычислять дважды функцию f (x, y) для получения решения в следующей точке Xn+1.

Для анализа погрешности численного решения модифицированным методом Эйлера получим точное решение задачи Коши для модельного уравнения

u? = лu при x > 0; u (0) = a (1.6)

где a, л - некоторые константы.

программа численное интегрирование

Формула модифицированного метода Эйлера (1.4) для уравнения (1.6) имеет вид

Yn+1=Yn+h+hYn (л+hл2/2) =Yn (1+hл+h2л2/2), (1.7)

так как в данном случае

f (x,y) = лy, то f (Xn+, Yn+f (Xn,,Yn)) = л (Yn+hлYn/2) (1.8)

Таким образом, точное решение уравнения (1.4) для модельного уравнения (1.6) в точке Xn+1 имеет вид

Yn+1=a (1+hл+h2л2/2) n+1 (1.9)

В то же время точное решение дифференциального уравнения (1.6) есть , которое при x = h можно разложить в ряд Тейлора в окрестности точки x = 0:

u=a (1+hл+) (1.10)

Из сопоставления уравнений (1.9) и (1.10) видно, что численное решение задачи (1.6) представляет собой три первых члена разложения функции в ряд Тейлора, то есть точного решения дифференциального уравнения (1.6), и ошибка его |un-yn| возрастает с увеличением x при л > 0.

В случае л < 0 уравнение (1.6) будет иметь асимптотически устойчивое решение, затухающее с увеличением x , тогда как численное решение

при h > 2/| л | (1.11)

с увеличением n неограниченно возрастает. Это явление называют частичной неустойчивостью, и проявляется оно с увеличением h, начиная с некоторого h > hk, во всех явных методах типа Рунге-Кутта. Явление это не следует путать с неустойчивостью разностной схемы (метода), которая проявляется при уменьшении шага интегрирования h.

Следует отметить, что явление частичной неустойчивости в явных методах Рунге-Кутта проявляется и при решении уравнений, не имеющих асимптотически устойчивых решений. В этих случаях частичная неустойчивость затушевывается ростом самого решения.

Рис.1 Модифицированный метод Эйлера.

1.2 Анализ литературы и программ, патентный поиск

Проанализировав, литературу получили, итоговые математические выражения:

Yn+1/2=Yn+f (Xn, Yy) Yn+1=Yn+hf (xn+, Yn+f (Xn,, Yn))

Yn+1=Yn+h+hYn (л+hл2/2) =Yn (1+hл+h2л2/2),

при h > 2/| л |

Для решения данной задачи будем использовать систему программирования MS Visual Studio.

Используемая литература В.И. Мышенков, Е.В. Мышенков. Численные методы. Часть вторая. Численное решение обыкновенных дифференциальных уравнений. Стр.12 Ссылка в интернете http://evm. a18. nthosting.ru/chislmet2. pdf.

1.3 Формирование требований к программе

1) Операционная система - Microsoft Windows 95/98/XP/Vista/7;

2) Системные требования (минимальные): процессор с тактовой частотой 900 МГц, оперативная память 128 МБ, 5 МБ свободного места на жестком диске, встроенный видеоадаптер, клавиатура, мышь;

3) Программа должна вычислять дифференциальное уравнение по Модифицированному методу Эйлера, вводимыми данными будут являться:

уравнение которое нужно решить, X0,Y0,E, промежуток на котором будет производиться расчет.

4) проверка корректности введенных данных выполняется с помощью встроенного метода обработки исключений “try-catch”;

5) расчетное выражение задается с помощью полей ввода, расположенных на главной форме приложения;

6) Значения Y получаемые в процессе решения уравнения будут являться решением данного метода;

7) Процесс выполнения расчета не отображается;

8) Пользователь не может прервать выполнение расчета, если данные введены некорректно программа автоматически сообщит об ошибке;

9) Результаты расчета показываются в специальных полях.

2. Проектирование схем алгоритмов

2.1 Разработка алгоритма головной программы

Схема алгоритма головной программы разрабатывается с учетом интерактивного характера проектируемой программы-приложения. Поэтому следует учитывать событийный характер функционирования программы. При этом каждому возможному событию соответствует вызов определенного обработчика. Программа-приложение должна иметь обработчики следующих событий:

1) ввод исходных данных задачи;

2) расчет задачи;

3) вывод результатов расчетов;

4) получение справочной информации.

Рисунок 2.1 - Общая схема приложения.

2.2 Проектирование алгоритма ввода исходных данных

Для расчета интеграла численным методом, понадобятся некоторые численные значения: пределы интегрирования, коэффициенты для определения вида интеграла. Значения вводятся с клавиатуры в специально отведенные поля и проверяются на корректность, в случае неправильности введенных данных на экран выводится сообщение об ошибке.

Рисунок 2.2 - Схема ввода данных.

2.3 Разработка алгоритма вывода результатов

Рисунок 2.3 - Схема вывода данных.

2.4 Проектирование алгоритма численного метода

Для расчета численным методом будут использоваться данные введенные с клавиатуры значения. Будут использоваться циклы for и операторы условия if. Рассчитанный результат будет выведен на экран.

Рисунок 2.4 - Схема алгоритма численного метода.

3. Кодирование программы в среде программирования

Согласно заданию, текст программы разрабатывается на языке программирования высокого уровня С#, на основе алгоритма программы. Для удобства работы запись исходных данных осуществляется с клавиатуры, а результат выводиться на монитор.

3.1 Разработка структуры программирования

В программе используется три формы:

MainForm - главная форма приложения, на ней расположены все необходимые элементы для полноценной работы программы.

SaveForm - форма которая выводится в случае успешного сохранения вводимых и выводимых.

ExitForm - форма которая подтверждает выход из программы.

В состав пакета входят следующие файлы: app. config, MainForm. cs, MainForm. resx, MainForm. Designer. cs, Program. cs.

3.2 Разработка интерфейса пользователя

Проектируемая программа имеет стандартный интерфейс, разработанный при помощи Windows Forms. (рисунки 3.1 - 3.3).

Рисунок 3.1 - Главная форма

Кнопка "Расчет" запускает расчет обыкновенного дифференциального уравнения Модифицированным методом Эйлера.

Кнопка "Сохранить" выполняет сохранение вида вводимых данных и результатов расчета в текстовый файл, в случае успешного сохранения пользователю выводится сообщение (рис.3.2)

Кнопка "Выход" запускает форму подтверждения выхода из программы и запускает процесс выхода из программы.

Рисунок 3.2 - Форма оповещения об успешном сохранении.

В следствии нажатии клавиши "Выход" пользователю выводится сообщение о выходе из программы.

Рисунок 3.3 - Форма выхода из приложения.

Структура интерфейса каждой формы описана в приложении А.

3.3 Программирование ввода-вывода данных

Ввод и вывод данных осуществляется с помощью главной формы. Введенные в поля данные преобразуются из строкового типа в численные и обратно с помощью встроенной функции "Convert" (Convert. ToDouble, Convert. ToString).

3.4 Программная реализация численного метода

Текст программной реализации численного метода в приложении A.

4. Тестирование работоспособности программы

Цель выполнения данного раздела - проверка работоспособности разработанной при выполнении предыдущего раздела программы.

4.1 Расчет тестового примера

1) тестирование устойчивости, проверка устойчивости программы на некорректный ввод данных.

При вводе букв, символов в поля для ввода программа будет выводить сообщение об ошибке.

2) для тестирования функциональности использовалось следующее дифференциальное уравнение y'=2x-y удовлетворяющего начальному условии

Y0=-1 при X0=0 на отрезке [0,1] с точностью E=10-2. Рассчитаем это уравнение по модифицированному методу Эйлера.

При k=1

Т.к. получили

При k=2

Т.к. получили

При k=3

Т.к. получили

Аналогично вычислим , .

Таблица 1 - Результаты полученные в ходе решения уравнения

k

0

1

2

3

4

5

Xk

0

0.2

0.4

0.6

0.8

1

Yk

-1

-.784

-.529

-.242

0.069

0.399

3) вычислительный процесс устойчив, время реакции на команды пользователя и скорость вычислений удовлетворительные, интерфейс понятен пользователю.

4.4 Тестовый расчет, сравнение с тестовым примером

Как показал расчет вручную, результат вычисления дифференциального уравнения совпал с результатом вычисления на компьютере.

Рассчитано в ручную:

k

0

1

2

3

4

5

Xk

0

0.2

0.4

0.6

0.8

1

Yk

-1

-.784

-.529

-.242

0.069

0.399

Рассчитано на компьютере:

k

0

1

2

3

4

5

Xk

0

0.2

0.4

0.6

0.8

1

Yk

-1

-.784

-.529

-.242

0.069

0.399

Заключение

В результате выполнения курсовой работы было произведено математическое описания задачи решения дифференциального уравнения модифицированным методом Эйлера, разработана схема алгоритма и написана программа решения на языке программирования С#. В программе предусмотрена обработка большого количества ошибок ввода пользователя, проведенное тестирование показало правильность результатов вычисления. Разработанная программа может использоваться для решения дифференциального уравнения модифицированным методом Эйлера.

Список литературы

1. Мышенков В.И., Мышенков Е.В. Численные методы. Часть вторая. Решение обыкновенных дифференциальных уравнений 109с.

2. Методические указания и задания к курсовому проектированию для студентов специальности 140607 "Электрооборудование автомобилей и тракторов". Могилев 2009г. Сост. В.Н. Абабурко, К.В. Овсянников - Могилев: Белорус. - Рос. ун-т, 2005. - 25 с.

Приложение А

Программный код

AssemblyInfo. cs

using System. Reflection;

using System.runtime.compilerServices;

using System.runtime. InteropServices;

[assembly: AssemblyTitle ("Test_solution")]

[assembly: AssemblyDescription ("")]

[assembly: AssemblyConfiguration ("")]

[assembly: AssemblyCompany ("")]

[assembly: AssemblyProduct ("Test_solution")]

[assembly: AssemblyCopyright ("")]

[assembly: AssemblyTrademark ("")]

[assembly: AssemblyCulture ("")]

[assembly: ComVisible (false)]

[assembly: AssemblyVersion ("1.0. *")]

MainForm. cs

using System;

using System. Collections. Generic;

using System. Drawing;

using System. Windows. Forms;

using System. IO;

namespace Test_solution

{

public partial class MainForm: Form

{

public static void Main (string [] args)

{

Application. EnableVisualStyles ();

Application. SetCompatibleTextRenderingDefault (false);

Application.run (new MainForm ());

}

public MainForm ()

{

InitializeComponent ();

}

double A, B, C, s1, s2, Yo, Xo, E, b, h, n,f,g;

double [] X = new double [100];

double [] Y = new double [100];

string [] str_k = new string [100];

string [] str_X = new string [100];

string [] str_Y = new string [100];

void Button1Click (object sender, EventArgs e)

{

try

{

A = Convert. ToDouble (textBox1. Text);

s1 = Convert. ToDouble (textBox2. Text);

B = Convert. ToDouble (textBox3. Text);

s2 = Convert. ToDouble (textBox4. Text);

C = Convert. ToDouble (textBox10. Text);

Yo = Convert. ToDouble (textBox5. Text);

Xo = Convert. ToDouble (textBox6. Text);

E = Convert. ToDouble (textBox7. Text);

b = Convert. ToDouble (textBox9. Text);

f = Convert. ToDouble (textBox11. Text);

g = Convert. ToDouble (textBox12. Text);

h = Math. Pow (E,0.333);

n = Math. Round ( (b - Xo) /h);

for (int k = 0; k <= n; k ++)

{

if (k! = 0)

{

X [k] = Math. Round (X [k - 1] + h, 1);

Y [k] =Math. Round (Y [k-1] + h/2 * ( (A*Math. Pow (X [k-1],s1) /f+B*Math. Pow (Y [k-1],s2) /g+C) + (A * Math. Pow (X [k-1], s1) /f + B * Math. Pow (Y [k-1], s2) /g + C)),3);

}

else

{

Y [k] = Yo + h * ( (A * Math. Pow (X [k], s1) /f + B * Math. Pow (Y [k], s2) /g + C));

}

str_k [k] = k. ToString ();

str_X [k] = X [k]. ToString ();

str_Y [k] = Y [k]. ToString ();

}

richTextBox1. Lines = str_k;

richTextBox2. Lines = str_X;

richTextBox3. Lines = str_Y;

}

catch (System. Exception exception_text)

{

Form exception_form = new ThreadExceptionDialog (exception_text);

exception_form. Show ();

}

}

void TextBox6TextChanged (object sender, EventArgs e)

{

textBox8. Text = textBox6. Text;

}

void button2_Click (object sender, EventArgs e)

{

try

{

A = Convert. ToDouble (textBox1. Text);

s1 = Convert. ToDouble (textBox2. Text);

B = Convert. ToDouble (textBox3. Text);

s2 = Convert. ToDouble (textBox4. Text);

C = Convert. ToDouble (textBox10. Text);

Yo = Convert. ToDouble (textBox5. Text);

Xo = Convert. ToDouble (textBox6. Text);

E = Convert. ToDouble (textBox7. Text);

b = Convert. ToDouble (textBox9. Text);

f = Convert. ToDouble (textBox11. Text);

g = Convert. ToDouble (textBox12. Text);

Form Save = new Save ();

Save. ShowDialog ();

StreamWriter sw = File. CreateText ("Эйлер-Коши (вводимые данные). txt");

sw. WriteLine (A + "");

sw. WriteLine (s1 + "");

sw. WriteLine (b + "");

sw. WriteLine (s2 + "");

sw. WriteLine (C + "");

sw. WriteLine (Yo + "");

sw. WriteLine (Xo + "");

sw. WriteLine (E + "");

sw. WriteLine (b + "");

sw. WriteLine (f + "");

sw. WriteLine (g + "");

sw. Close ();

StreamWriter sw1 = File. CreateText ("Эйлер-Коши (выводимые данные). txt");

sw1. WriteLine (richTextBox1. Text + "");

sw1. WriteLine (richTextBox2. Text + "");

sw1. WriteLine (richTextBox3. Text + "");

sw1. Close ();

}

catch (System. Exception exception_text)

{

Form exception_form = new ThreadExceptionDialog (exception_text);

exception_form. Show ();

}

}

private void button3_Click (object sender, EventArgs e)

{

Form Form_exit = new Form_exit ();

Form_exit. ShowDialog ();

this. Close ();

}

}

}

MainForm. Designer. cs

namespace Test_solution

{

partial class MainForm

{

private System.componentModel. IContainer components = null;

protected override void Dispose (bool disposing)

{

if (disposing) {

if (components! = null) {

components. Dispose ();

}

}

base. Dispose (disposing);

}

private void InitializeComponent ()

{

System.componentModel.componentResourceManager resources = new System.componentModel.componentResourceManager (typeof (MainForm));

this. textBox1 = new System. Windows. Forms. TextBox ();

this. label1 = new System. Windows. Forms. Label ();

this. textBox2 = new System. Windows. Forms. TextBox ();

this. textBox3 = new System. Windows. Forms. TextBox ();

this. label2 = new System. Windows. Forms. Label ();

this. label3 = new System. Windows. Forms. Label ();

this. textBox4 = new System. Windows. Forms. TextBox ();

this. label4 = new System. Windows. Forms. Label ();

this. textBox5 = new System. Windows. Forms. TextBox ();

this. label5 = new System. Windows. Forms. Label ();

this. textBox6 = new System. Windows. Forms. TextBox ();

this. label6 = new System. Windows. Forms. Label ();

this. textBox7 = new System. Windows. Forms. TextBox ();

this. textBox8 = new System. Windows. Forms. TextBox ();

this. textBox9 = new System. Windows. Forms. TextBox ();

this. label7 = new System. Windows. Forms. Label ();

this. label8 = new System. Windows. Forms. Label ();

this. label9 = new System. Windows. Forms. Label ();

this. button1 = new System. Windows. Forms. Button ();

this. label10 = new System. Windows. Forms. Label ();

this. label11 = new System. Windows. Forms. Label ();

this. label12 = new System. Windows. Forms. Label ();

this. textBox10 = new System. Windows. Forms. TextBox ();

this. label13 = new System. Windows. Forms. Label ();

this. richTextBox1 = new System. Windows. Forms. RichTextBox ();

this. richTextBox2 = new System. Windows. Forms. RichTextBox ();

this. richTextBox3 = new System. Windows. Forms. RichTextBox ();

this. label14 = new System. Windows. Forms. Label ();

this. label15 = new System. Windows. Forms. Label ();

this. label16 = new System. Windows. Forms. Label ();

this. textBox11 = new System. Windows. Forms. TextBox ();

this. textBox12 = new System. Windows. Forms. TextBox ();

this. label17 = new System. Windows. Forms. Label ();

this. label18 = new System. Windows. Forms. Label ();

this. label19 = new System. Windows. Forms. Label ();

this. label20 = new System. Windows. Forms. Label ();

this. label21 = new System. Windows. Forms. Label ();

this. label22 = new System. Windows. Forms. Label ();

this. label23 = new System. Windows. Forms. Label ();

this. button2 = new System. Windows. Forms. Button ();

this. button3 = new System. Windows. Forms. Button ();

this. SuspendLayout ();

//

// textBox1

//

this. textBox1. Location = new System. Drawing. Point (164,12);

this. textBox1. Name = "textBox1";

this. textBox1. Size = new System. Drawing. Size (40, 20);

this. textBox1. TabIndex = 1;

this. textBox1. Text = "2";

//

// label1

//

this. label1. Font = new System. Drawing. Font ("Tahoma", 8.25F, System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, ( (byte) (204)));

this. label1. Location = new System. Drawing. Point (210, 15);

this. label1. Name = "label1";

this. label1. Size = new System. Drawing. Size (10, 20);

this. label1. TabIndex = 2;

this. label1. Text = "";

this. label1. TextAlign = System. Drawing. ContentAlignment. TopCenter;

//

// textBox2

//

this. textBox2. Location = new System. Drawing. Point (242,2);

this. textBox2. Multiline = true;

this. textBox2. Name = "textBox2";

this. textBox2. Size = new System. Drawing. Size (15, 20);

this. textBox2. TabIndex = 2;

this. textBox2. Text = "1";

//

// textBox3

//

this. textBox3. Location = new System. Drawing. Point (313, 13);

this. textBox3. Name = "textBox3";

this. textBox3. Size = new System. Drawing. Size (40, 20);

this. textBox3. TabIndex = 3;

this. textBox3. Text = "-1";

//

// label2

//

this. label2. Font = new System. Drawing. Font ("Tahoma", 8.25F, System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, ( (byte) (204)));

this. label2. Location = new System. Drawing. Point (359, 13);

this. label2. Name = "label2";

this. label2. Size = new System. Drawing. Size (10, 20);

this. label2. TabIndex = 2;

this. label2. Text = "";

this. label2. TextAlign = System. Drawing. ContentAlignment. TopCenter;

//

// label3

//

this. label3. Font = new System. Drawing. Font ("Microsoft Sans Serif", 8.25F, System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, ( (byte) (204)));

this. label3. Location = new System. Drawing. Point (118,12);

this. label3. Name = "label3";

this. label3. Size = new System. Drawing. Size (40, 20);

this. label3. TabIndex = 4;

this. label3. Text = "Y\' = ";

this. label3. TextAlign = System. Drawing. ContentAlignment. MiddleCenter;

//

// textBox4

//

this. textBox4. Location = new System. Drawing. Point (391,2);

this. textBox4. Multiline = true;

this. textBox4. Name = "textBox4";

this. textBox4. Size = new System. Drawing. Size (15, 20);

this. textBox4. TabIndex = 4;

this. textBox4. Text = "1";

//

// label4

//

this. label4. Font = new System. Drawing. Font ("Microsoft Sans Serif", 8.25F, System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, ( (byte) (204)));

this. label4. Location = new System. Drawing. Point (8, 75);

this. label4. Name = "label4";

this. label4. Size = new System. Drawing. Size (40, 20);

this. label4. TabIndex = 4;

this. label4. Text = "Yo = ";

this. label4. TextAlign = System. Drawing. ContentAlignment. MiddleCenter;

//

// textBox5

//

this. textBox5. Location = new System. Drawing. Point (54, 76);

this. textBox5. Name = "textBox5";

this. textBox5. Size = new System. Drawing. Size (40, 20);

this. textBox5. TabIndex = 5;

this. textBox5. Text = "-1";

//

// label5

//

this. label5. Font = new System. Drawing. Font ("Microsoft Sans Serif", 8.25F, System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, ( (byte) (204)));

this. label5. Location = new System. Drawing. Point (8, 102);

this. label5. Name = "label5";

this. label5. Size = new System. Drawing. Size (40, 20);

this. label5. TabIndex = 4;

this. label5. Text = "Xo = ";

this. label5. TextAlign = System. Drawing. ContentAlignment. MiddleCenter;

//

// textBox6

//

this. textBox6. Location = new System. Drawing. Point (54, 102);

this. textBox6. Name = "textBox6";

this. textBox6. Size = new System. Drawing. Size (40, 20);

this. textBox6. TabIndex = 6;

this. textBox6. Text = "0";

this. textBox6. TextChanged += new System. EventHandler (this. TextBox6TextChanged);

//

// label6

//

this. label6. Font = new System. Drawing. Font ("Microsoft Sans Serif", 12F, System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, ( (byte) (204)));

this. label6. Location = new System. Drawing. Point (225, 74);

this. label6. Name = "label6";

this. label6. Size = new System. Drawing. Size (40, 20);

this. label6. TabIndex = 4;

this. label6. Text = "? = ";

this. label6. TextAlign = System. Drawing. ContentAlignment. MiddleCenter;

//

// textBox7

//

this. textBox7. Location = new System. Drawing. Point (271, 75);

this. textBox7. Name = "textBox7";

this. textBox7. Size = new System. Drawing. Size (40, 20);

this. textBox7. TabIndex = 7;

this. textBox7. Text = "0,01";

//

// textBox8

//

this. textBox8. Location = new System. Drawing. Point (28, 163);

this. textBox8. Name = "textBox8";

this. textBox8. ReadOnly = true;

this. textBox8. Size = new System. Drawing. Size (20, 20);

this. textBox8. TabIndex = 0;

this. textBox8. TabStop = false;

this. textBox8. Text = "0";

//

// textBox9

//

this. textBox9. Location = new System. Drawing. Point (64, 163);

this. textBox9. Name = "textBox9";

this. textBox9. Size = new System. Drawing. Size (20, 20);

this. textBox9. TabIndex = 8;

this. textBox9. Text = "1";

//

// label7

//

this. label7. Font = new System. Drawing. Font ("Microsoft Sans Serif", 8.25F, System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, ( (byte) (204)));

this. label7. Location = new System. Drawing. Point (12, 162);

this. label7. Name = "label7";

this. label7. Size = new System. Drawing. Size (10, 20);

this. label7. TabIndex = 4;

this. label7. Text = " [";

this. label7. TextAlign = System. Drawing. ContentAlignment. MiddleCenter;

//

// label8

//

this. label8. Font = new System. Drawing. Font ("Microsoft Sans Serif", 8.25F, System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, ( (byte) (204)));

this. label8. Location = new System. Drawing. Point (51, 163);

this. label8. Name = "label8";

this. label8. Size = new System. Drawing. Size (10, 20);

this. label8. TabIndex = 4;

this. label8. Text = ",";

this. label8. TextAlign = System. Drawing. ContentAlignment. MiddleCenter;

//

// label9

//

this. label9. Font = new System. Drawing. Font ("Microsoft Sans Serif", 8.25F, System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, ( (byte) (204)));

this. label9. Location = new System. Drawing. Point (91, 162);

this. label9. Name = "label9";

this. label9. Size = new System. Drawing. Size (10, 20);

this. label9. TabIndex = 4;

this. label9. Text = "] ";

this. label9. TextAlign = System. Drawing. ContentAlignment. MiddleCenter;

//

// button1

//

this. button1. Location = new System. Drawing. Point (11, 305);

this. button1. Name = "button1";

this. button1. Size = new System. Drawing. Size (94, 23);

this. button1. TabIndex = 9;

this. button1. Text = "Расчет";

this. button1. UseVisualStyleBackColor = true;

this. button1. Click += new System. EventHandler (this. Button1Click);

//

// label10

//

this. label10. Font = new System. Drawing. Font ("Microsoft Sans Serif", 12F, System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, ( (byte) (204)));

this. label10. Location = new System. Drawing. Point (302, 13);

this. label10. Name = "label10";

this. label10. Size = new System. Drawing. Size (10, 20);

this. label10. TabIndex = 4;

this. label10. Text = "+";

this. label10. TextAlign = System. Drawing. ContentAlignment. MiddleCenter;

//

// label11

//

this. label11. Font = new System. Drawing. Font ("Microsoft Sans Serif", 8.25F, System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, ( (byte) (204)));

this. label11. Location = new System. Drawing. Point (375, 13);

this. label11. Name = "label11";

this. label11. Size = new System. Drawing. Size (10, 20);

this. label11. TabIndex = 4;

this. label11. Text = "Y";

this. label11. TextAlign = System. Drawing. ContentAlignment. MiddleCenter;

//

// label12

//

this. label12. Font = new System. Drawing. Font ("Microsoft Sans Serif", 8.25F, System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, ( (byte) (204)));

this. label12. Location = new System. Drawing. Point (226,12);

this. label12. Name = "label12";

this. label12. Size = new System. Drawing. Size (10, 20);

this. label12. TabIndex = 4;

this. label12. Text = "X";

this. label12. TextAlign = System. Drawing. ContentAlignment. MiddleCenter;

//

// textBox10

//

this. textBox10. Location = new System. Drawing. Point (469, 13);

this. textBox10. Name = "textBox10";

this. textBox10. Size = new System. Drawing. Size (40, 20);

this. textBox10. TabIndex = 3;

this. textBox10. Text = "0";

//

// label13

//

this. label13. Font = new System. Drawing. Font ("Microsoft Sans Serif", 12F, System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, ( (byte) (204)));

this. label13. Location = new System. Drawing. Point (453, 15);

this. label13. Name = "label13";

this. label13. Size = new System. Drawing. Size (10, 20);

this. label13. TabIndex = 4;

this. label13. Text = "+";

this. label13. TextAlign = System. Drawing. ContentAlignment. MiddleCenter;

//

// richTextBox1

//

this. richTextBox1. Location = new System. Drawing. Point (148, 284);

this. richTextBox1. Name = "richTextBox1";

this. richTextBox1. ReadOnly = true;

this. richTextBox1. ScrollBars = System. Windows. Forms. RichTextBoxScrollBars. ForcedVertical;

this. richTextBox1. Size = new System. Drawing. Size (70, 155);

this. richTextBox1. TabIndex = 10;

this. richTextBox1. Text = "";

//

// richTextBox2

//

this. richTextBox2. Location = new System. Drawing. Point (224, 284);

this. richTextBox2. Name = "richTextBox2";

this. richTextBox2. ReadOnly = true;

this. richTextBox2. ScrollBars = System. Windows. Forms. RichTextBoxScrollBars. ForcedVertical;

this. richTextBox2. Size = new System. Drawing. Size (138, 155);

this. richTextBox2. TabIndex = 10;

this. richTextBox2. Text = "";

//

// richTextBox3

//

this. richTextBox3. Location = new System. Drawing. Point (368, 284);

this. richTextBox3. Name = "richTextBox3";

this. richTextBox3. ReadOnly = true;

this. richTextBox3. ScrollBars = System. Windows. Forms. RichTextBoxScrollBars. ForcedVertical;

this. richTextBox3. Size = new System. Drawing. Size (149, 155);

this. richTextBox3. TabIndex = 10;

this. richTextBox3. Text = "";

//

// label14

//

this. label14. Font = new System. Drawing. Font ("Microsoft Sans Serif", 8.25F, System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, ( (byte) (204)));

this. label14. Location = new System. Drawing. Point (180, 261);

this. label14. Name = "label14";

this. label14. Size = new System. Drawing. Size (10, 20);

this. label14. TabIndex = 4;

this. label14. Text = "k";

this. label14. TextAlign = System. Drawing. ContentAlignment. MiddleCenter;

//

// label15

//

this. label15. Font = new System. Drawing. Font ("Microsoft Sans Serif", 8.25F, System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, ( (byte) (204)));

this. label15. Location = new System. Drawing. Point (276, 261);

this. label15. Name = "label15";

this. label15. Size = new System. Drawing. Size (20, 20);

this. label15. TabIndex = 4;

this. label15. Text = "Xk";

this. label15. TextAlign = System. Drawing. ContentAlignment. MiddleCenter;

//

// label16

//

this. label16. Font = new System. Drawing. Font ("Microsoft Sans Serif", 8.25F, System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, ( (byte) (204)));

this. label16. Location = new System. Drawing. Point (433, 261);

this. label16. Name = "label16";

this. label16. Size = new System. Drawing. Size (20, 20);

this. label16. TabIndex = 4;

this. label16. Text = "Yk";

this. label16. TextAlign = System. Drawing. ContentAlignment. MiddleCenter;

//

// textBox11

//

this. textBox11. Location = new System. Drawing. Point (279, 13);

this. textBox11. Name = "textBox11";

this. textBox11. Size = new System. Drawing. Size (15, 20);

this. textBox11. TabIndex = 11;

this. textBox11. Text = "1";

//

// textBox12

//

this. textBox12. Location = new System. Drawing. Point (426, 14);

this. textBox12. Name = "textBox12";

this. textBox12. Size = new System. Drawing. Size (15, 20);

this. textBox12. TabIndex = 12;

this. textBox12. Text = "1";

//

// label17

//

this. label17. AutoSize = true;

this. label17. Location = new System. Drawing. Point (262, 16);

this. label17. Name = "label17";

this. label17. Size = new System. Drawing. Size (11, 13);

this. label17. TabIndex = 13;

this. label17. Text = "/";

//

// label18

//

this. label18. AutoSize = true;

this. label18. Location = new System. Drawing. Point (411, 18);

this. label18. Name = "label18";

this. label18. Size = new System. Drawing. Size (11, 13);

this. label18. TabIndex = 14;

this. label18. Text = "/";

//

// label19

//

this. label19. AutoSize = true;

this. label19. Location = new System. Drawing. Point (5, 14);

this. label19. Name = "label19";

this. label19. Size = new System. Drawing. Size (107, 13);

this. label19. TabIndex = 15;

this. label19. Text = "Введите уравнение";

//

// label20

//

this. label20. AutoSize = true;

this. label20. Location = new System. Drawing. Point (8, 50);

this. label20. Name = "label20";

this. label20. Size = new System. Drawing. Size (182, 13);

this. label20. TabIndex = 16;

this. label20. Text = "Введите начальные значения X,Y: ";

//

// label21

//

this. label21. AutoSize = true;

this. label21. Location = new System. Drawing. Point (226, 50);

this. label21. Name = "label21";

this. label21. Size = new System. Drawing. Size (150, 13);

this. label21. TabIndex = 17;

this. label21. Text = "Введите порядок точности: ";

//

// label22

//

this. label22. AutoSize = true;

this. label22. Location = new System. Drawing. Point (12, 139);

this. label22. Name = "label22";

this. label22. Size = new System. Drawing. Size (293, 13);

this. label22. TabIndex = 18;

this. label22. Text = "Введите отрезок на котором будет произведен расчет: ";

//

// label23

//

this. label23. AutoSize = true;

this. label23. Location = new System. Drawing. Point (148, 233);

this. label23. Name = "label23";

this. label23. Size = new System. Drawing. Size (56, 13);

this. label23. TabIndex = 19;

this. label23. Text = "Таблица: ";

//

// button2

//

this. button2. Location = new System. Drawing. Point (11, 334);

this. button2. Name = "button2";

this. button2. Size = new System. Drawing. Size (94, 23);

this. button2. TabIndex = 20;

this. button2. Text = "Сохранить";

this. button2. UseVisualStyleBackColor = true;

this. button2. Click += new System. EventHandler (this. button2_Click);

//

// button3

//

this. button3. Location = new System. Drawing. Point (11, 364);

this. button3. Name = "button3";

this. button3. Size = new System. Drawing. Size (94, 23);

this. button3. TabIndex = 21;

this. button3. Text = "Выход";

this. button3. UseVisualStyleBackColor = true;

this. button3. Click += new System. EventHandler (this. button3_Click);

//

// MainForm

//

this. AutoScaleDimensions = new System. Drawing. SizeF (6F, 13F);

this. AutoScaleMode = System. Windows. Forms. AutoScaleMode. Font;

this. ClientSize = new System. Drawing. Size (529, 462);

this. Controls. Add (this. button3);

this. Controls. Add (this. button2);

this. Controls. Add (this. label23);

this. Controls. Add (this. label22);

this. Controls. Add (this. label21);

this. Controls. Add (this. label20);

this. Controls. Add (this. label19);

this. Controls. Add (this. label18);

this. Controls. Add (this. label17);

this. Controls. Add (this. textBox12);

this. Controls. Add (this. textBox11);

this. Controls. Add (this. richTextBox3);

this. Controls. Add (this. richTextBox2);

this. Controls. Add (this. richTextBox1);

this. Controls. Add (this. button1);

this. Controls. Add (this. label8);

this. Controls. Add (this. label9);

this. Controls. Add (this. label12);

this. Controls. Add (this. label16);

this. Controls. Add (this. label15);

this. Controls. Add (this. label14);

this. Controls. Add (this. label11);

this. Controls. Add (this. label13);

this. Controls. Add (this. label10);

this. Controls. Add (this. label7);

this. Controls. Add (this. label6);

this. Controls. Add (this. label5);

this. Controls. Add (this. label4);

this. Controls. Add (this. label3);

this. Controls. Add (this. textBox4);

this. Controls. Add (this. textBox2);

this. Controls. Add (this. label2);

this. Controls. Add (this. label1);

this. Controls. Add (this. textBox9);

this. Controls. Add (this. textBox8);

this. Controls. Add (this. textBox7);

this. Controls. Add (this. textBox6);

this. Controls. Add (this. textBox5);

this. Controls. Add (this. textBox10);

this. Controls. Add (this. textBox3);

this. Controls. Add (this. textBox1);

this. FormBorderStyle = System. Windows. Forms. FormBorderStyle. FixedSingle;

this. Icon = ( (System. Drawing. Icon) (resources. GetObject ("$this. Icon")));

this. MaximizeBox = false;

this. Name = "MainForm";

this. StartPosition = System. Windows. Forms. FormStartPosition. CenterScreen;

this. Text = "Эйлер-Коши";

this. ResumeLayout (false);

this. PerformLayout ();

}

private System. Windows. Forms. Label label16;

private System. Windows. Forms. Label label15;

private System. Windows. Forms. Label label14;

private System. Windows. Forms. RichTextBox richTextBox3;

private System. Windows. Forms. RichTextBox richTextBox2;

private System. Windows. Forms. RichTextBox richTextBox1;

private System. Windows. Forms. Label label13;

private System. Windows. Forms. TextBox textBox10;

private System. Windows. Forms. Label label12;

private System. Windows. Forms. TextBox textBox5;

private System. Windows. Forms. TextBox textBox6;

private System. Windows. Forms. Label label11;

private System. Windows. Forms. Label label10;

private System. Windows. Forms. Button button1;

private System. Windows. Forms. Label label9;

private System. Windows. Forms. Label label8;

private System. Windows. Forms. Label label7;

private System. Windows. Forms. TextBox textBox9;

private System. Windows. Forms. Label label6;

private System. Windows. Forms. TextBox textBox8;

private System. Windows. Forms. Label label5;

private System. Windows. Forms. TextBox textBox7;

private System. Windows. Forms. Label label4;

private System. Windows. Forms. Label label3;

private System. Windows. Forms. Label label2;

private System. Windows. Forms. TextBox textBox4;

private System. Windows. Forms. TextBox textBox3;

private System. Windows. Forms. Label label1;

private System. Windows. Forms. TextBox textBox2;

private System. Windows. Forms. TextBox textBox1;

private System. Windows. Forms. TextBox textBox11;

private System. Windows. Forms. TextBox textBox12;

private System. Windows. Forms. Label label17;

private System. Windows. Forms. Label label18;

private System. Windows. Forms. Label label19;

private System. Windows. Forms. Label label20;

private System. Windows. Forms. Label label21;

private System. Windows. Forms. Label label22;

private System. Windows. Forms. Label label23;

private System. Windows. Forms. Button button2;

private System. Windows. Forms. Button button3;

}

}

Form exit. cs

using System. Text;

using System. Windows. Forms;

namespace Test_solution

{

public partial class Form_exit: Form

{

public Form_exit ()

{

InitializeComponent ();

}

private void button1_Click (object sender, EventArgs e)

{

this. Close ();

}

}

}

Form exit. Designer. cs

namespace Test_solution

{

partial class Form_exit

{

private System.componentModel. IContainer components = null;

protected override void Dispose (bool disposing)

{

if (disposing && (components! = null))

{

components. Dispose ();

}

base. Dispose (disposing);

}

#region Windows Form Designer generated code

private void InitializeComponent ()

{

this. button1 = new System. Windows. Forms. Button ();

this. label1 = new System. Windows. Forms. Label ();

this. SuspendLayout ();

//

// button1

//

this. button1. Location = new System. Drawing. Point (67, 88);

this. button1. Name = "button1";

this. button1. Size = new System. Drawing. Size (79, 32);

this. button1. TabIndex = 0;

this. button1. Text = "Ок";

this. button1. UseVisualStyleBackColor = true;

this. button1. Click += new System. EventHandler (this. button1_Click);

//

// label1

//

this. label1. AutoSize = true;

this. label1. Font = new System. Drawing. Font ("Tahoma", 12F);

this. label1. Location = new System. Drawing. Point (27, 40);

this. label1. Name = "label1";

this. label1. Size = new System. Drawing. Size (163, 19);

this. label1. TabIndex = 2;

this. label1. Text = "Выход из программы";

//

// Form_exit

//

this. AutoScaleDimensions = new System. Drawing. SizeF (6F, 13F);

this. AutoScaleMode = System. Windows. Forms. AutoScaleMode. Font;

this. ClientSize = new System. Drawing. Size (216, 133);

this. Controls. Add (this. label1);

this. Controls. Add (this. button1);

this. Name = "Form_exit";

this. Text = "Form_exit";

this. Load += new System. EventHandler (this. Form_exit_Load);

this. ResumeLayout (false);

this. PerformLayout ();

}

#endregion

private System. Windows. Forms. Button button1;

private System. Windows. Forms. Label label1;

}

}

Save. cs

using System. Text;

using System. Windows. Forms;

namespace Test_solution

{

public partial class Save: Form

{

public Save ()

{

InitializeComponent ();

}

private void button1_Click (object sender, EventArgs e)

{

this. Close ();

}

}

}

Save. Designer. cs

namespace Test_solution

{

partial class Save

{

private System.componentModel. IContainer components = null;

protected override void Dispose (bool disposing)

{

if (disposing && (components! = null))

{

components. Dispose ();

}

base. Dispose (disposing);

}

#region Windows Form Designer generated code

private void InitializeComponent ()

{

this. label1 = new System. Windows. Forms. Label ();

this. label2 = new System. Windows. Forms. Label ();

this. button1 = new System. Windows. Forms. Button ();

this. SuspendLayout ();

//

// label1

//

this. label1. AutoSize = true;

this. label1. Location = new System. Drawing. Point (0, 0);

this. label1. Name = "label1";

this. label1. Size = new System. Drawing. Size (0, 13);

this. label1. TabIndex = 0;

//

// label2

//

this. label2. AutoSize = true;

this. label2. Font = new System. Drawing. Font ("Tahoma", 12F);

this. label2. Location = new System. Drawing. Point (33, 37);

this. label2. Name = "label2";

this. label2. Size = new System. Drawing. Size (225, 19);

this. label2. TabIndex = 1;

this. label2. Text = "Сохранение прошло успешно";

//

// button1

//

this. button1. Location = new System. Drawing. Point (90, 88);

this. button1. Name = "button1";

this. button1. Size = new System. Drawing. Size (98, 36);

this. button1. TabIndex = 2;

this. button1. Text = "закрыть";

this. button1. UseVisualStyleBackColor = true;

this. button1. Click += new System. EventHandler (this. button1_Click);

//

// Save

//

this. AutoScaleDimensions = new System. Drawing. SizeF (6F, 13F);

this. AutoScaleMode = System. Windows. Forms. AutoScaleMode. Font;

this. ClientSize = new System. Drawing. Size (283, 136);

this. Controls. Add (this. button1);

this. Controls. Add (this. label2);

this. Controls. Add (this. label1);

this. Name = "Save";

this. Text = "Save";

this. ResumeLayout (false);

this. PerformLayout ();

}

#endregion

private System. Windows. Forms. Label label1;

private System. Windows. Forms. Label label2;

private System. Windows. Forms. Button button1; }}

Размещено на Allbest.ru


Подобные документы

Работы в архивах красиво оформлены согласно требованиям ВУЗов и содержат рисунки, диаграммы, формулы и т.д.
PPT, PPTX и PDF-файлы представлены только в архивах.
Рекомендуем скачать работу.