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

📄 main.cpp

📁 显示奇怪非混沌吸引子. 获得数据后, 用外部软件: origin等画出.
💻 CPP
字号:
#include <iostream.h>
#include <fstream.h>
#include <math.h>

void main()
{
	double temp[2];
	double x,th;
	double r,w,e;
	w=(sqrt(5)-1)/2.0;
	r=3.8335;
	e=0.00192;
	temp[0]=0.5;temp[1]=0.5;
	ofstream of("attra.txt");
    for(long i=0;i<50000;i++)
	{
		
		//////////////
		x=temp[0];
		th=temp[1];	
		x=r*x*(1-x)+e*cos(2*3.1415926*th);
		th=(th+w);
		if(th>1)      ///ȡģ
		{
			long flag=0;
			while(flag==0)
			{
				th=th-1;
				if(th<1)
					flag=1;
			}
		}
		else
		{
			long flag=0;
			if(th<0.0)
			{
				th=th+1;
				if(th>0.0)
					flag=1;
			}
			
		}
		temp[0]=x;
		temp[1]=th;
		if(i>40000)
			of<<x<<"      "<<th<<endl;
	}
	/////////////////
}

⌨️ 快捷键说明

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