solve the equation for one variable and find the value of variable

3 vues (au cours des 30 derniers jours)
Arvind
Arvind le 15 Mai 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

Réponse acceptée

Dyuman Joshi
Dyuman Joshi le 15 Mai 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
s = 1×10
0.0112 0.0134 0.0248 0.0387 0.0503 0.0777 0.0480 0.0551 0.0741 0.0861

Plus de réponses (1)

KSSV
KSSV le 15 Mai 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 commentaire
Arvind
Arvind le 15 Mai 2023
Modifié(e) : Arvind le 15 Mai 2023
out come is shows only a constant valu s=1 for all value of p
kindly check this error

Connectez-vous pour commenter.

Catégories

En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by