# Question:How to substitute a numerical solution of one equation into the other differential equation for solving

## Question:How to substitute a numerical solution of one equation into the other differential equation for solving

Maple

Firstly, I need solve q(t) by the following procedure:

u := 8.53;
dsys0:={diff(q(t), `\$`(t, 2)) = u*(1 - q(t)*q(t)) * diff(q(t), `\$`(t, 1)) - q(t), q(0) = 0, D(q)(0) = 1};
dsol0:=dsolve(dsys0,numeric,method=rkf45,abserr=10^(-10),relerr=10^(-16),range=0..6,maxfun=0,output=listprocedure);
yy0:= eval(q(t), dsol0);

Furthermore, I need substitute q(t) into two second order differential equations for solving yy10 and yy01. The procedure is

dsys10:={diff(q10(t), `\$`(t, 2)) = u*(1 - yy0(t)*yy0(t)) * diff(q10(t), `\$`(t, 1)) - 2*u*yy0(t)*diff(yy0(t), `\$`(t, 1)) * diff(q10(t), `\$`(t, 1))- q10(t), q10(0) = 0, D(q10)(0) = 1};
dsol10:=dsolve(dsys10,numeric,method=rkf45,abserr=10^(-10),relerr=10^(-16),range=0..6,maxfun=0,output=listprocedure);
yy10:= eval(q10(t), dsol10);
dsys01:={diff(q01(t), `\$`(t, 2)) = u*(1 - yy0(t)*yy0(t)) * diff(q01(t), `\$`(t, 1)) - 2*u*yy0(t)*diff(yy0(t), `\$`(t, 1)) * diff(q01(t), `\$`(t, 1))- q01(t), q10(0) = 0, D(q10)(0) = 0};
dsol01:=dsolve(dsys01,numeric,method=rkf45,abserr=10^(-10),relerr=10^(-16),range=0..6,maxfun=0,output=listprocedure);
yy01:= eval(q01(t), dsol01);
y1:= eval(t, dsol10);

The problem is the substitution of q(t) = yy0(t) is wrong. How to substitute this numerical function into the differential equations for solving ?????????

Then I want to plot the error function figures as follows,

for k from 1 to 1000 do
tt[k] := 0.006 * k;
re1[k]:= 1/w1 * Re(eval(y10, t= 0.006*k)) + 1/w2 * Re(eval(y01,t = 0.006*k));
im1[k]:= 1/w1 * Im(eval(y10, t= 0.006*k)) + 1/w2 * Im(eval(y01,t = 0.006*k));
end do:
N := 1000:
s7:= seq([tt[p], re[p] - re0[p] -re1[p]], p=1..N):
s8:= seq([tt[p], im[p] - im0[p] -im1[p]], p = 1..N):
with(plots): plot([s7], font=[Times, roman, 14]); plot([s8], font=[Times, roman, 14]);

Therefore, I cann't plot the figures.

﻿