I got a non-answer from solve()
Afficher commentaires plus anciens
Here's some code. I know that one solution is eta = pi/6, A=20, and k=2*pi/lambda. I get a non-answer (A=A, eta=eta, k=k) from solve():
reset(symengine);clear all;
syms x lambda A k positive;
syms eta;
lambda = 1;
eq1 = A*sin(eta)-10;
eq2 = A*sin(k*lambda/6 + eta)-20;
eq3 = A*sin(k*5*lambda/12 + eta);
% try to solve
solve(eq1,eq2,eq3,A,eta,k)
ans =
A: [1x1 sym]
eta: [1x1 sym]
k: [1x1 sym]
Other things I've tried have yielded different results, but they were also non-productive. What am I missing here?
Thanks,
Susan
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 2 Juin 2011
0 votes
Sometimes instead of putting an assumption on the range of a variable, it is better to select() the answers that meet the criteria.
1 commentaire
Walter Roberson
le 2 Juin 2011
By selecting the admissible solutions after finding them all, the complete set I get is
[A = 20, eta = (1/6)*Pi, k = 2*Pi]
[A = 20, eta = (5/6)*Pi, k = 10*Pi]
[A = (80/7)*14^(1/2), eta = -arctan((1/11)*7^(1/2))+Pi, k = -12*arctan(7^(1/2))+12*Pi]
[A = (80/7)*14^(1/2), eta = arctan((1/11)*7^(1/2)), k = 12*arctan(7^(1/2))]}
Catégories
En savoir plus sur Common Operations 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!