Solving equation with two variables, and giving the result for one as a function of the other
1 view (last 30 days)
Show older comments
Bakr Abdelgaliel
on 7 Jul 2022
Commented: Bakr Abdelgaliel
on 8 Jul 2022
I have an equation with two variables (Alpha, and Ze_grad), i wont an equation that locks like Alpha= f(Ze_grad), but i cant do that!
mfreqs=[200 5000];
syms Alpha Ze_grad
Zm = 1./((2i*pi*mfreqs).^Alpha);
Zm_grad = (imag(Zm(2))-imag(Zm(1)))/(real(Zm(2))-real(Zm(1)));
equ= Zm_grad - Ze_grad == 0 ;
alpha = solve(equ, Alpha)
Accepted Answer
Torsten
on 8 Jul 2022
Edited: Torsten
on 8 Jul 2022
Alpha0 = 2.0;
Ze_grad = 3.0;
Alpha = fsolve(@(x)fun(x,Ze_grad),Alpha0)
fun(Alpha,Ze_grad)
function res = fun(Alpha,Ze_grad)
mfreqs=[200 5000];
Zm = 1./((2i*pi*mfreqs).^Alpha);
Zm_grad = (imag(Zm(2))-imag(Zm(1)))/(real(Zm(2))-real(Zm(1)));
res = abs(Zm_grad - Ze_grad);
end
9 Comments
More Answers (0)
See Also
Categories
Find more on Equation Solving in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!