SHARE
TWEET

Untitled

a guest Jun 27th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. g=0.2;
  2. m=0.6;
  3. delt=0.00001;
  4. xo=0.00001;
  5. yo=0.00001;
  6. zo=0.00001;
  7.  
  8. for n=1:1:1000000
  9.    xtpt=xo+(m*xo+yo-xo*zo)*delt;
  10.    ytpt=yo-xo*delt;
  11.    ztpt=zo-(g*zo+g*0.5*xo*(xo+abs(xo)))*delt;
  12.    xo=xtpt;
  13.    yo=ytpt;
  14.    zo=ztpt;
  15.    disp(n);
  16. end
  17. a=1;
  18. sech=0;
  19. for n=1:1:1000000
  20.    xtpt=xo+(m*xo+yo-xo*zo)*delt;
  21.    ytpt=yo-xo*delt;
  22.    ztpt=zo-(g*zo+g*0.5*xo*(xo+abs(xo)))*delt;
  23.    if(abs(itog(n,2))<delt&ytpt>0)
  24.    sech(a,1)=ytpt;
  25.    a=a+1;
  26.    end
  27.    itog(n,1)=xtpt;
  28.    itog(n,2)=ytpt;
  29.    itog(n,3)=ztpt;
  30.    xo=xtpt;
  31.    yo=ytpt;
  32.    zo=ztpt;
  33.    disp(n);
  34.    
  35. end
  36. plot(itog(:,1),itog(:,2),'r.');
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top