Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
の値について解きたい方程式がありますm
m
m^2+x*m+1=0
私はこれらのルーツを使用して見つけることができることを知っていますpolyroot(c(1,x,1))。
polyroot(c(1,x,1))
x多項式のすべての実根がの値ごとにプロットされるように、これらの根をRにプロットして変化させたいと思いますx。
x
多項式はこれよりも複雑になり、2次式または3次式の適用が除外される可能性があることに注意してください。
私がこれをどのように達成できるかについて何か考えはありますか?
ありがとう!
これでうまくいくと思います。X評価したい値に設定するだけです。
X
X <- seq(0, 10, length=21) roots <- sapply(X, function(x) polyroot(c(1,x,1))) roots[abs(Im(roots)) > 1e-10] <- NA matplot(X, t(roots), pch=1)