solving variable in exponential equation

i am trying to use the equation: y = ae^rt; to solve for t; y = final population, a = initial population, r = rate increasing. i'm using editor but it is not working. i know the answer to my equation is around 210, however my code below is not working:
sysm y a r t
y == a * ((exp((r*t));
a = 300;
r = .10;
y = 600;
solve t

6 comentarios

SP
SP el 4 de Feb. de 2019
getting this error when running it after putting it in editor
Error: File: untitled Line: 2 Column: 22
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
madhan ravi
madhan ravi el 4 de Feb. de 2019
Editada: madhan ravi el 4 de Feb. de 2019
syms y a r t
eqn=y == a * exp((r*t));
t=solve(eqn,t);
a = 600;
r = .10;
y = 600;
Final_t=subs(t)
Yields:
t =
log(y/a)/r %-> log(600/600)/r==>0 , so why do you say 210?
SP
SP el 4 de Feb. de 2019
when you actually solve the math using the eqaution on paper, the correct answer is 208:
so your code must be wrong since t is suppose to equal about 208
madhan ravi
madhan ravi el 4 de Feb. de 2019
what's r ? it's not there in the picture.
Walter Roberson
Walter Roberson el 4 de Feb. de 2019
The paper uses values around 300 that are no-where to be found in the 600-ish values you posted.
SP
SP el 4 de Feb. de 2019
i apoligize a = 300, that was my mistake

Iniciar sesión para comentar.

Respuestas (2)

KSSV
KSSV el 4 de Feb. de 2019
syms y a r t
eqn = y == a * ((exp((r*t))));
S = solve(eqn,t) ;
a = 600;
r = .10;
y = 600;
S = subs(S,a) ;
S = subs(S,r) ;
S = subs(S,y) ;
Stephan
Stephan el 4 de Feb. de 2019
Editada: Stephan el 4 de Feb. de 2019
syms t
a = 600;
r = .10;
y = 600;
eq = y - a * (exp(r*t)) == 0;
tsol = solve(eq,t)

4 comentarios

SP
SP el 4 de Feb. de 2019
error:
Undefined function or variable 'y'.
SP
SP el 4 de Feb. de 2019
this worked, however when i enter, i get this:
tsol =
log(y/a)/r
how can i can the actual number value, the anser in terms of variables is right, but i am looking for a number
Stephan
Stephan el 4 de Feb. de 2019
error is corrected. the solution is zero. this is obviously.
use
clear a y r t

Iniciar sesión para comentar.

Etiquetas

Preguntada:

SP
el 4 de Feb. de 2019

Comentada:

el 4 de Feb. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by