Solving implicit equations (variable in summation) without the Symbolic Toolbox

6 vues (au cours des 30 derniers jours)
Siddharth Parimal
Siddharth Parimal le 28 Août 2017
Modifié(e) : Sailesh Sidhwani le 31 Août 2017
Hi, I am trying to solve implicit equation in the following general form without the Symbolic Toolbox.
n and N are inputs, and the corresponding parameters (Ci, Ki and Cj, Qj) are known. But I need to automate this calculation for different values of n and N based on what I need.
I am struggling with writing the mathematical expression for a series without using a symbol for a variable. There are other solutions for solving implicit equations without Symbolic Toolbox, but I get stuck when I try to generalize them for a series.
Any help would be greatly appreciated.
Thanks, SP

Réponses (1)

Sailesh Sidhwani
Sailesh Sidhwani le 31 Août 2017
Modifié(e) : Sailesh Sidhwani le 31 Août 2017
Assuming C,K and Q are vectors. You can write your implicit equation as an anonymous function "fun" as follows:
fun = @(x) x + sum((C(1:n)+x) ./ (K(1:n)*x*x)) + sum((C(1:N)*x) ./ (Q(1:N)+x))
Now you can pass this anonymous function "fun" to "fsolve" to solve your implicit equation. You can find the "fsolve" documentation below: https://www.mathworks.com/help/optim/ug/fsolve.html
  2 commentaires
Alan Weiss
Alan Weiss le 31 Août 2017
You might need to put in some sum expressions to get this to work.
Alan Weiss
MATLAB mathematical toolbox documentation
Sailesh Sidhwani
Sailesh Sidhwani le 31 Août 2017
Thanks Alan for pointing that out.

Connectez-vous pour commenter.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by