问题描述
我尝试使用 C++ 对由以下系统定义的非局部弹性方程进行模拟
使用以下离散化
带边界条件 并通过坐 lc=1/(6*sqrt(3)),但我没有到达如下图所示的分叉图,
这是我用过的代码。
#include <iostream>
#include <math.h>
#include <fstream>
#include <cstdio>
#define PI 3.14
using namespace std;
main (){
int i,n,m;
double a=0,b=PI,h,l,BETA=PI*PI;
double X[500],V[500],T[500];
cout<<"donne n=";
cin>>n;
l=1./(2*n*sqrt(3));
ofstream SOL("eringen.txt");
V[0]=0;
V[100]=0;
X[0]=5;
//SOL << X[0]<<"\t"<< V[0] << endl;
for (m=1; m<=100; m++)
{
for (i=1; i<=10; i++)
{
X[i]=X[i-1]+(1./m)*V[i-1];
V[i]=V[i-1]-(1./m)*BETA*(1+l*l*V[i-1]*V[i-1])*sin(X[i])*(1./(1-BETA*l*l*cos(X[i])));
SOL << X[i-1]<<"\t"<< V[i-1] << endl;
}
}
FILE *fp = popen("gnuplot","w");
fprintf(fp,"plot 'eringen.txt' ;\ pause mouse \n");
cin.get();
pclose(fp);
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)