How do I find unknown parameter from an equation?

5 visualizaciones (últimos 30 días)
Vivaan Gandhi
Vivaan Gandhi el 13 de Abr. de 2021
Comentada: Vivaan Gandhi el 13 de Abr. de 2021
Suppose I am given an equation, z = a*b/(c*d)
Instead of z being the unknown, some term in the RHS is the unknown (let's say 'c') and I am given the values for all others ( let's say z=1, a=2, b=3, d=4).
So how do I find the unknown (here 'c') using the above equation?

Respuesta aceptada

Walter Roberson
Walter Roberson el 13 de Abr. de 2021
eqn = @(c) z - a.*b./(c.*d);
c = fsolve(eqn, GUESS)
This assumes that the equation is complex enough that you cannot just mentally doing the rewriting
z = a*b/(c*d)
implies z*c*d = a*b
implies c = a*b/(z*d)
There are other important similar cases, where you are given a inputs at a number of locations, and corresponding outputs, and you need to find the value of parameters. For example if you were given a constant a, and constant d, and given one b for each input and one corresponding output z, and the question was to find what single value of c best explained all of the (b,z) pairs, then in such a case you could use the Curvefitting Toolbox, or use Nonlinear Least Squares from the Optimization Toolbox; https://www.mathworks.com/help/optim/nonlinear-least-squares-curve-fitting.html

Más respuestas (0)

Categorías

Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by