## 244 Reputation

12 years, 245 days

## numeric int...

You mean loke this;

h:=evalf(Int(g, tau=0..1-t,t = 0 .. 1, digits = 20,method = _MonteCarlo)); no result. How if we put the double integral in loop and then we plot it as seq.

## I do...

I do this:

g:=(d)->2*(Re(exp(-I*d*tau)*((0.5+z_R(t))*f1(tau)+f4(tau)-0.5*f3(tau)*(y_R(t)+I*y_I(t)))));
d -> 2 Re(exp(-I d tau) ((0.5 + z_R(t)) f1(tau) + f4(tau)

- 0.5 f3(tau) (y_R(t) + I y_I(t))))
int(int(g(d),tau=0..1-t),t=0..1);

it takes long time and then i interrupted it. If Re deleted then no result return

and z_R(t) ,y must be  the solution of solution := dsolve(newsys union incs, numeric, newfunctions);

thx

## plot the double integral...

It get complicated now f1,...  can't expressed as funtions of t and the subs as functions of tau.

g:=(d,T)->2/T*(Re(exp(-I*d*tau)*((0.5+z_R(t))*subs(t=tau,f1)+subs(t=tau,f4)-0.5*subs(t=tau,f3)*y(t)))):# z_R(t),y(t) are the solutions of sys2 with the original conditions0,0,-0.5
f:=int(int(g(d,T),tau=0..T-t),t=0..T);
now, I would like to plot f in 3d and 2d( T=fixed).

Thanks you are so kind.

## Thanks for your help. I do...

Thanks for your help. I do this:

#solution := dsolve(newsys union incs, numeric, newfunctions);

>S1:= dsolve(newsys union {x1_R(0)=1, x1_I(0)=0, y1_R(0)=0, y1_I(0)=0,z1_R(0)=0, z1_I(0)=0,x_R(0)=0, x_I(0)=0, y_R(0)=0, y_I(0)=0, z_R(0)=-1/2, z_I(0)=0}, numeric, output=listprocedure):
>S2:= dsolve(newsys union {x1_R(0)=0, x1_I(0)=0, y1_R(0)=1, y1_I(0)=0,z1_R(0)=0, z1_I(0)=0,x_R(0)=0, x_I(0)=0, y_R(0)=0, y_I(0)=0, z_R(0)=0, z_I(0)=0}, numeric, output = listprocedure):
>S3:= dsolve(newsys union {x1_R(0)=0, x1_I(0)=0, y1_R(0)=0, y1_I(0)=0,z1_R(0)=1, z1_I(0)=0,x_R(0)=0, x_I(0)=0, y_R(0)=0, y_I(0)=0, z_R(0)=1, z_I(0)=0}, numeric, output = listprocedure):
>S4:= dsolve(newsys union {x1_R(0)=0, x1_I(0)=0, y1_R(0)=0, y1_I(0)=0,z1_R(0)=0, z1_I(0)=0,x_R(0)=0, x_I(0)=0, y_R(0)=0, y_I(0)=0, z_R(0)=0, z_I(0)=0}, numeric, output = listprocedure):
>f1:=subs(?? i dont know

## Thanks very  very much...

Thanks very  very much woderful . I solve the systems analytically it consumes time thank you again.

for the formula of the double integral:

when I solve the system analatically the solution of ( for exaple x(t) =x_R(t)+Ix_I(t)) is of the form;

x(t)=f1(t)x(0)+f2(t)y(0)+f3(t)z(0)+f4(t) wher x(0),y(0) and z(0) are the initial conditions

now, I want to plot  g(d) the formula of the double integral in 2d and 3d

g(d)=int(int(f1(tau)*z_R(t)*exp(-I*d*tau),tau=0..1-t),t=0..1);

## Thanks for your...

I'm going to plot the solutions x_R(t),z_R(t) and x_I(t) .

I  usualy do this after dsolve numeric ODE it works ,but now I dont know wy it does not.

t0:=0:tN:=5: N1:=5000:th:=evalf((tN-t0)/N1):dsolxR:=subs(solution,x_R(t)):dsolxI:=subs(solution,x_I(t)):dsolz:=subs(solution,z_R(t)):
Error, invalid input: subs received solution, which is not valid for its 1st argument
Error, invalid input: subs received solution, which is not valid for its 1st argument
Error, invalid input: subs received solution, which is not valid for its 1st argument
t1:=array(0..N1,[]): xr:=array(0..N1,[]): xI:=array(0..N1,[]): z:=array(0..N1,[]): pt1:=array(0..N1,[]):pt2:=array(0..N1,[]):pt3:=array(0..N1,[]):
for i from 0 to N1 do t1[i]:=evalf(th*i):xr[i]:=evalf(dsolxR(t1[i]));xI[i]:=evalf(dsolxI(t1[i])):z[i]:=evalf(dsolz(t1[i])):pt1[i]:=[t1[i],xr[i]]:pt2[i]:=[t1[i],xI[i]]:pt3[i]:=[t1[i],z[i]]:od:
pts:=50:tn:=1000:
unassign('i'):mytab1:=[seq(pt1[i],i=0..N1)]:mytab2:=[seq(pt2[i],i=0..N1)]:mytab3:=[seq(pt3[i],i=0..N1)]:
plot(mytab3,t=0..5,color=black);

LAST thing in this problem assume the solution x(t)=f1(t)*x(0)+f2(t)*y(0)+f3(t)*z(0)+f4(t), where x(t) is the solution of sys 2

How can do double integral

int(int(exp(-I*tau)*f2(t),tau=0..1-t),t=0..1);

## Thanks for your help. I...

I think it better to solve the sys. numeric. But there are error.

solution := dsolve(newsys union incs, numeric, functions);

Error, (in dsolve/numeric/process_input) indication of the unknown(s) of the problem {x(t), x1(t), y(t), y1(t), z(t), z1(t)} disagrees with input system {x_I(t), x_R(t), y_I(t), y_R(t), z_I(t), z_R(t), x1_I(t), x1_R(t), y1_I(t), y1_R(t), z1_I(t), z1_R(t)}

## Thank you for your...

incs := map(`=`, eval(newfunctions, t=0), 0);

for sys1 the conditions are: incs := xr(0)=0, xI(0)=0, yr(0)=0, yi(0)=0, zr(0)=-0.5, zi(0)=0;

for sys2 the same.

at the end after plotting the solutions.

I will use the functions f1,f2,f3,f4 in  x(t)=f1(t)x(0)+f2y(0)+f3z(0)+f4  in double integral formula.

## Thanks all for resoponses I...

Thanks all for resoponses I have tried many ways to add the conditions and to use the solutions to sys2 no results I appreciated for any helps.restart:
assume(z1(t),'real',xr(t),'real',xI(t),'real'):

sys1:={diff(x1(t),t)=(3+5*I)*x1(t)-sqrt(2)*(cos(3)
+I*sin(3))*y1(t)-2*I*z1(t),diff(y1(t),t)=
(3-5*I)*y1(t)-sqrt(2)*(cos(3)-I*sin(3))*x1(t)+2*I*z1(t),diff(z1(t),t)=0.25-0.3*z1(t)-2*I*(x1(t)-y1(t))}:

eval(sys1,{x1(t)=xr(t)+I*xI(t),y1(t)=yr(t)+I*yi(t), z1(t)=zr(t)+I*zi(t)}):

newsys:= map(e -> (map(evalc@Re,e), map(evalc@Im,e)), %):
incs:=xr(0),xI(0),yr(0),yi(0)=0,zr(0)=-0.5,zi(0)=0;
xr(0), xI(0), yr(0), yi(0) = 0, zr(0) = -0.5, zi(0) = 0
sol1:=evalf(dsolve(evalf(newsys))):

[ x1(t)=eval(xr(t)+I*xI(t),sol1),y1(t)=eval(yr(t)+I*yi(t),sol1),z1(t)=eval(zr(t)+I*zi(t),sol1)]:

assign(sol1);
z1(t);
z1(t)
sys2:={diff(x(t),t)=(3+5*I)*x(t)-sqrt(2)*(cos(3)+I*sin(3))*y(t)-2*I*z(t)-2*I*(cos(5*t)-1)*z1(t),diff(y(t),t)=conjugate(x(t)),diff(z(t),t)=0.25-0.3*z(t)-2*I*(x(t)-y(t))-2*I*(cos(5*t)-1)*(x1(t)-y1(t))}:

## In newsys do I have put the...

In newsys do I have put the 6 initial conditions as:

incs:=xr(0)=0,xI(0)=0,zr(0)=-0.5,yr(0)=0,yi(0)=0,zi(0)=0;
or x1(0):=0:y1(0):=0:z1(0):=-0.5

## incs...

thanks , how can I add the initial conditions i try  this:

restart:
x1(0):=0:y1(0):=0:z1(0):=-0.5:
sys1 := {diff(x1(t), t) = (3+5*I)*x1(t)-sqrt(2)*(cos(3)+I*sin(3))*y1(t)-(2*I)*z1(t), diff(y1(t), t) = conjugate(x1(t)), diff(z1(t), t) = .25-.3*z1(t)-(2*I)*(x1(t)-y1(t))}:
incs:=xr(0)=0,xI(0)=0,zr(0)=-0.5,yr(0)=0,yi(0)=0,zi(0)=0;
xr(0) = 0, xI(0) = 0, zr(0) = -0.5, yr(0) = 0, yi(0) = 0, zi(0) = 0

eval(sys1,{x1(t)=xr(t)+I*xI(t),y1(t)=yr(t)+I*yi(t),z1(t)=zr(t)+I*zi(t)}):
newsys:= map(e -> (map(evalc@Re,e), map(evalc@Im,e)), %):
sol1:=evalf(dsolve(evalf({newsys,incs})));

Error, (in dsolve) invalid arguments; expected an equation, or a set or list of them, received: {{diff(xI(t), t) = 5*xr(t)+3*xI(t)-(1995738293/10000000000)*yr(t)+(280012163/200000000)*yi(t)-2*zr(t), diff(xr(t), t) = 3*xr(t)-5*xI(t)+(280012163/200000000)*yr(t)+(1995738293/10000000000)*yi(t)+2*zi(t), diff(yi(t), t) = -xI(t), diff(yr(t), t) = xr(t), diff(zi(t), t) = -(3/10)*zi(t)-2*xr(t)+2*yr(t), diff(zr(t), t) = 1/4-(3/10)*zr(t)+2*xI(t)-2*yi(t)}}

## I tried to upload the...

I tried to upload the sheet but i cant because before i upload one.

These systems aftor i seperate the real and the imiginary parts.

******** system 1 ************ we use the solutions in system 2, where AM,phi,Delta,delta,Gamma,Omega0 are constants
dsys :=diff(x0(t),t)=-(Gamma+AM*cos(phi))*x0(t)+(Delta-AM*sin(phi))*y0(t), diff(y0(t),t)=-(Delta+AM*sin(phi))*x0(t)-(Gamma-AM*cos(phi))*y0(t)-2*Omega0*z0(t), diff(z0(t),t)=-0.5-b*z0(t)+2*Omega0*y0(t):
inix:=x0(0)=Re(x(0)), y0(0)=Im(x(0)),z0(0)=z(0):
solsx:=(evalf(dsolve({dsys ,inix}, {x0(t), y0(t),z0(t)},method = laplace))):
assign(solsx):

************system 2************.
dsys0 :=diff(u0(t),t)=-(Gamma+AM*cos(phi))*u0(t)+(Delta-AM*sin(phi))*v0(t)-AM*(cos(phi+2*k*delta*t)-cos(phi))*x0(t)-AM*(sin(phi+2*k*delta*t)-sin(phi))*y0(t), diff(v0(t),t)=-(Delta+AM*sin(phi))*u0(t)-(Gamma-AM*cos(phi))*v0(t)-2*Omega0*w0(t)-2*Omega0*(cos(delta*t)-1)*z0(t)+AM*(cos(phi+2*k*delta*t)-cos(phi))*y0(t)-AM*(sin(phi+2*k*delta*t)-sin(phi))*x0(t), diff(w0(t),t)=-0.5-b*w0(t)+2*Omega0*v0(t)+2*Omega0*(cos(delta*t)-1)*(y0(t)):
ini0:=u0(0)=Re(x(0)), v0(0)=Im(x(0)),w0(0)=z(0):

sols:=simplify(evalf(dsolve({dsys0 ,ini0}, {u0(t), v0(t),w0(t)},method = laplace))):
*******System3 in numeric proc.********
ini1:=u(0)=Re(x(0)), v(0)=Im(x(0)),w(0)=z(0):dsys1 :=diff(u(t),t)=-(Gamma+AM*cos(phi+2*k*delta*t))*u(t)+(Delta-AM*sin(phi+2*k*delta*t))*v(t), diff(v(t),t)=-(Delta+AM*sin(phi+2*k*delta*t))*u(t)-(Gamma-AM*cos(phi+2*k*delta*t))*v(t)-2*Omega0*cos(delta*t)*w(t), diff(w(t),t)=-0.5-b*w(t)+2*Omega0*cos(delta*t)*v(t):
dsol1 :=dsolve({dsys1,ini1},{u(t), v(t),w(t)},numeric, output=listprocedure, abserr=1e-9, relerr=1e-8,range=0..1):
dsolu:=subs(dsol1,u(t)):dsolv:=subs(dsol1,v(t)):dsolw:=subs(dsol1,w(t)):
t1:=array(0..N1,[]): u1:=array(0..N1,[]): v1:=array(0..N1,[]): w1:=array(0..N1,[]): pt1:=array(0..N1,[]):pt2:=array(0..N1,[]):pt3:=array(0..N1,[]):
for i from 0 to N1 do t1[i]:=evalf(th*i):u1[i]:=evalf(dsolu(t1[i]));v1[i]:=evalf(dsolv(t1[i])):w1[i]:=evalf(dsolw(t1[i])):pt1[i]:=[t1[i],u1[i]]:pt2[i]:=[t1[i],v1[i]]:pt3[i]:=[t1[i],w1[i]]:od:
pts:=50:tn:=900:
unassign('i'):mytab1:=[seq(pt1[i],i=0..N1)]:mytab2:=[seq(pt2[i],i=0..N1)]:mytab3:=[seq(pt3[i],i=0..N1)]:
assign(sols):
#########Compare the two systems( system2 vs system 3)
plot([mytab3,(w0(t))],t=0..5,linestyle=[4,1],color=[black,black],axes=boxed,thickness=[3,3],tickmarks=[2,3],numpoints=tn);

## How can solve this...

How can I solve this non-autonomous system by maple.

I solve it  analytically(by hand) I want to try in maple realy I need your help Mr Robert.

## veiw of the figures...

Thank you all for your help.

I try  this code

solsx:=simplify(evalf(dsolve({dsys ,inix}, {x0(t), y0(t),z0(t)},method = laplace)));

sols:=simplify(evalf(dsolve({dsys0 ,ini0}, {u0(t), v0(t),w0(t)},method = laplace)));

dsol1 :=dsolve({dsys1,ini1},{u(t), v(t),w(t)},numeric, output=listprocedure, abserr=1e-9, relerr=1e-8,range=0..1):

total i have 3 systems the first one i use the solutions in the second system at the end i compare sols vs numeric. which is works.

my problems now:

(1) the figures i got unexpected in othe word how can i contol the error at the system i solved by laplce. note the  Digits:=15: and every time i change the value of the digits the figures change?

(2) How can i know the coffiecients of the initial value of system2  to put them in formula

## dsys1 := diff(u(t), t) =...

dsys1 := diff(u(t), t) = -(3/2-sqrt(2))*u(t)+5*v(t), diff(v(t), t) = -5*u(t)-(3/2+sqrt(2))*v(t)-20*cos(10*t)*w(t), diff(w(t), t) = -.5-3*w(t)+20*cos(10*t)*v(t)

 1 2 3 Page 2 of 3
﻿