# Iterative function with powers

Posted 4 months ago
634 Views
|
5 Replies
|
2 Total Likes
|
 My note book is fails to run when I introduce the power (a) on some of the functions.I can't find where am going wrong
5 Replies
Sort By:
Posted 4 months ago
 The exponent makes the system non-algebraic. Don't expect too much.
Posted 4 months ago
 NDSolve worked well, but the numerical iterative function fails.
Posted 4 months ago
 If you pasted the InputForm of your problem as code by using the Code Sample button in the upper left corner of the posting window then someone could scrape the text of your problem off the screen and paste it into their notebook and experiment to see if they could find a way to get it to work. If you don't do that then anyone who wants to see if their idea works will have to type your entire system back in before they can test it. That doesn't often happen and so you likely won't get a solution.
 a = 1.1; b = 0.02; c = 0.035; d = 1.0; k = 0.3; e = 0.5; f = 0.2; \ \[Alpha] = 0.98; h = 1; n = 1 + t; U[0] = 0.3; V[0] = 0.2; W[0] = 0.5; Subscript[S, 1][ t_] := (t - 1)/\[Alpha] ((n + 1) - (t + 1))^\[Alpha] - (t + 1)/\[Alpha] ((n + 1) - (t + 1))^\[Alpha] - 1/(\[Alpha] (\[Alpha] + 1)) ((n + 1) - (t + 1))^(\[Alpha] - 1) - ((t - 1)/\[Alpha] ((n + 1) - (t))^\[Alpha] - (t)/\[Alpha] ((n + 1) - (t))^\[Alpha] - 1/(\[Alpha] (\[Alpha] + 1)) ((n + 1) - (t))^(\[Alpha] - 1)); Subscript[S, 2][ t_] := (t)/\[Alpha] ((n + 1) - (t + 1))^\[Alpha] - (t + 1)/\[Alpha] ((n + 1) - (t + 1))^\[Alpha] - 1/(\[Alpha] (\[Alpha] + 1)) ((n + 1) - (t + 1))^(\[Alpha] - 1) + 1/(\[Alpha] (\[Alpha] + 1)) ((n + 1) - (t))^(\[Alpha] - 1); Ut = U[t] == U[0] + 1/ Gamma[\[Alpha]] ((U[t] c d (V[t])^a - f c V[t] (U[t])^a)/ h Subscript[S, 1][ t] - (b ( U[t - 1] c d V[t - 1]^a - f c V[t - 1] (U[t - 1])^a))/ h Subscript[S, 2][t]); Vt = V[t] == V[0] + 1/ Gamma[\[Alpha]] ((c f (1 - 2 V[t] - W[t]) (U[t])^a + d c (V[t])^a U[t])/ h Subscript[S, 1][ t] - (c f (1 - 2 V[t - 1] - W[t - 1]) (U[t - 1])^a + d c (V[t - 1])^a U[t - 1])/h Subscript[S, 2][t]); Wt = W[t] == W[0] + 1/ Gamma[\[Alpha]] ((d f (1 - V[t] - W[t]) (U[t])^a)/ h Subscript[S, 1][ t] - (d f (1 - V[t - 1] - W[t - 1]) (U[t - 1])^a)/ h Subscript[S, 2][t]); 
 Thank you for the text of your problem. That was very helpful.I believe there were slight differences between your text and your image. I assumed the text was supposed to match the image and made changes to accomplish that. a=1.1; b=0.02; c=0.035; d=1.0; k=0.3; e=0.5; f=0.2; α=0.98; h=1; n=1+t;U[0]=0.3; V[0]=0.2; W[0]=0.5; S1[t_]:=(t-1)/α(n+1-(t+1))^α-(t+1)/α(n+1-(t+1))^α-1/(α(α+1))(n+1-(t+1))^(α-1)-((t-1)/α(n+1-t)^α- (t)/α(n+1-t)^α-1/(α(α+1))(n+1-t)^(α-1)); S2[t_]:=t/α (n+1-(t+1))^α-(t+1)/α(n+1-(t+1))^α-1/(α(α+1))(n+1-(t +1))^(α-1)+1/(α(α+1))*(n+1-t)^(α-1); Ut=U[t]==U[0]+1/Gamma[α]((U[t] c d (V[t])^a-f c V[t](U[t])^a)/h S1[t]-(b(U[t-1]c d V[t-1]^a-f c V[t-1]* (U[t-1])^a))/h S2[t]); Vt=V[t]==V[0]+1/Gamma[α]((c f(1-2 V[t]-W[t])(U[t])^a+d c (V[t])^a*U[t])/h S1[t]-(c f(1-2 V[t-1]-W[t-1])* (U[t-1])^a+d c(V[t-1])^a U[t-1])/h S2[t]); Wt=W[t]==W[0]+1/Gamma[α]((d f(1-V[t]-W[t])(U[t])^a)/h S1[t]-(d f(1-V[t-1]-W[t-1])(U[t-1])^a)/h S2[t]); {Us,Vs,Ws}={U0,V0,W0}; Do[{Us,Vs,Ws}={U[t],V[t],W[t]}/.Last[NSolve[{Ut,Vt,Wt}/. Thread[{U[t-1],V[t-1],W[t-1]}->{Us,Vs,Ws}],{U[t],V[t],W[t]}]]; sol[t]={Us,Vs,Ws};,{t,1,10}]; Table[sol[i],{i,1,10}] I believe your first NSolve will be of approximately the form NSolve[{ U[1]==U0+0.9882*(0.00002909-0.03519*(-0.007*U[1]^1.1*V[1]+0.035*U[1]*V[1]^1.1)), V[1]==V0+0.9882*(0.002028-0.03519*(0.035*U[1]*V[1]^1.1+0.007*U[1]^1.1*(1-2*V[1]-W[1]))), W[1]==W0+0.9882*(0.01640-0.007038*U[1]^1.1*(1-V[1]-W[1]))}, {U[1],V[1],W[1]}] and, since NSolve is a numerical solver, I believe that it will not know how to deal with the unknowns U0,V0,W0.I assume U0,V0,W0 where not present when you were able to successfully solve the problem without iteration and that was how it was able to solve that problem.If you have numeric constants for the values of U0,V0,W0 then it should be fairly easy to modify the code to make it work. If you don't have numeric values for those then a different method of solving for the subsequent U[t],V[t],W[t] may be needed.