I got a non-answer from solve()
显示 更早的评论
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
采纳的回答
更多回答(1 个)
Walter Roberson
2011-6-2
0 个投票
Sometimes instead of putting an assumption on the range of a variable, it is better to select() the answers that meet the criteria.
1 个评论
Walter Roberson
2011-6-2
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))]}
类别
在 帮助中心 和 File Exchange 中查找有关 Common Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!