Message Boards Message Boards

0
|
331 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How do I separate or categorize terms of a function of (x,t,u)

Posted 2 months ago

Below is an attempt to do a symbolic computation of Mathematica syntax code to enter inputs and compute using 'if conditions' if one enters a function X[i][x,t,u], {i,1,4} has a term of [x,t], [t] or [x,t,u], that term should part of

Xi[1][ x_, t_] = Dot[ terms of [x,t],  constants]  constants =1:4

ie the terms will be the coefficients of c terms.

Xi[2][ t_] = Dot[ terms of [t],  constants] Phi[x_, t_, u_] = Dot[ terms of [x,t,u],  constants]

and

{T[1]=u, T[2]=1, T[3]=(E^(-(1/2) t Sqrt[k^2 + 2 \[Sigma]^2]) u)/(4 Sqrt[x]) +   E^(-(1/2) t Sqrt[k^2 + 2 \[Sigma]^2]) Sqrt[x] + (  E^(-(1/2) t Sqrt[k^2 + 2 \[Sigma]^2]) k u Sqrt[x])/\[Sigma]^2 - (  E^(-(1/2) t Sqrt[k^2 + 2 \[Sigma]^2]) k u \[Theta])/(  Sqrt[x] \[Sigma]^2) - ( E^(-(1/2) t Sqrt[k^2 + 2 \[Sigma]^2]) u Sqrt[x] Sqrt[  k^2 + 2 \[Sigma]^2])/\[Sigma]^2 T[4]=(E^(1/2 t Sqrt[k^2 + 2 \[Sigma]^2]) u)/(4 Sqrt[x]) +   E^(1/2 t Sqrt[k^2 + 2 \[Sigma]^2]) Sqrt[x] + (  E^(1/2 t Sqrt[k^2 + 2 \[Sigma]^2]) k u Sqrt[x])/\[Sigma]^2 - (  E^(1/2 t Sqrt[k^2 + 2 \[Sigma]^2]) k u \[Theta])/(  Sqrt[x] \[Sigma]^2) + (  E^(1/2 t Sqrt[k^2 + 2 \[Sigma]^2]) u Sqrt[x] Sqrt[   k^2 + 2 \[Sigma]^2])/\[Sigma]^2

How do I fix the code below to achieve that.

vars = Input["Please input the symmetry generators"]; T[i_, x_, t_, u_] = Sum[If[i == j && (x == # || t == #), Coefficient[T[j][x, t, u], T[##]], 0] &, {j, 1, 4}, {#, {x, t}}];

Xi[1][x_, t_] = Dot[If[i == j && x == # && t == #2, Coefficient[T[j][x, t], T[##]] &, {j, 1, 6}, constants]]

Xi[2][ t_] = Dot[If[i == j && t == #, Coefficient[T[j][t], T[##]] &, {j, 1, 6}, constants]]

Phi[x_, t_, u_] = Dot[If[i == j && t == #, Coefficient[T[j][x, t, u], T[##]]] &, {j, 1, 6}, constants]
POSTED BY: Nomsa Ledwaba
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract