Hi,
I need to solve iteratively the following equation: Y=A(t) *B(Y) using the values of the following two sets .
t= [ 0.05,0.1,0.2,0.5,1,2,5,10]
A=[0.9,0.75,0.6,0.2,0.08,0.06,0.051,0.05]
and
Y=[25,50,75,100,125,150,175,200,225,400,500,700,1000]
B=[3250,2500,2000,1725,1550,1400,1325,1275,1225,950,850,775,775]
so that I can get Y as a function of t. What do you suggest would be the most precise way to do this using maple?
Thanks for your time
interpolation
It doesn't look iterative. Anyway, one can interpolate B as a function of Y, then find solutions for given values of A, and interpolate them for corresponding values of t. For example, using splines,
The result doesn't look very nice though, see
Alec
interpolation or fit
If the data are not exact but only approximate, it's probably better to use some sort of least-squares approximation rather than interpolation.
For A(t), it looks to me like a constant plus an exponential might be a good fit. For B(Y), maybe a linear combination of two powers.
y as a function of t
Sorry, I gave you t as a function of y rather than the reverse.
> yf:= t -> fsolve(eval(y = (a*exp(-b*t) + c)*(d*y^e + e*y^f),{op(abcsol),op(defgsol)}),y=0..1000);127.4000077
syntax
Could someone please explain the syntax used in stating this problem? Thanks.
[updated] Please ignore the above. I've got it now.
acer
Almost there
Thank u all so much for your suggestions.
Robert, for A(t) i would expect a double exponential : A = a*exp(-t/b)+c*exp(1/(t+d)) and for B(Y) maybe : B=f*exp(-g*Y)+k
Ive tried to fit the data similarily the way u showed me but i must be doing something wrong. 1) Could u please help me with that? in your example are the numebrs for d,e,f,g random values?
I have worked out these equations in the past but im not sure how they compare with wht u suggest if they are of any help:
For A=1.027*exp(-t/(.282))+0.051*exp(1/(t+1.766*10^90)) [1]
and B=2.433*10^3*exp(-0.008*Y)+780 [2] but still my results are a bit off from wht they should be.
2) For A(t) i have almost 100 points in an excel file. Is there a simple way to enter this data in maple or do I have to type them in the Adata/Tdata format as above?
3) If u plot yf as shown below ( X axis log) for t=0.038 there is a small discontinouity. It happens even if i substitute [1], [2] in Y=A(t) *B(Y) but only in maple. Any ideas why?
> with(Optimization); Tdata := [0.5e-1, .1, .2, .5, 1, 2, 5, 10]; Adata := [.9, .75, .6, .2, 0.8e-1, 0.6e-1, 0.51e-1, 0.5e-1]; TAdata := zip(`[]`, Tdata, Adata); Ydata := [25, 50, 75, 100, 125, 150, 175, 200, 225, 400, 500, 700, 1000]; Bdata := [3250, 2500, 2000, 1725, 1550, 1400, 1325, 1275, 1225, 950, 850, 775, 775]; YBdata := zip(`[]`, Ydata, Bdata);
> LSSolve([seq(a*exp(-b*t[1])+c-t[2], t = TAdata)], a = 0 .. 2, b = 0 .. 10, c = 0 .. 0.05); abcsol := %[2];
> LSSolve([seq(d*t[1]^e+f*t[1]^g-t[2], t = YBdata)], initialpoint = [d = 61875, e = -1, f = 775, g = 0]); defgsol := %[2];
Warning, limiting number of iterations reached
>
> yf := proc (t) options operator, arrow; fsolve(eval(y = (a*exp(-b*t)+c)*(d*y^e+e*y^f), {op(abcsol), op(defgsol)}), y = 0 .. 1000) end proc;
> yf(1);
127.3895493
> plot(yf, 0.01 .. 10, axis[1] = [mode = log], labels = [t, y]);
Thanks in advance for your time.
Discontinuity?
I see no discontinuity near t = 0.038. Can you upload your plot showing that?
ExcelTools:-Import
ExcelTools:-Import can be used for importing data from Excel.
Alec