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 Center および File ExchangeOrdinary Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by