单参数分岔3.c ( File view )

  • By kezairenjian 2014-04-25
  • View(s):14
  • Download(s):0
  • Point(s): 1
			#include "stdio.h"
#include "math.h"
/****************************************/
/*******离散系统的表达式function********/ 
/***************在此修改****************/ 
/*用一个三维系统为例子*/ 
#define nn 2                     
void  function(y,wh)
double y[nn];
double wh;
{

 double yy[nn];
 /*	a1=3.5;b1=1;d=0.7;b2=1.2;c1=0.43;a2=4;c2=0.35;%0.1,0.9 ,0.7 ,0.75,0.78最好的*/
    yy[0] = y[0];
    yy[1] = y[1];
    y[0]=yy[0]+0.15*yy[0]*(129.0/10.0-(64.0*yy[1])/105.0-(148.0*yy[0])/105.0);                        
    y[1]=yy[1]+wh*yy[1]*(127.0/10.0-(148.0*yy[1])/105.0-(64.0*yy[0])/105.0);   	
 /**/

};
/*主函数部分*/
main()
{

  int i,j,k,bj;
  double flag1=0.0; 
  double y[nn];
  double wh,star,end;
  int nx; 
  /*分岔参数的计算范围,起点和终点*/
  //////////////*******************************//////////////////////// 
                   star=0.0;
                    end=1;
                     nx=1400;
  //////////////*******************************//////////////////////// 
  
  /*存储数据的文件*/
  FILE *fp1 = fopen("one_para_bir.txt", "w");
  double h=(end-star)/nx; 
  
  for(wh=star; wh<end; wh=wh+h)
  {
  
    printf("wh=%f\n ",wh);
   /*初值在这里修改*/ 
    //////////////*******************************//////////////////////// 
    y[0]=1.0 ;  y[1]=1.0;
                         
     //////////////*******************************//////////////////////// 
    if(flag1==1)
    {

	   flag1=0.0; 
	   break;
    
};
    for(j=-20000;j<=200;j++)
    {

        
	   function(y,wh);
       for(i=0;i<nn;i++)
	   {

		  if(fabs(y[i])>1e5)
		  {

			 flag1=1;
			 printf("系统发散了,程序停止\n");
			 break;
		 
}; 
       
} 
       if(j>0)
       {

        /*二维系统这样输出*/
		fprintf(fp1, "%f  %f  %f\n",wh,y[0],y[1]);   
		/*如果是三维系统,这样输出*/
        	/*fprintf(fp1, "%f  %f  %f  %f\n",wh,y[0],y[1]);*/
        
}
   
};   
 
};
  fclose(fp1);

};
			
...
Expand> <Close

Want complete source code? Download it here

Point(s): 1

Download
0 lines left, continue to read
Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
单参数Lyapunov指数.c2.58 kB09-04-14 08:31
单参数分岔3.c1.90 kB09-04-14 08:40
...
Sponsored links

单参数分岔3.c (2.10 kB)

Need 1 point
Your Point(s)

Your Point isn't enough.

Get point immediately by PayPal

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more point

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D