フィルターのクリア

Find unknown from the equation with given value

8 ビュー (過去 30 日間)
Sheryl
Sheryl 2013 年 3 月 9 日
回答済み: prasad p 2021 年 6 月 28 日
I need to calculate the unknown in the equation, how could i do so using matlab?
this is the equation: c=(1/(tm=60))*(tm*exp(-t/tm)-60*exp(-t/60))
value c and t will be provided
how could find the value tm using matlab?

採用された回答

Walter Roberson
Walter Roberson 2013 年 3 月 10 日
Using similar ideas to the above:
[...] %define your values for c and t first
syms tm
double( solve( c - ( (1/(tm-60))*(tm*exp(-t/tm)-60*exp(-t/60)) ), tm ) )
or if you have a bunch of these to solve,
syms c t tm
tmfun = matlabFunction( solve( c - ( (1/(tm-60))*(tm*exp(-t/tm)-60*exp(-t/60)) ), tm ), 'vars', {c, t} );
then after that,
tmfun( current_c, current_t )

その他の回答 (2 件)

Sven
Sven 2013 年 3 月 10 日
Hi Sheryl, If you have the Symbolic Maths toolbox, you can do something like:
Step 1: Set up your equation. Note that you had "tm=60" inside some parentheses. This seems like a typo... I changed it to "tm-60" instead.
myEqn = sym('c = (1/(tm-60))*(tm*exp(-t/tm)-60*exp(-t/60))')
Step 2: Tell MATLAB two of your variables (say, t=5 and c=45):
newEqn = subs(myEqn,{'t','c'}, [5,45])
Step 3: Ask MATLAB to solve for the remaining term (which is tm):
solve(newEqn)
ans =
-0.59449842358712896610400951227259
Is that what you were trying to do?
  2 件のコメント
Paige
Paige 2013 年 3 月 10 日
編集済み: Paige 2013 年 3 月 10 日
Hi, I have tried this and it keeps coming up with the error 'Warning:Explicit solution could not be found', or
1/(lambertw(0, -(703687441776640*exp(-10555311626649600/124074044717989621))/372222134153968863)/5 + 2111062325329920/124074044717989621)
And I have tried to work out what lambertw means with no luck. Why is this?
Thanks in advance
Walter Roberson
Walter Roberson 2013 年 3 月 10 日

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


prasad p
prasad p 2021 年 6 月 28 日
I want to solve above equation in matlab. I want to slove for unknown value of t4 and t2. But I need the solution t2 and t4 for a range of Please help me to write a code for this in matlab software.

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by