Problen with ODE45 Results

조회 수: 1 (최근 30일)
babak dindar safa
babak dindar safa 2016년 7월 16일
편집: babak dindar safa 2016년 7월 16일
Hi guys , I'm currently working on a code that would solve me this equation :
i don't know why its not returning the correct answer. what am i doing wrong here?
[t,dz] = ode45(@newz,t,[0],[],factor_A,mass,factor_c,factor_alc,factor_Fy,factor_Uy,factor_beta,factor_gamma,factor_n,xdata,dxdata,t);
and the function
function dz = newz(t,z,A,m,c,a,Fy,Uy,beta,gamma,n,x,dx,dt)
dxt = interp1(dt,dx,t,'pchip');
dz = dxt * (a - ((beta * sign(dxt * z) + gamma) * abs(z)^n));
end

답변 (1개)

John D'Errico
John D'Errico 2016년 7월 16일
The crystal ball is sooooo foggy. I cannot see into your mind to know what you have done wrong, since you show us only one line, nor can I see into your computer. No information posted about any call to ODE45, no functions, no hint of what you are doing. Nothing of value for us to help you.
The Tarot cards were able to point out one thing, that you may come into money next month. Send some of it to me, please. :)
Ok, do you want me to be serious? If I had to guess, it looks like the line of code and the equation seem to have the roles of beta and gamma swapped. Hey, it is the only guess I can offer based on no information.
By the way, using the names gamma or beta are bad things to do, since there are already very useful functions with those names. One day soon, you will post an anguished question like "Why do my calls to the special functions gamma and beta not work properly?"
  댓글 수: 1
babak dindar safa
babak dindar safa 2016년 7월 16일
편집: babak dindar safa 2016년 7월 16일
aren't you a funny one. thanks for your reply though. edited the post and added the code.

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

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by