need to to solve the equation
.5*Rut(U(i)-deltau(i))^2+S+1.5*Rut*deltau(i)^2 == .5*Rut(V(i)-U(i))^2+Yp;
where
deltau=Uf0*(exp(-((U(i)-Uf0)/(3*Uf0)).^2));
for U using ''solve'' function in for loop,, can anyone help plz.

댓글 수: 2

mostafa  Ahmed
mostafa Ahmed 2018년 4월 24일
If I want this function in for loop with series values of V
Walter Roberson
Walter Roberson 2018년 4월 24일
.. then do that ?
But doing that will not permit you to use solve() to find a closed form solution. solve() might possibly switch to finding a numeric solution; if so then you should just use vpasolve() instead.

댓글을 달려면 로그인하십시오.

 채택된 답변

John D'Errico
John D'Errico 2018년 4월 23일

0 개 추천

Don't use solve. If all the other variables are known, then just use fzero.
Is Rut a variable? Or a function? If you think that this does a multiplication:
Rut(U(i)-deltau(i))^2
you are wrong. MATLAB requires an * in there.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2018년 4월 23일

0 개 추천

solve() is intended for closed form solutions. You will not be able to find a closed form solution to that because of the exp() term.
If you have the values of all of the variables except for U then you can use vpasolve to get one solution. There are probably a few different solutions involving complex-valued numbers; I am not sure at the moment if there could be two real-valued solutions.

카테고리

도움말 센터File Exchange에서 Polynomials에 대해 자세히 알아보기

질문:

2018년 4월 23일

댓글:

2018년 4월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by