how I create improved lorenz code

조회 수: 2 (최근 30일)
Ghofran Khaled
Ghofran Khaled 2021년 11월 14일
댓글: Jan 2021년 11월 18일
hi everyone
I want to create improved lorenz code , but its doesnt work well
could someone help me , please
this is my code
function dy= lorenz(t,y)
a = 8/3;
b = 25;
c = 10;
d = 5.3;
e = 17.5;
f = 10.5;
g = 13.3;
h = 14;
if cos(5.3*t)>=0
p=1;
else
p=-1;
end
dy=zeros(3,1);
dy(1)=a*y(1)+p*y(2)*y(3);
dy(2)=y(3)*b-y(3)*c*cos(d*t) - b*y(2)+y(2)+c*cos(d*t);
dy(3)= -1*p*y(1)*y(2)-(e*cos(d*t)+f)*y(2)+(g-h*y(3)*(cos(d*t)));
end
  댓글 수: 6
Jan
Jan 2021년 11월 16일
If I follow the instructions from scratch, I get the same output as you. So why to you assume that the diagram of the top is the correct solution? It looks like the standard Lorenz attractor, but the formula is something different.
Ghofran Khaled
Ghofran Khaled 2021년 11월 18일
@Jan Thank you very much for helping me

댓글을 달려면 로그인하십시오.

채택된 답변

Jan
Jan 2021년 11월 14일
편집: Jan 2021년 11월 15일
The test contains cos(dt), but your code only cos(t).
  댓글 수: 3
Ghofran Khaled
Ghofran Khaled 2021년 11월 15일
@Jan Please can you help me this took me a week and I don't know where I went wrong I'm out of time
Jan
Jan 2021년 11월 18일
I still do not see a convincing reason to assume, that there is any problem. I've written some code to solve the answer and get the same output as you (as far as I can see). Why do you think that your code is wrong?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by