## 135 Reputation

12 years, 304 days

## @mmcdara  thanks want to plot 3d ...

thanks

want to plot 3d as (n(t,delta))

## @Carl Love  Thanks very much... &...

Thanks very much...

## @Carl Love  very usefull u := pro...

very usefull

u := proc (x, t) options operator, arrow; gamma1*tanh(2*Pi-t-x) end proc;
v := proc (x, t) options operator, arrow; gamma2*tanh(2*Pi+t+x) end proc;
A := 1/4*(-2*u(x, t)*(diff(v(x, t), x))+2*beta1*u(x, t)*(diff(u(x, t), t, t))+beta2*u(x, t)^2*(u(x, t)^2+v(x, t)^2)-2*alpha1*u(x, t)*(diff(v(x, t), t, t, t))-alpha2*u(x, t)*(u(x, t)^2+v(x, t)^2)*(diff(v(x, t), t))+2*v(x, t)*(diff(u(x, t), x))+2*beta1*v(x, t)*(diff(v(x, t), t, t))+beta2*v(x, t)^2*(u(x, t)^2+v(x, t)^2)+2*alpha1*v(x, t)*(diff(u(x, t), t, t, t))+alpha2*v(x, t)*(u(x, t)^2+v(x, t)^2)*(diff(u(x, t), t))):
u := (x, t) -> gamma1 tanh(2 Pi - t - x)
v := (x, t) -> gamma2 tanh(2 Pi + t + x)
Coeffs:= proc(e::algebraic, V::{list,set}(name))
local T, C;
try C:= coeffs(e, V, T)
catch "invalid argument":
C:= coeffs(collect(e, V, ':-distributed'), V, T)
end try;
table([T]=~[C])
end proc
:
V:= [gamma1,gamma2,alpha1, alpha2, beta1, beta2]:
C:= Coeffs(A, V):
r1:= add(v*int(C[v], [x= -3..3, t= -10..10], numeric), v= [indices](C, nolist)):

eq1:=(diff(r1,gamma1)):eq2:=(diff(r1,gamma2)):
sol = evalf(solve({eq1, eq2}, {gamma1, gamma2}));

Root_Z.. appear in the sol

## Thanks for ue comments still i got err...

still i got error

 > u := proc (x, t) options operator, arrow; a*tanh(2*Pi-t-x) end proc; v := proc (x, t) options operator, arrow; b*tanh(2*Pi+t+x) end proc; A := 1/4*(-2*u(x, t)*(diff(v(x, t), x))+2*beta1*u(x, t)*(diff(u(x, t), t, t))+beta2*u(x, t)^2*(u(x, t)^2+v(x, t)^2)-2*alpha1*u(x, t)*(diff(v(x, t), t, t, t))-alpha2*u(x, t)*(u(x, t)^2+v(x, t)^2)*(diff(v(x, t), t))+2*v(x, t)*(diff(u(x, t), x))+2*beta1*v(x, t)*(diff(v(x, t), t, t))+beta2*v(x, t)^2*(u(x, t)^2+v(x, t)^2)+2*alpha1*v(x, t)*(diff(u(x, t), t, t, t))+alpha2*v(x, t)*(u(x, t)^2+v(x, t)^2)*(diff(u(x, t), t))):
 (1)
 > Coeffs:= proc(e::algebraic, V::{list,set}(name)) local T, C:= coeffs(e, V, T);     table([T]=~[C]) end proc : V:= [a,b,alpha1, alpha2, beta1, beta2]: C:= Coeffs(A, V): r1:= add(v*int(C[v], [x= -3..3, t= -10..10], numeric), v= [indices](C, nolist));
 (2)

## @Carl Love  one more thing  ...

one more thing

if

u := proc (x, t) options operator, arrow; a*tanh(2*Pi-t-x) end proc;
v := proc (x, t) options operator, arrow; b* tanh(2*Pi+t+x) end proc;

## @Carl Love  Thanks Carl is  ...

Thanks Carl

is

`r1:= add(v*int(C[v], [x= -10..10, t= -3..3], numeric), v= V);`

double integral??

## u := proc (x, t) options operator, arrow...

u := proc (x, t) options operator, arrow; tanh(2*Pi-t-x) end proc;
v := proc (x, t) options operator, arrow; tanh(2*Pi+t+x) end proc;
A := 1/4*(-2*u(x, t)*(diff(v(x, t), x))+2*beta1*u(x, t)*(diff(u(x, t), t, t))+beta2*u(x, t)^2*(u(x, t)^2+v(x, t)^2)-2*alpha1*u(x, t)*(diff(v(x, t), t, t, t))-alpha2*u(x, t)*(u(x, t)^2+v(x, t)^2)*(diff(v(x, t), t))+2*v(x, t)*(diff(u(x, t), x))+2*beta1*v(x, t)*(diff(v(x, t), t, t))+beta2*v(x, t)^2*(u(x, t)^2+v(x, t)^2)+2*alpha1*v(x, t)*(diff(u(x, t), t, t, t))+alpha2*v(x, t)*(u(x, t)^2+v(x, t)^2)*(diff(u(x, t), t)));
f := (x,t) -> A:
r1:=int(int(A,x=-10..10),t=-3..3,numeric):

it takes time

## 2sd...

u := proc (x, t) options operator, arrow; tanh(2*Pi-t-x) end proc;
v := proc (x, t) options operator, arrow; tanh(2*Pi+t+x) end proc;
A := a*u(x, t)*(diff(u(x, t), t))-u(x, t)*(diff(u(x, t), x, x, x))+b*v(x, t)*(diff(v(x, t), t))-v(x, t)*(diff(v(x, t), x, x, x));
f := (x,t) -> A:
r1:=evalf(int(int(A,x=-10..10),t=-10..10,numeric)):

## @Polovodov thanks..if ( a) is insid...

thanks..

if ( a) is inside the integrals and cant go outside!! is there a way to eval the integral without assigning (a)..

for other example i have

## @acer Thanks for your respondsfirst...

first: y is a complex; lets say y=a+ib, So y^2 is Re(y)^2+Im(y)^2

the isuue is all integrations contains deltao(unknown), so how can I plot y^2 against deltao

is there  a way to do it without loop?

## it is not at each point of the vectror y...

it is not at each point of the vectror yr is assigned to sls

for example for 0.3 in vertical axis should be verticle coulmn (200 )

## @Carl Love  Thanks But why in mat...

Thanks

But why in matlab produce the figure different?

what shall i add in maple in the  plot option to get the same result..

## @Ramakrishnan Thanksxa and xb are f...

Thanks

xa and xb are functions of t

P1:=logplot([xa,xb],0..1,axes=boxed,title=tit,color=black,font=[2,3,18],thickness=2,tickmarks=[3,2],titlefont=[SYMBOL,14],font=[1,1,18],linestyle=[1,3,2]);

but still the same issue not like the matlab plot

## computation interrupted...

Hi

I found error in the integration so i did correct the expressions but I got computation interrupted:

here the code below plz I appreciated if you can give me comments

restart: # d is real (plot of Spec agianst d)

kernelopts(version):

term1:=(exp((1+I*d)*Gamma*tau)*(1-cos(2*Omega1))+cos(2*Omega1)*exp((1+I*d)*Gamma*t0)-exp(-(1+I*d)*Gamma*t0))/(2*(1+I*d)):
term2:=-1/2*evalf(Int(exp((1+I*d)*Gamma*x)*cos(Omega1*(1+erf(x))),x=-3..3)):
J1:=evalf(term1+term2):

J1mod:=(Re(J1))^2+(Im(J1))^2:

###### J2#########################
A2:=Int(exp((1+I*d)*Gamma*x)*sin(Omega1*(1+erf(x))),x=-3..3):
A3:=sin(2*Omega1)*(exp((1+I*d)*Gamma*tau)-exp((1+I*d)*Gamma*t0))/(1+I*d):
J2:=-I*(A2+A3):
J2mod:=(Re(J2))^2+(Im(J2))^2:
#J3 same as J1differ in sign
term1:=(exp((1+I*d)*Gamma*tau)*(1+cos(2*Omega1))-cos(2*Omega1)*exp((1+I*d)*Gamma*t0)+exp(-(1+I*d)*Gamma*t0))/(2*(1+I*d)):
term2:=0.5*int(exp((1+I*d)*Gamma*x)*cos(Omega1*(1+erf(x))),x=-3..3):
J3:=term1+term2:
J3mod:=(Re(J3))^2+(Im(J3))^2:
J4:=-J2:
J4mod:=(Re(J4))^2+(Im(J4))^2:

#Spec:=J1mod+J2mod:
Spec:=J1mod*cos(theta/2)^2+J2mod+J3mod*sin(theta/2)^2 -0.5*Re(J3*J4*sin(theta)*exp(I*phi))+0.5*Re(J1*J4*sin(theta)*exp(-I*phi)):

with(plots):
tau:=Pi:tau0:=1:Omega1:=10;Gamma:=1:t0:=3:theta:=Pi/3:phi:=Pi/3:
Omega1 := 10
tit:=sprintf("W=%g,G=%g,t=%g,q=%g,f=%g",Omega1,Gamma,tau,theta,phi);
tit := "W=10,G=1,t=3.14159,q=1.0472,f=1.0472"
P1:=plot(Spec,d=-350..350,axes=boxed,numpoints=200,title=tit,color=black,
font=[2,3,18],thickness=2,tickmarks=[3,3],gridlines=false,
labels=["",""],
titlefont=[SYMBOL,14],font=[1,1,18],linestyle=1);
Warning,  computation interrupted
Normalize:= proc(P::specfunc(anything, PLOT))
local A,Smax1;
A:= op([1,1], P);
Smax1:= max(A[..,2]);
if A::list then A:= Matrix(A) end if;
A[..,2]:= A[..,2]/Smax1;
subsop([1,1]= A, P);
end proc:
P1:= Normalize(P1):
for kk from 2 to 3 do
tau:= 0.2*kk*Pi;
P||kk:= plot(Spec,d=-350..350,axes=boxed,numpoints=200,title=tit,color=black,
font=[2,3,18],thickness=2,tickmarks=[3,3],gridlines=false,
labels=["",""],
titlefont=[SYMBOL,14],font=[1,1,18],linestyle=1);
P||kk:= plottools:-translate(Normalize(P||kk), 0, kk-1)
od:
display([P||(1..3)],view=[-10..10,0..3]);

## @acer  it is really run quicker ma...

it is really run quicker many thanks

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