⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lab4.cpp

📁 The decision of a boundary problem for the differential equation of the second order a method of ite
💻 CPP
字号:
// lab4.cpp : Defines the entry point for the console application.
//

#include <math.h>
#include <stdio.h>

const double a = 0.0;
const double b = 2.;
const double eps = 1e-10;

double p(double x)
{
    return exp(3 - ( 3 + x * x + 2 * x ) * exp(-x));
}

double q(double x)
{
    return - (-exp(-x)/( 1 + x*x ) * p(x));
}

double f(double x)
{
    return - (15 * (x*x + 1) * p(x));
}

double PD(double x)
{
    return (-(2*x+2)*exp(-x)+(3+x*x+2*x)*exp(-x))*exp(3-(3+x*x+2*x)*exp(-x));
}

double g(double x, double y)
{
    return q(x) * y - f(x);
}

double norm(double *Y1, double *Y2, int N)
{
    double max = 0.0;
    int i;
    
    for (i = 0; i <= N; i++)
    {
        if ( fabs(Y2[i] - Y1[i])>max )
            max = fabs(Y2[i] - Y1[i]);
    }
    return max;
}


void main()
{
    double t, h, k0, k1, n0, n1, 
        l0 =  1.0,        
        M0 = -1.0,          // 忐0
        m0 =    0,          // m0
        l1 = 0.0,        // 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -