필터 지우기
필터 지우기

how to use the 'solve' function?

조회 수: 3 (최근 30일)
Dany
Dany 2013년 3월 27일
댓글: Jaimie Ritchie 2023년 11월 22일
hello, im having problem trying to use the solve problem. it's not my first time using it but thata the first time its not working. i have this code line:
tmp = solve('x/L = (1-(h+eta)/ho) - A*log(((h+eta)/ho - A)/(1-A))','eta');
all the parameters are known except 'eta', still it does not provide a solution.
how can i fix it? any sugestions? thank you

답변 (6개)

Carlos
Carlos 2013년 3월 27일
Using arbitrary values for x, h, h0, A and L
>> syms eta;
>> x=1;h=1;ho=1;A=0.1;L=1;
>> f=x/L -(1-(h+eta)/ho) - A*log(((h+eta)/ho - A)/(1-A));
>> eval(solve(f,eta))
ans =
-1.1068 - 0.2302i
  댓글 수: 1
Jaimie Ritchie
Jaimie Ritchie 2023년 11월 22일
This was incredibly helpful to me in learning to use the solve function. I was able to plug in my equation and get a result. Thank you!

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


Carlos
Carlos 2013년 3월 27일
Doing
>> tmp = solve('x/L = (1-(h+eta)/ho) - A*log(((h+eta)/ho - A)/(1-A))','eta')% no semicolon here
tmp =
A*ho - h + (ho - A*ho)/(exp(wrightOmega(log((ho - A*ho)/(A*ho)) - (x/L + h/ho - (h - A*ho)/ho - 1)/A))*exp((x/L + h/ho - (h - A*ho)/ho - 1)/A))
It does give a solution.

Dany
Dany 2013년 3월 27일
thats what im getting too. but i supose to have a numeric answer. i cant use the 'eval' function because it does not recognize 'wrightOmega'.
thats the problem.

Dany
Dany 2013년 3월 27일
ok, thank you Carlos.
i'll give it a try
  댓글 수: 1
Carlos
Carlos 2013년 3월 27일
편집: Carlos 2013년 3월 27일
I think it should work, just remember to change the values of x,h... Please comment if something does not work by trying my approach to the problem.

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


Dany
Dany 2013년 3월 27일
sorry Carlos, it still does not work.
i try it with this values (real ones): h = 1.3721, ho = 500, L = 20000, x = 54.8828, A = -1.6452e-008.
and i still get the 'wrightOmega' and no answer .....

Dany
Dany 2013년 3월 27일
ok it works..... thank you
  댓글 수: 1
Carlos
Carlos 2013년 3월 27일
You are welcome, please mark my answer so people know the answer is correct and can use my answer for their problems.

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by