# Need to solve equations which take vector inputs. The solv & solu are not supposed to be zero; as the variable R is changing they should change as well and should be vectors. Could anyone help??

1 ビュー (過去 30 日間)
Anik Faisal 2018 年 8 月 2 日
コメント済み: Walter Roberson 2018 年 8 月 3 日
syms tau_new b
rc=1;
x=linspace(1,100,1000);
R=exp(1).*x.*rc;
b0=.3614/sqrt(2);
eqns=[(b./(8*pi)).*(1./R).*(log(R./rc)+1)+(b./(2*b0))-tau_new==0, (b./(2*pi)).*(1./R).*(log(R./rc))+(b./(b0))-tau_new==0];
vars=[tau_new b];
[solv, solu] = solve(eqns, vars)

サインインしてコメントする。

### 採用された回答

Walter Roberson 2018 年 8 月 2 日
The first thing you need to remember is that when you ask to solve() a vector of equations, then solve() has to find a solution that satisfies all of the entries simultaneously. Because your x is length 1000 and there are two entries for each x, you are asking to solve 2000 simultaneously equations.
Secondly, if you use a symbolic x, and go through doing stepwise elimination of the variables, you will find that indeed 0 are the only values that will reliably make that pair of equations 0 on both sides. That does not mean there are no other zeros, but the other zeros are in x, not in b or tau_new . The additional zero is at x = exp(-LambertW(20000*sqrt(2)*Pi*exp(1/3)*(1/5421))-2/3) which is about 0.05157587627 which is before the start of your x search range.

#### 3 件のコメント

Anik Faisal 2018 年 8 月 3 日
Hi Walter, thanks for kindly responding. So does this mean these two equations cannot be solved for tau_new & b? I have tried x=linspace(0,1,100) still getting zeros for tau_new & b. The goal of this was to have a tau_new equation as a function of R and also maybe for b.
Anik Faisal 2018 年 8 月 3 日 meaning solving these two equations numerically while changing R
Walter Roberson 2018 年 8 月 3 日
Subtract the two equations to eliminate tau_new . The resulting equation will have b multiplied by every term, and the result will equal 0. Factor that and you get b * (expression without b) = 0. The only solution to that is that b = 0 or else the expression independent of b = 0. If you let b = 0 then substituting into the first equation you see that tau_new must equal to 0. If you let the expression independent of b be equal to 0, then the value of b becomes irrelevant and you cannot solve for b.

サインインしてコメントする。

### Community Treasure Hunt

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

Start Hunting!