Problen with ODE45 Results

1 次查看(过去 30 天)
babak dindar safa
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