#pragma once #include<stdio.h> #include<math.h> #include <time.h> typedef struct jfxh {
double lim_x_down ; double lim_x_up ; double lim_z_down ; double lim_z_up ; double step_h;//x积分步长 double step_l;//z积分步长 int m;//x 等分数 int l;//z 等分数 }s; //积分参数结构体,盛放积分所需参数
#include"TXJF.h" #define pi 3.141592 double start, finish; double THETHA_x = 9;//方差 double THETHA_z = 4; double m_x = 4.5;//均值 double m_z = 2; //step_l = (lim_z_up - lim_z_down) / n; double getfx(double x,double z)//定义原函数 {
double f = (1 / (2 * pi * THETHA_x* THETHA_z))*exp((-(x - m_x)* (x - m_x) / (2 * THETHA_x*THETHA_x)) + (-(z - m_z)* (z - m_z) / (2 * THETHA_z * THETHA_z))); return f; } double getPRAT(struct jfxh* s1)//为方便起见,将积分中需要叠加的部
|