Skip to main content
added 595 characters in body
Source Link
qahtah
  • 1.4k
  • 8
  • 14

I have a long expression, only representative terms are given below. As a first step, I want to equate the coefficientcollect terms in terms of u[x,t] orand its derivatives or their multiplications. The second step is to make those coefficients equal to zero as separate equations. A representative expression is given below For example, if I have the actual expression is much longer:

xpr=a[x, t, u]*Derivative[1, 0][u][x, t] + 2*Derivative[0, 1][u][x, t]*
Derivative[1, 0][u][x, t]*Derivative[0, 0, 1][b][x, t, u] + 
2*u[x, t]*Derivative[1, 0][u][x, t]^2*Derivative[0, 0, 1][b][x, t, u] + 
 2*Derivative[1, 0][u][x, t]*Derivative[1, 1][u][x, t]*Derivative[0, 0, 1][c][x, t, u]+2*Derivative[0, 1][u][x, t]*
Derivative[1, 0][u][x, t]*Derivative[0, 0, 1][d][x, t, u];

So for example the coefficient of Derivative[1, 0][u][x, t] is only a[x,t,u]=0.

And the coefficient ofThe first step should result in:

stp1=a[x, t, u]*Derivative[1, 0][u][x, t] + 2*u[x, t]*Derivative[1, 0][u][x, t]^2*
Derivative[0, 0, 1][b][x, t, u] + 2*Derivative[1, 0][u][x, t]*
 Derivative[1, 1][u][x, t]*Derivative[0, 0, 1][c][x, t, u] + 
Derivative[0, 1][u][x, t]*Derivative[1, 0][u][x, t]t]*
 (2*Derivative[0, 0, 1][b][x, t, u] + 2*Derivative[0, 0, 1][d][x, t, u])

isThe last step will give rise to:

 eqns={a[x, t, u] == 0, 2*Derivative[0, 0, 1][b][x, t, u]=0u] == 0, 
  2*Derivative[0, 0, 1][c][x, t, u] == 0, 
  2*Derivative[0, 0, 1][b][x, t, u] + 2*Derivative[0, 0, 1][d][x, t, u] == 0},

and so on.

Your help is much appreciated.

I want to equate the coefficient of u[x,t] or its derivatives or their multiplications to zero. A representative expression is given below, the actual expression is much longer:

xpr=a[x, t, u]*Derivative[1, 0][u][x, t] + 2*Derivative[0, 1][u][x, t]*
Derivative[1, 0][u][x, t]*Derivative[0, 0, 1][b][x, t, u] + 
2*u[x, t]*Derivative[1, 0][u][x, t]^2*Derivative[0, 0, 1][b][x, t, u] + 
 2*Derivative[1, 0][u][x, t]*Derivative[1, 1][u][x, t]*Derivative[0, 0, 1][c][x, t, u];

So for example the coefficient of Derivative[1, 0][u][x, t] is only a[x,t,u]=0.

And the coefficient of

 Derivative[0, 1][u][x, t]*Derivative[1, 0][u][x, t]

is

2*Derivative[0, 0, 1][b][x, t, u]=0

and so on.

Your help is much appreciated.

I have a long expression, only representative terms are given below. As a first step, I want to collect terms in terms of u[x,t] and its derivatives. The second step is to make those coefficients equal to zero as separate equations. For example, if I have the expression:

xpr=a[x, t, u]*Derivative[1, 0][u][x, t] + 2*Derivative[0, 1][u][x, t]*
Derivative[1, 0][u][x, t]*Derivative[0, 0, 1][b][x, t, u] + 
2*u[x, t]*Derivative[1, 0][u][x, t]^2*Derivative[0, 0, 1][b][x, t, u] + 
 2*Derivative[1, 0][u][x, t]*Derivative[1, 1][u][x, t]*Derivative[0, 0, 1][c][x, t, u]+2*Derivative[0, 1][u][x, t]*
Derivative[1, 0][u][x, t]*Derivative[0, 0, 1][d][x, t, u];

The first step should result in:

stp1=a[x, t, u]*Derivative[1, 0][u][x, t] + 2*u[x, t]*Derivative[1, 0][u][x, t]^2*
Derivative[0, 0, 1][b][x, t, u] + 2*Derivative[1, 0][u][x, t]*
 Derivative[1, 1][u][x, t]*Derivative[0, 0, 1][c][x, t, u] + 
Derivative[0, 1][u][x, t]*Derivative[1, 0][u][x, t]*
 (2*Derivative[0, 0, 1][b][x, t, u] + 2*Derivative[0, 0, 1][d][x, t, u])

The last step will give rise to:

 eqns={a[x, t, u] == 0, 2*Derivative[0, 0, 1][b][x, t, u] == 0, 
  2*Derivative[0, 0, 1][c][x, t, u] == 0, 
  2*Derivative[0, 0, 1][b][x, t, u] + 2*Derivative[0, 0, 1][d][x, t, u] == 0},

Your help is much appreciated.

Source Link
qahtah
  • 1.4k
  • 8
  • 14

Coefficient of expression that involves derivatives

I want to equate the coefficient of u[x,t] or its derivatives or their multiplications to zero. A representative expression is given below, the actual expression is much longer:

xpr=a[x, t, u]*Derivative[1, 0][u][x, t] + 2*Derivative[0, 1][u][x, t]*
Derivative[1, 0][u][x, t]*Derivative[0, 0, 1][b][x, t, u] + 
2*u[x, t]*Derivative[1, 0][u][x, t]^2*Derivative[0, 0, 1][b][x, t, u] + 
 2*Derivative[1, 0][u][x, t]*Derivative[1, 1][u][x, t]*Derivative[0, 0, 1][c][x, t, u];

So for example the coefficient of Derivative[1, 0][u][x, t] is only a[x,t,u]=0.

And the coefficient of

 Derivative[0, 1][u][x, t]*Derivative[1, 0][u][x, t]

is

2*Derivative[0, 0, 1][b][x, t, u]=0

and so on.

Your help is much appreciated.