adel-00

130 Reputation

9 Badges

11 years, 313 days

MaplePrimes Activity


These are replies submitted by adel-00

@Rouben Rostamian  

Thanks you are right.

How if we change r to abs(r)

 

 

@Carl Love 

Thanks Carl for all your comments and your valuable efforts.

The expressions are very complicated to solve the integration symbolically.

So I tried the basic way to solve it approximately (by summation).

thamks agian @Carl Love  and @acer

 

 

@acer 

the code is doing integration whic is the summation by simpson rule

@acer 

Thanks ace

last polint in this line

sum1[n]:=2*(L[n]+sum1[n-1])/3;

 

how can i separte the summation of the even position and the odd as sum1[2n]=2*(L1[2n]+sum1[2n-1]) and for the odd be sum1[2n+1]=L1[2n+1]+sum1

 

@tomleslie 

thanks,

how can i calculate the last line which is the summation of L1[n] from -10 to 10

@Carl Love @tomleslie

Thanks for all ur reply

I guess this code need a litle improvement and will work

plsease check thisnew_code.mw

@Carl Love 

you are right about r. 

numerical_int.mw

@Carl Love 

r must be real

that is the main reason i write it down  in if statement 

@Carl Love 

no r has two caes

as:

if N*(N+1)>(delta+Delta-w)^2 then 
r:=sqrt(N*(N+1)-(delta+Delta-w)^2):
elif 
N*(N+1)<(delta+Delta-w)^2 then
r:=sqrt(-(N*(N+1)+(delta+Delta-w)^2)):
end if:

 

and d is from -5 to 5

so if we could make a seq. of points (d, int(L1)) then it would be easy to me to plot Re( int(L1)) agianst d

 

@Carl Love 

if N*(N+1)>(delta+Delta-w)^2 then 
r:=sqrt(N*(N+1)-(delta+Delta-w)^2):
elif 
N*(N+1)<(delta+Delta-w)^2 then
r:=sqrt(-(N*(N+1)-(delta+Delta-w)^2)):
end if:

 

@Carl Love 

L1:=(-2*Cp*z+Cz*x)*f; 

where f depends on w and Cp, Cz depend on (d,w)

@Carl Love 

I totally agree with you.

my concern is: 1) regarding expression (r) I cant dermine whether is it false or true (that the main reson I do it in loop). since (r) has two cases 

2) the expression L1 is dependent on both w and d  (if i remove the do loop).

3) finally i would like to plot Re(gd) agianst (d)

check the code pleaseI do appreciate ur help 

numerical_int.mw

 

@Carl Love 

Thanks Carl

the expressions are too lengthy and depends on w, d that why I did do loop

here some changes in the codenumerical_int.mw

@mmcdara 

Many thanks

@adel-00 

lambda:=0.1:N:=5:M:=sqrt(N(N+1)):omegap:=10:phi:=0:

var:={n(t),u(t)}:
dsys:={diff(n(t),t)=-2*(n(t)-N)+(u(t)-abs(M)*exp(I*phi))*exp(-2*I*omegap*t/lambda)+conjugate((u(t)-abs(M)*exp(I*phi))*exp(-2*I*omegap*t/lambda)),diff(u(t),t)=-2*(1-I*delta)*u(t)+2*(n(t)-N)*exp(-2*I*omegap*t/lambda)+2*abs(M)*exp(I*phi)}:
res1:=dsolve(dsys union {n(0)=0,u(0)=0},numeric,output=listprocedure,parameters=[delta]):

    
WV := eval(n(t), res1):

tlo,thi := 0.0, 2.0;
U0lo,U0hi := -10, 10;(m,n) := 51,51;
    
str := time[real]():
M:=Matrix(m,n,datatype=float[8]):
for j from 1 to n do
  u0 := U0lo+(j-1)*(U0hi-U0lo)/(n-1);
  WV(parameters=[delta=u0]);
  for i from 1 to m do
    T := tlo+(i-1)*(thi-tlo)/(m-1);
    try
      M[i,j] := WV(T);
    catch:
      # mostly maxfun complaint for t above some value.
      M[i,j] := Float(undefined);
    end try;
  end do:
end do:
plots:-surfdata(M, tlo..thi, U0lo..U0hi,
                labels=["t","delta","n(t)"]);

 

Found similar to my problem  which explained by Carl

1 2 3 4 5 6 7 Last Page 2 of 12