solve the equation for one variable and find the value of variable
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Arvind
el 15 de Mayo de 2023
Respondida: Dyuman Joshi
el 15 de Mayo de 2023
if p = [1.0 1.2 2.2 3.4 4.4 6.7 4.2 4.8 6.4 7.4]
solve eqation for a and find the value of a
eqn = p*((1-a^2)^(3/2)) == (a*acosd(a)-(a^2)*sqrt(1-a^2))
a = solve(eqn,a)
gives error Empty sym: 0-by-1
0 comentarios
Respuesta aceptada
Dyuman Joshi
el 15 de Mayo de 2023
"out come is shows only a constant valu s=1 for all value of p
kindly check this error"
That's not an error. a==1 is a solution to all the equations.
To find solution(s) other than a==1, in case more solution(s) exists, you generally obtain them by specifying an initial guess closer to the other solutions. However, as we don't know any other solution, let's assume a guess that is far from the solution we know -
As the allowed values of a are [-1, 1], let's take the initial guess as -0.5
syms a
P = [1.0 1.2 2.2 3.4 4.4 6.7 4.2 4.8 6.4 7.4] ;
s = zeros(size(P)) ;
for i = 1:length(P)
p = P(i);
eqn = p*((1-a^2)^(3/2)) == (a*acosd(a)-(a^2)*sqrt(1-a^2));
s(i)=vpasolve(eqn,a,-0.5);
end
s
0 comentarios
Más respuestas (1)
KSSV
el 15 de Mayo de 2023
syms a
P = [1.0 1.2 2.2 3.4 4.4 6.7 4.2 4.8 6.4 7.4] ;
s = zeros(size(P)) ;
for i = 1:length(P)
p = P(i) ;
eqn = p*((1-a^2)^(3/2)) == (a*acosd(a)-(a^2)*sqrt(1-a^2))
s(i) = vpasolve(eqn,a) ;
end
1 comentario
Ver también
Categorías
Más información sobre Symbolic Math Toolbox 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!