필터 지우기
필터 지우기

Modify ode45 so that the solution is always normed to 1

조회 수: 1 (최근 30일)
Pl Pl
Pl Pl 2013년 3월 23일
Dear all,
I have a three-dimensional ode which I'd like to solve using a 4th order Runge-Kutta method, but I'd like the solution to always be normed:
y1(t)²+y2(t)²+y3(t)² = 1, for all t.
This is not the case when I use ode45 despite the fact that it should be from analytical study of the ode. How can I enforce such a constraint by modifying the ode45.m file (or by any other means)?
Thank you.
Edit :
I tried to modify the file ode45.m in MATLAB/R2012a/toolbox/matlab/funfun/ by setting ynew = ynew/norm(ynew) on line 274, but for some reason, it seems that editing this file doesn't change the solution I get, even if I set, say, ynew = 0, and after having restarted Matlab. Is there something more to do so that Matlab accept the changes?

답변 (0개)

카테고리

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