Finding more than one root for nonlinear equation
显示 更早的评论
Hello there! Hope you're all fairing well.
I used the fsolve function to solve my problem, but it only returns one answer. I want to know if there is another function that can return all the possible answer, if there are more than one. Heres what I am trying to solve:

I'm trying to solve for qb, qt, beta, and their respective derivatives.
7 个评论
Torsten
2024-12-10
What is A ? How to get a scalar from -A^(-1)*[1;0;0] ?
Walter Roberson
2024-12-10
You could try setting it all up using the Symbolic toolbox, and solve()
Lucas Resende
2024-12-10
Lucas Resende
2024-12-10
But doesnt solve only return one possível answer?
"solve" tries to find all solutions to a system of equations.
When setting up the system using the Symbolic Toolbox as suggested by @Walter Roberson, you can already assume that q_t_dot and beta_dot are 0. This follows from equations (2) and (3) of your system.
Lucas Resende
2024-12-10
回答(1 个)
Equations (5) and (6) are two linear equations in q_t, beta and q_dot_b. Use them to express q_t and beta as linear functions of q_b_dot.
Now insert the expressions for q_t and beta in equation (4). After having done this, equations (1) and (4) will be of the form
a11*q_dot_b + a12*q_b^3 = 0
a21*q_dot_b + a22*q_b = 0
Eliminating q_dot_b gives a cubic equation for q_b that usually has 3 solutions.
Inserting backwards gives 3 solutions for all unknowns except for q_dot_t and beta_dot that were identified to be zero right at the beginning.
syms q_dot_b q_b q_t beta
syms a11 a41 a42 a43 a44 a52 a53 a54 a62 a63 a64 real
eqn1 = a11*q_b^3 + q_dot_b == 0
eqn2 = a41*q_b+a42*q_t + a43*beta + a44*q_dot_b == 0
eqn3 = a52*q_t + a53*beta + a54*q_dot_b == 0
eqn4 = a62*q_t + a63*beta + a64*q_dot_b == 0
sol = solve([eqn1,eqn2,eqn3,eqn4],[q_b,q_t,beta,q_dot_b])
char(sol.q_b)
char(sol.q_t)
char(sol.beta)
char(sol.q_dot_b)
类别
在 帮助中心 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!