开发者

singularity at differential equation with MATLAB

开发者 https://www.devze.com 2023-01-16 19:56 出处:网络
I can\'t solve this differential equation by ode45 beacause it has sig开发者_JAVA百科ularity. xy\"=3xcos(x)+sin(x) ; x(0)=0 , x\'(0)=0

I can't solve this differential equation by ode45 beacause it has sig开发者_JAVA百科ularity.

xy"=3xcos(x)+sin(x) ; x(0)=0 , x'(0)=0

can you help me to write ode45 function?


You can use the sinc(x) function, which is defined as sin(π*x)/(π*x), except at x=0 where its value is 1. So, you can rewrite your ODE as:

y'' = 3*cos(x) + sinc(x/π)

which ode45 shouldn't have any trouble solving.

0

精彩评论

暂无评论...
验证码 换一张
取 消