Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
kris mere
kris mere el 15 de Nov. de 2011
[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'.

Respuestas (3)

Walter Roberson
Walter Roberson el 15 de Nov. de 2011
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 comentarios
Daniel Shub
Daniel Shub el 15 de Nov. de 2011
Thank you Walter, I have learn a little new math today.
Walter Roberson
Walter Roberson el 15 de Nov. de 2011
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.

Iniciar sesión para comentar.


Daniel Shub
Daniel Shub el 15 de Nov. de 2011
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 comentario
kris mere
kris mere el 15 de Nov. de 2011
yeah
i think i can't
but i don't know how to get 't' without this method

Iniciar sesión para comentar.


Friedrich
Friedrich el 15 de Nov. de 2011
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)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by