付宁远23373125 2

基于C语言实现求解算法

#include <stdio.h>  
#include <math.h>  
  
double f(double x) {  
    return exp(x) - 2;  
}  
  
int main() {  
    double a = 0.0;  
    double b = 1.0;  
    double c, fa, fb, fc;  
    int iter = 0;  
    double tolerance = 1e-15;  
    int min_iter = 10;...

付宁远23373125 3

定点迭代法(带埃特金加速)流程图

Error parsing Mermaid diagram!

Parse error on line 5:
... = 0, x₁ = φ(x₀)...
----------------------^
Expecting 'SQE', 'DOUBLECIRCLEEND', 'PE', '-)', 'STADIUMEND', 'SUBROUTINEEND', 'PIPE', 'CYLINDEREND', 'DIAMOND_STOP', 'TAGEND', 'TRAPEND', 'INVTRAPEND', 'UNICODE_TEXT', 'TEXT', 'TAGSTART', got '1'

付宁远23373125 4

#include <stdio.h>  
#include <math.h>  
#include <stdlib.h>  
#include <time.h>  
  
// 定义π常量  
#define PI 3.14159265358979323846  
  
// 椭圆参数  
static double a = 2.0, b = 1.0;  
  
// 目标函数 f(t) = (a*cos(t)-x)*(a*sin(t)) + (b*sin(t)-y)*b*cos(t)// 这是距离平方对t的导数的一半,求其零点...

付宁远23373125 5

#include <stdio.h>  
#include <stdlib.h>  
#include <math.h>  
  
#define MAX_SIZE 20  
#define EPS 1e-12  
  
// 高斯消去法(列主元)  
int gauss_elimination(int n, double A[MAX_SIZE][MAX_SIZE], double b[MAX_SIZE], double x[MAX_SIZE]) {  
    int i, j, k;  
    double max_val, temp, factor;  
    int ma...

付宁远23373125 6

#include <stdio.h>  
#include <stdlib.h>  
#include <math.h>  
#include <time.h>  
  
// 稀疏矩阵数据结构  
typedef struct _triplet TRIPLET;  
struct _triplet  
{  
    int i;  
    int j;  
    double value;  
};  
  
typedef struct _s S;  
struct _s  
{  
    int nRow;  
    int nCol;  
    int nz;...

付宁远23373125 7

#include <stdio.h>
#include <stdlib.h>

// 计算n次拉格朗日插值多项式的系数
// 参数:n - 多项式次数,X - 插值节点数组,Y - 函数值数组,a - 输出系数数组
// 返回值:0表示成功,-1表示...

付宁远23373125 8

为了验证给定的有理式表示的平面曲线是第一象限内的 1/4 圆弧,需要证明对于所有,点满足单位圆的方程$x^2...

付宁远23373125 9

计算过程

1. 采样点生成

在角度区间[0, π]上均匀采样 30 个点:
θ_i = (i-1) × π/29, i = 1,2,...,30

2. 最小二乘拟合

设拟合多项式为:y = a₀ + a₁...

Built with MDFriday ❤️