Plotting graph from non linear equation in MATLAB
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Supriya Khatoniar
el 8 de Mzo. de 2022
Comentada: Supriya Khatoniar
el 1 de Abr. de 2022
I need help while plotting a non linear equation like:
*(plotting of "x Vs a"; x: Y-axis, a: X-axis)
x = b*(a-c-x) +(2*b*(a-c-x) +d)*(log(R) - (1/2)*log((R^2)*(1+(2*b/d)*(a-c-x))))
where,
a = 0:0.01:2
b = 1.577*10^11
c = 0.74
d = 1.9296*10^(-7)
R = 5*10^(-9)
I'm facing error while using solve & fzero function.
0 comentarios
Respuesta aceptada
Torsten
el 8 de Mzo. de 2022
A = 0:0.01:2;
b = 1.577e11;
c = 0.74;
d = 1.9296e-7;
R = 5e-9;
x0 = -1.0;
for i = 1:numel(A)
a = A(i);
fun = @(x) -x + b*(a-c-x) +(2*b*(a-c-x) +d).*(log(R) - (1/2)*log((R^2)*(1+(2*b/d)*(a-c-x))));
X(i) = fsolve(fun,x0);
x0 = X(i);
end
plot(A,X)
7 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Numerical Integration and Differential Equations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!