Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Solve equations and get "t"

1 Ansicht (letzte 30 Tage)
Redwood
Redwood am 5 Dez. 2014
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Dear Matlab experts,
I attached my coding below. When you look at the graph, one "t" exists.
Please let me know how to get "t".
Thank you very much in advance.
Sincerely yours,
J1
t = 0:20;
z = 17267.895;
a = -14.62;
b = -6.19;
c = -9.11;
d = -6.72;
e = -9.19;
f = -12.23;
g = -7.93;
h = -17.56;
aa =34.13;
bb = 1337.71;
cc = 81.78;
dd = 60.48;
ee = 127.45;
ff = 142.39;
gg = 62.27;
hh = 309.33;
i = aa*exp(-t.*a) + bb*exp(-t.*b) + cc*exp(-t.*c) + dd*exp(-t.*d) + ee*exp(-t.*e) + ff*exp(-t.*f) + gg*exp(-t.*g) + hh*exp(-t.*h);
j = (aa*exp(-t.*a))./i;
k = (bb*exp(-t.*b))./i;
l = (cc*exp(-t.*c))./i;
m = (dd*exp(-t.*d))./i;
n = (ee*exp(-t.*e))./i;
o = (ff*exp(-t.*f))./i;
p = (gg*exp(-t.*g))./i;
q = (hh*exp(-t.*h))./i;
jj = z*j;
kk = z*k;
ll = z*l;
mm = z*m;
nn = z*n;
oo = z*o;
pp = z*p;
qq = z*q;
plot(t,jj)
solve('z*(aa*exp(-t.*a))/i == 100','t')

Antworten (2)

Torsten
Torsten am 5 Dez. 2014
z = 17267.895;
a = -14.62;
b = -6.19;
c = -9.11;
d = -6.72;
e = -9.19;
f = -12.23;
g = -7.93;
h = -17.56;
aa = 34.13;
bb = 1337.71;
cc = 81.78;
dd = 60.48;
ee = 127.45;
ff = 142.39;
gg = 62.27;
hh = 309.33;
funk=@(t)(z*aa*exp(-t*a)/(aa*exp(-t*a) + bb*exp(-t*b) + cc*exp(-t*c) + dd*exp(-t*d) + ee*exp(-t*e) + ff*exp(-t*f) + gg*exp(-t*g) + hh*exp(-t*h))-100);
t0=fzero(funk,[0 20]);
Best wishes
Torsten.
  2 Kommentare
Redwood
Redwood am 5 Dez. 2014
Dear Torsten,
If 100 is 499.14, then I would like to know how to get "t". I got errors in Matlab. Thank you very much.
Sincerely yours,
J1
Torsten
Torsten am 8 Dez. 2014
What do you mean by "If 100 is 499.14" ?
What errors did you get when you ran the code I posted ?
Best wishes
Torsten.

Star Strider
Star Strider am 5 Dez. 2014
When I run your code, I get a plot of ‘jj’ (a vector) as a function of ‘t’ (a vector). That seems to me to do what you want.
The solution of your equation for ‘t’ requires only a couple lines of relatively simple algebra to produce:
t = -log((100*i)/(z*aa))/a

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by