749 Reputation

11 years, 87 days

use display...

 > restart:
 > F1:=plot(x^2,x=-5..5):F2:=plot(x^3+2*x,x=-5..5):F3:=plot(5*x^4+8*x,x=-2..2):
 > plots:-display({F1,F2,F3},gridlines=false);
 >

use two seq , and listplot3d...

 > restart:
 > M:=Matrix(3,[seq](i,i=1..9));
 (1)
 > A:=[seq]((linalg:-col(M,i)),i=1..3);# if we want to plot these three as coloumn elements#
 (2)
 > plots:-listplot3d([seq]([seq](M(i,j),i=1..3),j=1..3));
 >

use odeplot...

but it takes much time to plot your function in much more range of x .

 > restart:
 > EQ1 := -1.383117238*10^(-9)*g(x)+3.982412158*10^(-19)*f(x)^3+4.345190954*10^(-9)*f(x)+3.643814675*10^(-17)*(diff(f(x), x, x)) = 0;
 > EQ2 := 3.522088319*10^(-10)*g(x)-1.106493792*10^(-9)*f(x)^2+2.429209785*10^(-24)*(diff(g(x), x, x)) = 0;
 >
 (1)
 > res := dsolve(`union`(eval({EQ1, EQ2}), {f(0) = 0.1e-1, g(0) = 0, (D(f))(0) = 0, (D(g))(0) = 0}),numeric, maxfun = 0);
 (2)
 > plots:-odeplot(res,[x,f(x)-g(x)],x=0..0.01,gridlines=false);
 >

hint...

u have written your code with as complicated as names you can do ! and have put every thing in a very complicated do loop ! so it makes you make mistakes much !

i changed your initial conditons to :

r_nach_1[1](t):=0: r_nach_1[2](t):=0.2*10^(-2):

and this line of your code like this :

r_nach_1[i+2] (t):=  r_nach_1[i+1](t) +  alpha*(B1*(iter_psi_c1_1(t)) + (c1*iter_psi_c2_1(t))); instead of defining function.

i extracted your code , and for first loop,(setting i=1) it is done correctly. thus changed i=2 and got another recursive error !
and becuase of complexness of your code ! i can not find the souce ! maybe some one else can help !

i=1 :

 > restart;
 > t1F := 20: A11 := 2.5*10^(-3): c1 := 4*10^2: ss1 := 0.5*10^(-2): pI1 := 0.4*10^(-1): r1max := 0.6*10^(-2): procent:=0.2: A12 := procent*A11: B1:=-1: alpha:=0.000001: beta1:=0.5: r_nach_1[1](t):=0: r_nach_1[2](t):=0.2*10^(-2):
 >
 >
 > iter_psi_c1_1:=proc(t) 0 end proc: iter_psi_c2_1:=proc(t) 0 end proc:
 > s1[1]:=proc(t) 0 end proc:
 >
 >
 > i:=1;
 (1)
 > _p11 := evalf(dsolve({diff(p1(t), t) = A11*(p1(t)-'s1'[i](t))+B1*(r_nach_1[i+1](t)-r_nach_1[i](t))+A12*(p1(t)-'s1'[i](t))^2+ss1, p1(0) = pI1}, numeric,method = dverk78, abserr = 1.*10^(-8), relerr = 1.*10^(-8),optimize,output = listprocedure, known=[s1[i],iter_psi_c1_1,iter_psi_c2_1]));
 (2)
 > p1F := rhs(_p11(t1F)[2]);
 (3)
 > s1[i+1] := subs(_p11, p1(t));
 (4)
 > q11 := evalf(dsolve({diff(q1(t), t) = c1*r_nach_1[i+1](t), q1(0) = 0},numeric,range=0..t1F,known=[iter_psi_c1_1,iter_psi_c2_1]));
 (5)
 > q1F := rhs(q11(t1F)[2]);
 (6)
 > F[i]:= beta1*q1F;
 (7)
 > _psi_c1_1 :=evalf(dsolve({diff(psi_c1_1(t), t) = A11+2*A12*('s1'[i+1](t)-'s1'[i](t))*psi_c1_1(t), psi_c1_1(t1F) =  -1+beta1},numeric,method = dverk78, abserr = 1.*10^(-8), relerr = 1.*10^(-8),optimize,known=[s1[i],s1[i+1]],output=listprocedure));
 (8)
 > _psi_c2_1 :=evalf(dsolve({diff(psi_c2_1(t), t) = 0, psi_c2_1(t1F) =  -beta1},numeric,output=listprocedure));
 (9)
 > iter_psi_c1_1 := op([2,2],_psi_c1_1); iter_psi_c2_1 := op([2,2],_psi_c2_1);