Scilab 求微分方程的根

Scilab to Find Roots of Differential Equation

如何确定微分函数的根。我用ode求解函数:

g=9.81//m/s^2
l=1.0//m
function phiprim=f(t,phi)
    phiprim(1)=phi(2)
    phiprim(2)=phi(1)*(-g/l)
endfunction
t0=0
tmax=%pi
step=0.05
t=t0:step:tmax
phi0=25/180*%pi // 25° in rad umgerechnet
phiprim0=0 // entspricht phi' bzw. Phi1'
phi=ode([phi0;phiprim0],t0,t,f)

到目前为止,还不错。但是如何确定 Scilab 中 φ(t)φ'(t) 的根?
使用 ode_root 函数抛出错误“无效索引”:

deff("[z]=gr(t,phi)","z=phi(1)") // should find the roots of phi function
ng=1
[phi,rd]=ode("root",phi0,t0,tmax,f,ng,gr)

谢谢!

使用 ode 和根查找参数。这是在线文档,但您可以使用 help ode_root

找到它

https://help.scilab.org/docs/6.1.0/en_US/ode_root.html