Solving an equation with different inputs

Hi all!
Im trying to work with matlab and solving the following equation f(c)=0.
If anyone could help, would be very nice!
n=2.4
alpha = [0:0.01:0.8];
f(c) = alpha+((1-c).^n)-c*n.*(1-c).^(n-1);==0

 Réponse acceptée

Torsten
Torsten le 15 Mar 2022
Modifié(e) : Torsten le 15 Mar 2022
n = 2.4;
ALPHA = 0:0.01:0.28;
c0 = 1.0;
for i = 1:numel(ALPHA)
alpha = ALPHA(i);
f = @(c) alpha +(1-c).^n - c*n.*(1-c).^(n-1);
C(i) = fzero(f,c0);
c0 = C(i);
end
plot(ALPHA,C)
Sometimes there are two zeros in [0;1] ; depending on the initial value, fzero can only solve for one of them.
The limiting value for alpha to get a zero of the function seems ((n-1)/(n+1))^(n-1) ~ 0.2887.

Plus de réponses (1)

R
R le 16 Mar 2022

0 votes

Thank you so much Torsten, you helped me out allot!

Catégories

En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by