delvin

55 Reputation

6 Badges

2 years, 281 days

MaplePrimes Activity


These are replies submitted by delvin

@C_R 

 Ok, thanks.

@mmcdara 

Sorry,

It can be said that there is a disadvantage of software 1 because I previously executed 2 and 2 of these commands without error, but for other equations.

@delvin 

My dear friend @mmcdara, they worked hard.

But I have a problem with the loop again, I don't know why it gives an error

restart

eq_27 := diff(u[n](t), t$2) = alpha*(- exp(-beta*u[n-1](t)) + 2*exp(-beta*u[n](t)) - exp(-beta*u[n+1](t)))

diff(diff(u[n](t), t), t) = alpha*(-exp(-beta*u[n-1](t))+2*exp(-beta*u[n](t))-exp(-beta*u[n+1](t)))

(1)

eq_28 := n -> exp(-beta*u[n](t)) = 1+v[n](t)/alpha

proc (n) options operator, arrow; exp(-beta*u[n](t)) = 1+v[n](t)/alpha end proc

(2)

aux_1 := isolate(eq_28(n), u[n](t));

u[n](t) = -ln((v[n](t)+alpha)/alpha)/beta

(3)

eq_29 := eval(convert(lhs(eq_27), Diff), aux_1)
         =
         simplify(eval(rhs(eq_27), {seq(eq_28(n+k), k=-1..1)}));

Diff(Diff(-ln((v[n](t)+alpha)/alpha)/beta, t), t) = -v[n-1](t)+2*v[n](t)-v[n+1](t)

(4)

lhs_27 := eval(lhs(eq_27), u[n]=(t -> u[n](xi[n](t)))):
der    := [select(has, indets(%), diff)[]]:
lhs_27 := eval(lhs_27, der =~ eval(der, xi[n](t) = d__1*n + c__1*t + zeta__1)):
lhs_27 := convert(eval(lhs_27, xi[n](t)=xi[n]), diff);

(diff(diff(u[n](xi[n]), xi[n]), xi[n]))*c__1^2

(5)

aux_2 := select(has, indets(rhs(aux_1), function), ln)[] = H(t);

ln((v[n](t)+alpha)/alpha) = H(t)

(6)

eq_29_a := simplify(isolate(convert(eval(eq_29, aux_2), diff), diff(H(t), t$2)));

diff(diff(H(t), t), t) = (v[n-1](t)-2*v[n](t)+v[n+1](t))*beta

(7)

eq_30_1 := lhs_27=rhs(eq_29_a)

(diff(diff(u[n](xi[n]), xi[n]), xi[n]))*c__1^2 = (v[n-1](t)-2*v[n](t)+v[n+1](t))*beta

(8)

eq_30 := eval(convert(eq_30_1, Diff), u[n](xi[n])=lhs(aux_2))

(Diff(Diff(ln((v[n](t)+alpha)/alpha), xi[n]), xi[n]))*c__1^2 = (v[n-1](t)-2*v[n](t)+v[n+1](t))*beta

(9)

eq_30_a := eval(eq_30, {seq(v[n+k](t)=V[n+k](xi[n]), k=-1..1)})

(Diff(Diff(ln((V[n](xi[n])+alpha)/alpha), xi[n]), xi[n]))*c__1^2 = (V[n-1](xi[n])-2*V[n](xi[n])+V[n+1](xi[n]))*beta

(10)

 

eq_30_a is consistent for all the V are functions of xi[n] and you take derivatives wrt xi[n].
eq_30_a is the true equation (30) in the paper you refer to.

But eq_30 is not consistent (funstions of t and derivative wrt xi[n]).

 

 

printf("\n\nWhat you do\n\n"):

Replacements_v := {
  v[n](t) = a[0]+sum(-a[i]*(tanh(t[n]))^i, i = 1 .. 2)+sum(-b[i]*(tanh(t[n]))^(-i), i = 1 .. 2)
  , v[n+1](t) = a[0]-a[1]*(tanh(t[n])+tanh(d))/(1+tanh(t[n])*tanh(d))-a[2]*(tanh(t[n])+tanh(d))^2/(1+tanh(t[n])*tanh(d))^2-b[1]*(1+tanh(t[n])*tanh(d))/(tanh(t[n])+tanh(d))-b[2]*(1+tanh(t[n])*tanh(d))^2/(tanh(t[n])+tanh(d))^2
  , v[n-1](t) = a[0]-a[1]*(tanh(t[n])-tanh(d))/(1-tanh(t[n])*tanh(d))-a[2]*((tanh(t[n])-tanh(d))/(1-tanh(t[n])*tanh(d)))^2-b[1]*(1-tanh(t[n])*tanh(d))/(tanh(t[n])-tanh(d))-b[2]*((1-tanh(t[n])*tanh(d))/(tanh(t[n])-tanh(d)))^2
}:
print~(Replacements_v):


# Is it not this that you should do?

printf("\n\nIs it not this that you should do to account for consistency?\n\n"):

Replacements_V := eval(Replacements_v, {t[n]=xi[n], seq(v[n+k](t)=V[n+k](xi[n]), k=-1..1)}):
print~(Replacements_V):


# Or more simply

printf("\n\nOr more simply\n\n"):

Replacements_Vth := {
  V[n](xi[n]) = a[0]-a[1]*tanh(xi[n])-a[2]*tanh(xi[n])^2-b[1]/tanh(xi[n])-b[2]/tanh(xi[n])^2
  , V[n-1](xi[n]) = a[0]-a[1]*tanh(xi[n]-d)-a[2]*tanh(xi[n]-d)^2-b[1]/tanh(xi[n]-d)-b[2]/tanh(xi[n]-d)^2
  , V[n+1](xi[n]) = a[0]-a[1]*tanh(xi[n]+d)-a[2]*tanh(xi[n]+d)^2-b[1]/tanh(xi[n]+d)-b[2]/tanh(xi[n]+d)^2
}:
print~(Replacements_Vth):



What you do
 

 

v[n](t) = a[0]-a[1]*tanh(t[n])-a[2]*tanh(t[n])^2-b[1]/tanh(t[n])-b[2]/tanh(t[n])^2

 

v[n-1](t) = a[0]-a[1]*(tanh(t[n])-tanh(d))/(1-tanh(t[n])*tanh(d))-a[2]*(tanh(t[n])-tanh(d))^2/(1-tanh(t[n])*tanh(d))^2-b[1]*(1-tanh(t[n])*tanh(d))/(tanh(t[n])-tanh(d))-b[2]*(1-tanh(t[n])*tanh(d))^2/(tanh(t[n])-tanh(d))^2

 

v[n+1](t) = a[0]-a[1]*(tanh(t[n])+tanh(d))/(1+tanh(t[n])*tanh(d))-a[2]*(tanh(t[n])+tanh(d))^2/(1+tanh(t[n])*tanh(d))^2-b[1]*(1+tanh(t[n])*tanh(d))/(tanh(t[n])+tanh(d))-b[2]*(1+tanh(t[n])*tanh(d))^2/(tanh(t[n])+tanh(d))^2

 



Is it not this that you should do to account for consistency?
 

 

V[n](xi[n]) = a[0]-a[1]*tanh(xi[n])-a[2]*tanh(xi[n])^2-b[1]/tanh(xi[n])-b[2]/tanh(xi[n])^2

 

V[n-1](xi[n]) = a[0]-a[1]*(tanh(xi[n])-tanh(d))/(1-tanh(xi[n])*tanh(d))-a[2]*(tanh(xi[n])-tanh(d))^2/(1-tanh(xi[n])*tanh(d))^2-b[1]*(1-tanh(xi[n])*tanh(d))/(tanh(xi[n])-tanh(d))-b[2]*(1-tanh(xi[n])*tanh(d))^2/(tanh(xi[n])-tanh(d))^2

 

V[n+1](xi[n]) = a[0]-a[1]*(tanh(xi[n])+tanh(d))/(1+tanh(xi[n])*tanh(d))-a[2]*(tanh(xi[n])+tanh(d))^2/(1+tanh(xi[n])*tanh(d))^2-b[1]*(1+tanh(xi[n])*tanh(d))/(tanh(xi[n])+tanh(d))-b[2]*(1+tanh(xi[n])*tanh(d))^2/(tanh(xi[n])+tanh(d))^2

 



Or more simply
 

 

V[n](xi[n]) = a[0]-a[1]*tanh(xi[n])-a[2]*tanh(xi[n])^2-b[1]/tanh(xi[n])-b[2]/tanh(xi[n])^2

 

V[n-1](xi[n]) = a[0]+a[1]*tanh(-xi[n]+d)-a[2]*tanh(-xi[n]+d)^2+b[1]/tanh(-xi[n]+d)-b[2]/tanh(-xi[n]+d)^2

 

V[n+1](xi[n]) = a[0]-a[1]*tanh(xi[n]+d)-a[2]*tanh(xi[n]+d)^2-b[1]/tanh(xi[n]+d)-b[2]/tanh(xi[n]+d)^2

(11)

fin0 := eval(eq_30_a, Replacements_Vth)

(Diff(Diff(ln((a[0]-a[1]*tanh(xi[n])-a[2]*tanh(xi[n])^2-b[1]/tanh(xi[n])-b[2]/tanh(xi[n])^2+alpha)/alpha), xi[n]), xi[n]))*c__1^2 = (a[1]*tanh(-xi[n]+d)-a[2]*tanh(-xi[n]+d)^2+b[1]/tanh(-xi[n]+d)-b[2]/tanh(-xi[n]+d)^2+2*a[1]*tanh(xi[n])+2*a[2]*tanh(xi[n])^2+2*b[1]/tanh(xi[n])+2*b[2]/tanh(xi[n])^2-a[1]*tanh(xi[n]+d)-a[2]*tanh(xi[n]+d)^2-b[1]/tanh(xi[n]+d)-b[2]/tanh(xi[n]+d)^2)*beta

(12)

# To force the derivation uncomment the next line

fin0 := convert(fin0, diff)

((2*a[1]*tanh(xi[n])*(1-tanh(xi[n])^2)-2*a[2]*(1-tanh(xi[n])^2)^2+4*a[2]*tanh(xi[n])^2*(1-tanh(xi[n])^2)-2*b[1]*(1-tanh(xi[n])^2)^2/tanh(xi[n])^3-2*b[1]*(1-tanh(xi[n])^2)/tanh(xi[n])-6*b[2]*(1-tanh(xi[n])^2)^2/tanh(xi[n])^4-4*b[2]*(1-tanh(xi[n])^2)/tanh(xi[n])^2)/(a[0]-a[1]*tanh(xi[n])-a[2]*tanh(xi[n])^2-b[1]/tanh(xi[n])-b[2]/tanh(xi[n])^2+alpha)-(-a[1]*(1-tanh(xi[n])^2)-2*a[2]*tanh(xi[n])*(1-tanh(xi[n])^2)+b[1]*(1-tanh(xi[n])^2)/tanh(xi[n])^2+2*b[2]*(1-tanh(xi[n])^2)/tanh(xi[n])^3)^2/(a[0]-a[1]*tanh(xi[n])-a[2]*tanh(xi[n])^2-b[1]/tanh(xi[n])-b[2]/tanh(xi[n])^2+alpha)^2)*c__1^2 = (a[1]*tanh(-xi[n]+d)-a[2]*tanh(-xi[n]+d)^2+b[1]/tanh(-xi[n]+d)-b[2]/tanh(-xi[n]+d)^2+2*a[1]*tanh(xi[n])+2*a[2]*tanh(xi[n])^2+2*b[1]/tanh(xi[n])+2*b[2]/tanh(xi[n])^2-a[1]*tanh(xi[n]+d)-a[2]*tanh(xi[n]+d)^2-b[1]/tanh(xi[n]+d)-b[2]/tanh(xi[n]+d)^2)*beta

(13)

# look at this to understand why you get an error.

p/q=P/Q;
numer(%);

p/q = P/Q

 

Error, invalid input: numer expects its 1st argument, x, to be of type {algebraic, list, set}, but received p/q = P/Q

 

# or to this

p=P/Q;
numer(%);

p = P/Q

 

Error, invalid input: numer expects its 1st argument, x, to be of type {algebraic, list, set}, but received p = P/Q

 

# if you want to get the numerators of both sides do this

p/q=P/Q;
map(numer, %)

p/q = P/Q

 

p = P

(14)

# APPLICATION:

fin1 := map(numer, fin0)

(tanh(xi[n])^2-1)*tanh(xi[n])^4*(-10*tanh(xi[n])^3*a[1]*b[2]-2*tanh(xi[n])^3*b[1]*b[2]+6*tanh(xi[n])^2*alpha*b[2]+6*tanh(xi[n])^2*a[0]*b[2]-4*tanh(xi[n])*b[1]*b[2]-2*tanh(xi[n])^7*a[0]*a[1]+2*tanh(xi[n])^7*a[1]*a[2]+10*tanh(xi[n])^7*a[2]*b[1]+2*tanh(xi[n])^6*alpha*a[2]+2*tanh(xi[n])^6*a[0]*a[2]+4*tanh(xi[n])^6*a[1]*b[1]+16*tanh(xi[n])^6*a[2]*b[2]+8*tanh(xi[n])^5*a[1]*b[2]-8*tanh(xi[n])^5*a[2]*b[1]-2*tanh(xi[n])^4*alpha*b[2]-2*tanh(xi[n])^4*a[0]*b[2]-4*tanh(xi[n])^4*a[1]*b[1]-16*tanh(xi[n])^4*a[2]*b[2]+2*tanh(xi[n])^3*alpha*b[1]+2*tanh(xi[n])^3*a[0]*b[1]+4*tanh(xi[n])^9*a[1]*a[2]-6*tanh(xi[n])^8*alpha*a[2]-6*tanh(xi[n])^8*a[0]*a[2]-2*tanh(xi[n])^7*alpha*a[1]+2*tanh(xi[n])^10*a[2]^2+tanh(xi[n])^8*a[1]^2+2*tanh(xi[n])^8*a[2]^2+tanh(xi[n])^6*a[1]^2-tanh(xi[n])^4*b[1]^2-tanh(xi[n])^2*b[1]^2-2*tanh(xi[n])^2*b[2]^2-2*b[2]^2)*c__1^2 = -(a[2]*tanh(-xi[n]+d)^4*tanh(xi[n])^2*tanh(xi[n]+d)^2+a[2]*tanh(xi[n]+d)^4*tanh(-xi[n]+d)^2*tanh(xi[n])^2-2*a[2]*tanh(xi[n])^4*tanh(-xi[n]+d)^2*tanh(xi[n]+d)^2-a[1]*tanh(-xi[n]+d)^3*tanh(xi[n])^2*tanh(xi[n]+d)^2+a[1]*tanh(xi[n]+d)^3*tanh(-xi[n]+d)^2*tanh(xi[n])^2-2*a[1]*tanh(xi[n])^3*tanh(-xi[n]+d)^2*tanh(xi[n]+d)^2-2*b[1]*tanh(-xi[n]+d)^2*tanh(xi[n])*tanh(xi[n]+d)^2+b[1]*tanh(-xi[n]+d)^2*tanh(xi[n])^2*tanh(xi[n]+d)-b[1]*tanh(-xi[n]+d)*tanh(xi[n])^2*tanh(xi[n]+d)^2-2*b[2]*tanh(-xi[n]+d)^2*tanh(xi[n]+d)^2+b[2]*tanh(-xi[n]+d)^2*tanh(xi[n])^2+b[2]*tanh(xi[n])^2*tanh(xi[n]+d)^2)*beta

(15)

# Use this correction and do a step worward

 

subs(tanh(xi[n]) = Psi, fin1); fin := simplify(%)

2*(Psi-1)*Psi^4*(Psi+1)*c__1^2*(Psi^10*a[2]^2+2*Psi^9*a[1]*a[2]+(a[2]^2+(-3*alpha-3*a[0])*a[2]+(1/2)*a[1]^2)*Psi^8+((a[1]+5*b[1])*a[2]-a[1]*(alpha+a[0]))*Psi^7+((alpha+a[0]+8*b[2])*a[2]+(1/2)*a[1]*(a[1]+4*b[1]))*Psi^6+(4*a[1]*b[2]-4*a[2]*b[1])*Psi^5+(-8*a[2]*b[2]+(-alpha-a[0])*b[2]-2*((1/4)*b[1]+a[1])*b[1])*Psi^4+((-5*a[1]-b[1])*b[2]+b[1]*(alpha+a[0]))*Psi^3+(-b[2]^2+(3*alpha+3*a[0])*b[2]-(1/2)*b[1]^2)*Psi^2-2*Psi*b[1]*b[2]-b[2]^2) = -(a[2]*tanh(-xi[n]+d)^4*Psi^2*tanh(xi[n]+d)^2-a[1]*tanh(-xi[n]+d)^3*Psi^2*tanh(xi[n]+d)^2+(a[2]*tanh(xi[n]+d)^4*Psi^2+a[1]*tanh(xi[n]+d)^3*Psi^2+(-2*Psi^4*a[2]-2*Psi^3*a[1]-2*Psi*b[1]-2*b[2])*tanh(xi[n]+d)^2+b[1]*Psi^2*tanh(xi[n]+d)+b[2]*Psi^2)*tanh(-xi[n]+d)^2-b[1]*tanh(-xi[n]+d)*Psi^2*tanh(xi[n]+d)^2+b[2]*Psi^2*tanh(xi[n]+d)^2)*beta

(16)

 

NULL

for i from 0 to degree(fin, Psi) do EQ[i] := simplify(coeff(fin, Psi, i)) end do

Error, final value in for loop must be numeric or character

 

Eqs := {seq(EQ[i], i = 0 .. 6)}

Sol := solve(Eqs, {a[0], a[1], a[2], b[1], b[2], c[1]})``

(17)

Download ddd3.mw

@mmcdara 

 Thank you for everything you do.

Unfortunately no.

@mmcdara 

Thanks 

Sorry, I was not familiar with vote.

Only one of the answers had a cup.

@mmcdara 

 Hello,

Can you see why the rest is wrong?

restart

eq_27 := diff(u[n](t), t$2) = alpha*(- exp(-beta*u[n-1](t)) + 2*exp(-beta*u[n](t)) - exp(-beta*u[n+1](t)))

diff(diff(u[n](t), t), t) = alpha*(-exp(-beta*u[n-1](t))+2*exp(-beta*u[n](t))-exp(-beta*u[n+1](t)))

(1)

eq_28 := n -> exp(-beta*u[n](t)) = 1+v[n](t)/alpha

proc (n) options operator, arrow; exp(-beta*u[n](t)) = 1+v[n](t)/alpha end proc

(2)

aux_1 := isolate(eq_28(n), u[n](t));

u[n](t) = -ln((v[n](t)+alpha)/alpha)/beta

(3)

eq_29 := eval(convert(lhs(eq_27), Diff), aux_1)
         =
         simplify(eval(rhs(eq_27), {seq(eq_28(n+k), k=-1..1)}));

Diff(Diff(-ln((v[n](t)+alpha)/alpha)/beta, t), t) = -v[n-1](t)+2*v[n](t)-v[n+1](t)

(4)

lhs_27 := eval(lhs(eq_27), u[n]=(t -> u[n](xi[n](t)))):
der    := [select(has, indets(%), diff)[]]:
lhs_27 := eval(lhs_27, der =~ eval(der, xi[n](t) = d__1*n + c__1*t + zeta__1)):
lhs_27 := convert(eval(lhs_27, xi[n](t)=xi[n]), diff);

(diff(diff(u[n](xi[n]), xi[n]), xi[n]))*c__1^2

(5)

aux_2 := select(has, indets(rhs(aux_1), function), ln)[] = H(t);

ln((v[n](t)+alpha)/alpha) = H(t)

(6)

eq_29_a := simplify(isolate(convert(eval(eq_29, aux_2), diff), diff(H(t), t$2)));

diff(diff(H(t), t), t) = (v[n-1](t)-2*v[n](t)+v[n+1](t))*beta

(7)

eq_30_1 := lhs_27=rhs(eq_29_a)

(diff(diff(u[n](xi[n]), xi[n]), xi[n]))*c__1^2 = (v[n-1](t)-2*v[n](t)+v[n+1](t))*beta

(8)

eq_30 := eval(convert(eq_30_1, Diff), u[n](xi[n])=lhs(aux_2))

(Diff(Diff(ln((v[n](t)+alpha)/alpha), xi[n]), xi[n]))*c__1^2 = (v[n-1](t)-2*v[n](t)+v[n+1](t))*beta

(9)

eq_30_a := eval(eq_30, {seq(v[n+k](t)=V[n+k](xi[n]), k=-1..1)})

(Diff(Diff(ln((V[n](xi[n])+alpha)/alpha), xi[n]), xi[n]))*c__1^2 = (V[n-1](xi[n])-2*V[n](xi[n])+V[n+1](xi[n]))*beta

(10)

 

eq_30_a is consistent for all the V are functions of xi[n] and you take derivatives wrt xi[n].
eq_30_a is the true equation (30) in the paper you refer to.

But eq_30 is not consistent (funstions of t and derivative wrt xi[n]).

 

 

printf("\n\nWhat you do\n\n"):

Replacements_v := {
  v[n](t) = a[0]+sum(-a[i]*(tanh(t[n]))^i, i = 1 .. 2)+sum(-b[i]*(tanh(t[n]))^(-i), i = 1 .. 2)
  , v[n+1](t) = a[0]-a[1]*(tanh(t[n])+tanh(d))/(1+tanh(t[n])*tanh(d))-a[2]*(tanh(t[n])+tanh(d))^2/(1+tanh(t[n])*tanh(d))^2-b[1]*(1+tanh(t[n])*tanh(d))/(tanh(t[n])+tanh(d))-b[2]*(1+tanh(t[n])*tanh(d))^2/(tanh(t[n])+tanh(d))^2
  , v[n-1](t) = a[0]-a[1]*(tanh(t[n])-tanh(d))/(1-tanh(t[n])*tanh(d))-a[2]*((tanh(t[n])-tanh(d))/(1-tanh(t[n])*tanh(d)))^2-b[1]*(1-tanh(t[n])*tanh(d))/(tanh(t[n])-tanh(d))-b[2]*((1-tanh(t[n])*tanh(d))/(tanh(t[n])-tanh(d)))^2
}:
print~(Replacements_v):


# Is it not this that you should do?

printf("\n\nIs it not this that you should do to account for consistency?\n\n"):

Replacements_V := eval(Replacements_v, {t[n]=xi[n], seq(v[n+k](t)=V[n+k](xi[n]), k=-1..1)}):
print~(Replacements_V):


# Or more simply

printf("\n\nOr more simply\n\n"):

Replacements_Vth := {
  V[n](xi[n]) = a[0]-a[1]*tanh(xi[n])-a[2]*tanh(xi[n])^2-b[1]/tanh(xi[n])-b[2]/tanh(xi[n])^2
  , V[n-1](xi[n]) = a[0]-a[1]*tanh(xi[n]-d)-a[2]*tanh(xi[n]-d)^2-b[1]/tanh(xi[n]-d)-b[2]/tanh(xi[n]-d)^2
  , V[n+1](xi[n]) = a[0]-a[1]*tanh(xi[n]+d)-a[2]*tanh(xi[n]+d)^2-b[1]/tanh(xi[n]+d)-b[2]/tanh(xi[n]+d)^2
}:
print~(Replacements_Vth):



What you do
 

 

v[n](t) = a[0]-a[1]*tanh(t[n])-a[2]*tanh(t[n])^2-b[1]/tanh(t[n])-b[2]/tanh(t[n])^2

 

v[n-1](t) = a[0]-a[1]*(tanh(t[n])-tanh(d))/(1-tanh(t[n])*tanh(d))-a[2]*(tanh(t[n])-tanh(d))^2/(1-tanh(t[n])*tanh(d))^2-b[1]*(1-tanh(t[n])*tanh(d))/(tanh(t[n])-tanh(d))-b[2]*(1-tanh(t[n])*tanh(d))^2/(tanh(t[n])-tanh(d))^2

 

v[n+1](t) = a[0]-a[1]*(tanh(t[n])+tanh(d))/(1+tanh(t[n])*tanh(d))-a[2]*(tanh(t[n])+tanh(d))^2/(1+tanh(t[n])*tanh(d))^2-b[1]*(1+tanh(t[n])*tanh(d))/(tanh(t[n])+tanh(d))-b[2]*(1+tanh(t[n])*tanh(d))^2/(tanh(t[n])+tanh(d))^2

 



Is it not this that you should do to account for consistency?
 

 

V[n](xi[n]) = a[0]-a[1]*tanh(xi[n])-a[2]*tanh(xi[n])^2-b[1]/tanh(xi[n])-b[2]/tanh(xi[n])^2

 

V[n-1](xi[n]) = a[0]-a[1]*(tanh(xi[n])-tanh(d))/(1-tanh(xi[n])*tanh(d))-a[2]*(tanh(xi[n])-tanh(d))^2/(1-tanh(xi[n])*tanh(d))^2-b[1]*(1-tanh(xi[n])*tanh(d))/(tanh(xi[n])-tanh(d))-b[2]*(1-tanh(xi[n])*tanh(d))^2/(tanh(xi[n])-tanh(d))^2

 

V[n+1](xi[n]) = a[0]-a[1]*(tanh(xi[n])+tanh(d))/(1+tanh(xi[n])*tanh(d))-a[2]*(tanh(xi[n])+tanh(d))^2/(1+tanh(xi[n])*tanh(d))^2-b[1]*(1+tanh(xi[n])*tanh(d))/(tanh(xi[n])+tanh(d))-b[2]*(1+tanh(xi[n])*tanh(d))^2/(tanh(xi[n])+tanh(d))^2

 



Or more simply
 

 

V[n](xi[n]) = a[0]-a[1]*tanh(xi[n])-a[2]*tanh(xi[n])^2-b[1]/tanh(xi[n])-b[2]/tanh(xi[n])^2

 

V[n-1](xi[n]) = a[0]+a[1]*tanh(-xi[n]+d)-a[2]*tanh(-xi[n]+d)^2+b[1]/tanh(-xi[n]+d)-b[2]/tanh(-xi[n]+d)^2

 

V[n+1](xi[n]) = a[0]-a[1]*tanh(xi[n]+d)-a[2]*tanh(xi[n]+d)^2-b[1]/tanh(xi[n]+d)-b[2]/tanh(xi[n]+d)^2

(11)

fin0 := eval(eq_30_a, Replacements_Vth)

(Diff(Diff(ln((a[0]-a[1]*tanh(xi[n])-a[2]*tanh(xi[n])^2-b[1]/tanh(xi[n])-b[2]/tanh(xi[n])^2+alpha)/alpha), xi[n]), xi[n]))*c__1^2 = (a[1]*tanh(-xi[n]+d)-a[2]*tanh(-xi[n]+d)^2+b[1]/tanh(-xi[n]+d)-b[2]/tanh(-xi[n]+d)^2+2*a[1]*tanh(xi[n])+2*a[2]*tanh(xi[n])^2+2*b[1]/tanh(xi[n])+2*b[2]/tanh(xi[n])^2-a[1]*tanh(xi[n]+d)-a[2]*tanh(xi[n]+d)^2-b[1]/tanh(xi[n]+d)-b[2]/tanh(xi[n]+d)^2)*beta

(12)

# To force the derivation uncomment the next line

# convert(fin0, diff)

fin1 := simplify(numer(fin0))

Error, invalid input: numer expects its 1st argument, x, to be of type {algebraic, list, set}, but received Diff(Diff(ln((a[0]-a[1]*tanh(xi[n])-a[2]*tanh(xi[n])^2-b[1]/tanh(xi[n])-b[2]/tanh(xi[n])^2+alpha)/alpha),xi[n]),xi[n])*c__1^2 = (a[1]*tanh(-xi[n]+d)-a[2]*tanh(-xi[n]+d)^2+b[1]/tanh(-xi[n]+d)-b[2]/tanh(-xi[n]+d)^2+2*a[1]*tanh(xi[n])+2*a[2]*tanh(xi[n])^2+2*b[1]/tanh(xi[n])+2*b[2]/tanh(xi[n])^2-a[1]*tanh(xi[n]+d)-a[2]*tanh(xi[n]+d)^2-b[1]/tanh(xi[n]+d)-b[2]/tanh(xi[n]+d)^2)*beta

 

NULL

fin := simplify(subs(tanh(xi[n]) = Psi, fin1));

fin1

(13)

degree(fin,Psi)

0

(14)

FF:=convert(series(fin,Psi,7),polynom):

degree(%,Psi)

0

(15)

for i from 0 to degree(FF, Psi) do
    EQ[i] := simplify(coeff(FF, Psi, i));
end do

fin1

(16)

NULL

Eqs := {seq(EQ[i], i = 0 .. 6)}

Sol := dsolve(Eqs, {a[0], a[1], a[2], b[1], b[2], c[1]})

Error, (in dsolve) not a system with respect to the unknowns {a[0], a[1], a[2], b[1], b[2], c[1]}

 

 

Download ddd_1_mmcdara.mw

@mmcdara 

 I appreciate your taking the time.

 Yes, I think it is correct, as if I wrote the variables wrong, I want to get the answer to equation 30 with these placements. .I very much appreciate your help

The first part was answered by dear friend mmcdara 4975.

But I used a simpler method to solve it, but it didn't work. Can anyone help me?

restart

eq_27 := diff(u[n](t), t$2) = alpha*(- exp(-beta*u[n-1](t)) + 2*exp(-beta*u[n](t)) - exp(-beta*u[n+1](t)))

diff(diff(u[n](t), t), t) = alpha*(-exp(-beta*u[n-1](t))+2*exp(-beta*u[n](t))-exp(-beta*u[n+1](t)))

(1)

eq_28 := n -> exp(-beta*u[n](t)) = 1+v[n](t)/alpha

proc (n) options operator, arrow; exp(-beta*u[n](t)) = 1+v[n](t)/alpha end proc

(2)

aux_1 := isolate(eq_28(n), u[n](t));

u[n](t) = -ln((v[n](t)+alpha)/alpha)/beta

(3)

eq_29 := eval(convert(lhs(eq_27), Diff), aux_1)
         =
         simplify(eval(rhs(eq_27), {seq(eq_28(n+k), k=-1..1)}));

Diff(Diff(-ln((v[n](t)+alpha)/alpha)/beta, t), t) = -v[n-1](t)+2*v[n](t)-v[n+1](t)

(4)

lhs_27 := eval(lhs(eq_27), u[n]=(t -> u[n](xi[n](t)))):
d      := [select(has, indets(%), diff)[]]:
lhs_27 := eval(lhs_27, d =~ eval(d, xi[n](t) = d__1*n + c__1*t + zeta__1)):
lhs_27 := convert(eval(lhs_27, xi[n](t)=xi[n]), diff);

(diff(diff(u[n](xi[n]), xi[n]), xi[n]))*c__1^2

(5)

aux_2 := select(has, indets(rhs(aux_1), function), ln)[] = H(t);

ln((v[n](t)+alpha)/alpha) = H(t)

(6)

eq_29_a := simplify(isolate(convert(eval(eq_29, aux_2), diff), diff(H(t), t$2)));

diff(diff(H(t), t), t) = (v[n-1](t)-2*v[n](t)+v[n+1](t))*beta

(7)

eq_30_1 := lhs_27=rhs(eq_29_a)

(diff(diff(u[n](xi[n]), xi[n]), xi[n]))*c__1^2 = (v[n-1](t)-2*v[n](t)+v[n+1](t))*beta

(8)

eq_30 := eval(convert(eq_30_1, Diff), u[n](xi[n])=lhs(aux_2))

(Diff(Diff(ln((v[n](t)+alpha)/alpha), xi[n]), xi[n]))*c__1^2 = (v[n-1](t)-2*v[n](t)+v[n+1](t))*beta

(9)

"v[n](t):=a[0]+sum(-a[i]*(tanh)^(i)(t[n]),i=1..2)+sum(-b[i]*(tanh)^(-i)(t[n]),i=1..2);"

proc (t) options operator, arrow, function_assign; a[0]+sum(-a[i]*(tanh^i)(t[n]), i = 1 .. 2)+sum(-b[i]*(tanh^(-i))(t[n]), i = 1 .. 2) end proc

(10)

"v[n+1](t):=a[0]-a[1]*(tanh(t[n])+tanh(d))/(1+tanh(t[n])*tanh(d))-a[2]*((tanh(t[n])+tanh(d))/(1+tanh(t[n])*tanh(d)))^(2)-b[1]*(1+tanh(t[n])*tanh(d))/(tanh(t[n])+tanh(d))-b[2]*((1+tanh(t[n])*tanh(d))/(tanh(t[n])+tanh(d)))^(2);"

proc (t) options operator, arrow, function_assign; a[0]-a[1]*(tanh(t[n])+tanh(d))/(1+tanh(t[n])*tanh(d))-a[2]*(tanh(t[n])+tanh(d))^2/(1+tanh(t[n])*tanh(d))^2-b[1]*(1+tanh(t[n])*tanh(d))/(tanh(t[n])+tanh(d))-b[2]*(1+tanh(t[n])*tanh(d))^2/(tanh(t[n])+tanh(d))^2 end proc

(11)

NULL

"v[n-1](t):=a[0]-a[1]*(tanh(t[n])-tanh(d))/(1-tanh(t[n])*tanh(d))-a[2]*((tanh(t[n])-tanh(d))/(1-tanh(t[n])*tanh(d)))^(2)-b[1]*(1-tanh(t[n])*tanh(d))/(tanh(t[n])-tanh(d))-b[2]*((1-tanh(t[n])*tanh(d))/(tanh(t[n])-tanh(d)))^(2);"

proc (t) options operator, arrow, function_assign; a[0]-a[1]*(tanh(t[n])-tanh(d))/(1-tanh(t[n])*tanh(d))-a[2]*(tanh(t[n])-tanh(d))^2/(1-tanh(t[n])*tanh(d))^2-b[1]*(1-tanh(t[n])*tanh(d))/(tanh(t[n])-tanh(d))-b[2]*(1-tanh(t[n])*tanh(d))^2/(tanh(t[n])-tanh(d))^2 end proc

(12)

NULL

NULL

NULL

NULL

fin1 := simplify(numer(eq_30))

Error, (in v[`+`(n, `-`(1))]) invalid input: tanh expects its 1st argument, x, to be of type algebraic, but received [diff(diff(xi[n](t),t),t), diff(xi[n](t),t)]

 

NULL

fin := simplify(subs(tanh(xi[n]) = Psi, fin1));

fin1

(13)

degree(fin,Psi)

0

(14)

FF:=convert(series(fin,Psi,7),polynom):

degree(%,Psi)

0

(15)

for i from 0 to degree(FF, Psi) do
    EQ[i] := simplify(coeff(FF, Psi, i));
end do

fin1

(16)

NULL

Eqs := {seq(EQ[i], i = 0 .. 6)}

Sol := dsolve(Eqs, {a[0], a[1], a[2], b[1], b[2], c[1]})

Error, (in dsolve) not a system with respect to the unknowns {a[0], a[1], a[2], b[1], b[2], c[1]}

 

Download ddd.mw

@mmcdara 

 Thank you for helping me.

@Christian Wolinski 

 ok

 Sorry, I didn't know you

 I run the attached Maple code, but no how long I wait, I can't run it. Is the code wrong?!
Maple file is word command file.

shro.mw

 

shrodin01.docx

@acer 

 If I ask the question again here are those who see?

Because I can't run with a series of changes I make in

@mmcdara 

 I really appreciate it.

 First of all, thank you for your time. If it is possible to add the file that I attached to the program, you would be very kind to me.

 I desperately need this app just to get some work done. I do not intend to disturb.

sh01.docx 

@mmcdara 

Hi,

  I'm so grateful, This was very kind of you.

You can look again at the two codes below to see what is wrong with the fsh code? (Of course if you can)

  fsh.mw

@mmcdara 

 Thanks for your hard work on this,

  • I want to convert equation 9 to equation 12 with a series of changes and then solve it, i.e. equation 12.
  • By substituting equation 4 and using equation 14 (that is, assigning the values of p_i, q_i to 1 or -1 or i and i -) and then inserting the unknown values (i.e. a_0, a_1, b_1) into equations 12 obtained, then by placing them, we get the value of the unknown function.

sh.docx

3 4 5 6 7 8 Page 5 of 8