Plot a complicated equation
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello,
I am trying to plot a complicated equation involving rationals and trigonometric functions. The equation is:
Cm = -m * ((b/a)^2.5 * q^0.5) / (dF/dq)
where,
F = (b/a)^4 * ((2*q^2 - (a^2/b^2))^2 * (q^2 - (a^2/p_2^2))^-0.5
-4 * q^2 * (q^2 - (a^2/b^2))^0.5) * cosh((q^2 - (a^2/p_1^2))^0.5) * h
+ (r_1/r_2) * (q^2 - (a^2/p_1^2))^-0.5 * sinh((q^2 - (a^2/p_1^2))^0.5) * h
and q is unknown. I tried the following to solve F,
b = 2800;
a = 0.2 * 2 * pi;
p_1 = 1400;
p_2 = sqrt(3*b);
r_1 = 100000;
r_2 = 250000;
m = 1;
d = 100;
h = 4000;
F=@(q)(b/a)^4 * ((2*q^2 - (a^2/b^2))^2 * (q^2 - (a^2/p_2^2))^-0.5 ...
-4 * q^2 * (q^2 - (a^2/b^2))^0.5) * cosh((q^2 - (a^2/p_1^2))^0.5) * h ...
+ (r_1/r_2) * (q^2 - (a^2/p_1^2))^-0.5 * sinh((q^2 - (a^2/p_1^2))^0.5) * h;
z0=[-10 10];
sol=fzero(F,z0); % the solution is in region ??
but it gives an error relating to the region,
Error using fzero (line 274)
The function values at the interval endpoints must differ in sign.
Does anyone know how to deal with such an equation or have an alternative way to plot Cm?
5 comentarios
Roger Stafford
el 20 de Mayo de 2016
If you wish to find the derivative of the function F with respect to q using matlab, rather than doing it by hand, then you need to use the symbolic form of the function where all the variables are properly defined as symbolic. Then to do plotting you need to convert this answer back to numerical quantities again. In any event, it makes absolutely no sense attempting to find roots of an equation F(q) = 0 as a substitute for this procedure.
Respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!