Warning: Explicit solution could not be found.

1 回表示 (過去 30 日間)
Gun
Gun 2011 年 3 月 9 日
編集済み: David 2013 年 10 月 21 日
Sorry for disturbing you guys but i have wrote a code shown below:
upsilon=acos(x2a/6.85)
x3=47.5+5.35*cos(upsilon)
y3=5.35*sin(upsilon)
f4=(x4-x3)^2
f5=-sqrt(5.34^2-x4^2)
f6=(f5-y3)^2
x4main=f4+f6-46.7^2
solve(x4main)
y4=-sqrt(5.34^2-x4main^2)
The problem is when the warning appears saying that explicit solution could not be found.What is wrong with it?
Thanks.

回答 (2 件)

Andrew Newell
Andrew Newell 2011 年 3 月 9 日
Are you using the Symbolic Toolbox? I don't get any such warning. Maybe some of your variables already have an earlier definition? Try adding
clear
syms x1 x2 x3 x4 x2a
before the above commands.

David
David 2013 年 10 月 21 日
編集済み: David 2013 年 10 月 21 日
This is what you need to do, I think.
syms x2a x3 y3 x4 y4
upsilon=acos(x2a/6.85)
x3=47.5+5.35*cos(upsilon)
y3=5.35*sin(upsilon)
f4=sym((x4-x3)^2)
f5=sym(-sqrt(5.34^2-x4^2))
f6=sym((f5-y3)^2)
x4main=sym(f4+f6-46.7^2)
solve(x4main)
y4=-sqrt(5.34^2-x4main^2)
sym() constructs symbolic objects from the input you give it and solve() requires that the equations you give it are symbolic expressions.
Note: You may not need to put sym() around the equations for f4, f5, and f6, but you definitely do for x4main.
David

Community Treasure Hunt

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

Start Hunting!

Translated by