필터 지우기
필터 지우기

write a function about ' v(t)=10^9+​10^8*(1-ex​p(-t./100)​)-1.5*10^7​*t '

조회 수: 1 (최근 30일)
kris mere
kris mere 2011년 11월 15일
[EDIT: 20111115 14:07 CST - merge duplicate - WDR]
question about matlab : I want to write a function about ' v(t)=10^9+10^8*(1-exp(-t./100))-1.5*10^7*t ' . In order to get each 't' , how can I write a function with 't' at the left side of the equal sign?(for example:t=......) Thanks for help!!
[Merge from duplicate]
I want to write a function about
v(t)=10^9+10^8*(1-exp(-t./100))-1.5*10^7*t
In order to get each 't' , how can I write a function with 't' at the left side of the equal sign?(for example : t = ......)
v(t)=10^9*(x./100)
x=(100:-5:40)
If I don't write a function with 't' at the left side of the equal sign, but I still have to write a to acquire each 't'.

답변 (3개)

Walter Roberson
Walter Roberson 2011년 11월 15일
If you have a particular v value and wish to solve for the corresponding t value, then the solution is
t = 100*LambertW(-(1/15)*exp((1/1500000000)*v-11/15))-(1/15000000)*v+220/3
LambertW is part of the Symbolic Toolbox, or you can use one of the contributions such as http://www.mathworks.com/matlabcentral/fx_files/6909/1/content/doc/lambertw.html
  댓글 수: 3
Daniel Shub
Daniel Shub 2011년 11월 15일
Thank you Walter, I have learn a little new math today.
Walter Roberson
Walter Roberson 2011년 11월 15일
The solution for your rephrased question remains the same. At best the additional information tells you what value of v to use in the LambertW expression.
If you have the Symbolic Toolkit, the way to get this solution is:
syms v t
tsol = solve(10^9+10^8*(1-exp(-t./100))-3/2*10^7*t,t);
After that if you want to put in particular v, you can do that using subs(), such as
x=100:-5:40;
tnumeric = double( subs(tsol, v, 10^9*(x./100)) );
Myself, I find it difficult to understand how you can define v(t) in terms that do not involve t but do involve a previously unstated variable x.

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


Daniel Shub
Daniel Shub 2011년 11월 15일
I don't think you can. If you work through the math, I think you will eventually get something t+a*log(b*t) is equal to c. If you are willing to accept the approximation that t+a*log(b*t) is approximately t (for large enough t), then you can isolate t on the LHS.
  댓글 수: 1
kris mere
kris mere 2011년 11월 15일
yeah
i think i can't
but i don't know how to get 't' without this method

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


Friedrich
Friedrich 2011년 11월 15일
Hi,
risky (violates some basic rules of numerical mathematics) but should work in the most cases
func = @(t) 10^9+10^8*(1-exp(-t./100))-1.5*10^7*t;
x0 = 0;
v = 3000;
t = fzero(@(x) func(x) - v,x0)
func(t)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by