MATLAB: How to write and solve this pde system
diffusiondoit4mehomeworkpde
Related Solutions
The solution is definitely not unique.
Let the two result matrices be [rab11,0;0,rab22] and [rcd11;0;0;rcd22]
Set rcd22 to any non-zero non-infinite value. Then, except for possible singularities,
rab11 = rcd22*(((c12*c21*d12*d21-c11*c22*d11*d22)*b11+b21*d12*d11*(c11*c22-c12*c21))*a12+a11*b11*c12*c22*(d11*d22-d12*d21))*(a11*a22-a12*a21)*(b11*b22-b12*b21)/((((d12*c21*b22*a22-b12*a21*d22*c22)*b11+d12*b12*b21*(-c21*a22+a21*c22))*a12+a11*a22*b11*c22*(-d12*b22+b12*d22))*(c11*c22-c12*c21)*(d11*d22-d12*d21))
rab22 = -rcd22*(((c12*c21*d12*d21-c11*c22*d11*d22)*b12+b22*d12*d11*(c11*c22-c12*c21))*a22+a21*b12*c12*c22*(d11*d22-d12*d21))*(a11*a22-a12*a21)*(b11*b22-b12*b21)/((((b11*d22*c22*a11-d12*c21*a12*b21)*b12-d12*b11*b22*(c22*a11-a12*c21))*a22-a12*a21*c22*b12*(b11*d22-b21*d12))*(c11*c22-c12*c21)*(d11*d22-d12*d21))
rcd11 = -rcd22*((d11*c11*(b11*b22-b12*b21)*a22-a21*c12*b12*(b11*d21-b21*d11))*a12+a11*a22*b11*c12*(b12*d21-d11*b22))/((c21*d12*(b11*b22-b12*b21)*a22-a21*c22*b12*(b11*d22-b21*d12))*a12+a11*a22*b11*c22*(-d12*b22+b12*d22))
You can see in this that rcd22 acts as an arbitrary scale factor for the other coefficients.
The X matrix then becomes
X(1,1) = (b22*a22*rcd22*(((c12*c21*d12*d21-c11*c22*d11*d22)*b11+b21*d12*d11*(c11*c22-c12*c21))*a12+a11*b11*c12*c22*(d11*d22-d12*d21))*(a11*a22-a12*a21)*(b11*b22-b12*b21)/((((d12*c21*b22*a22-b12*a21*d22*c22)*b11+d12*b12*b21*(-c21*a22+a21*c22))*a12+a11*a22*b11*c22*(-d12*b22+b12*d22))*(c11*c22-c12*c21)*(d11*d22-d12*d21))-b22*a12*rab21-b21*a22*rab12-b21*a12*rcd22*(((c12*c21*d12*d21-c11*c22*d11*d22)*b12+b22*d12*d11*(c11*c22-c12*c21))*a22+a21*b12*c12*c22*(d11*d22-d12*d21))*(a11*a22-a12*a21)*(b11*b22-b12*b21)/((((b11*d22*c22*a11-d12*c21*a12*b21)*b12-d12*b11*b22*(c22*a11-a12*c21))*a22-a12*a21*c22*b12*(b11*d22-b21*d12))*(c11*c22-c12*c21)*(d11*d22-d12*d21)))/((a11*a22-a12*a21)*(b11*b22-b12*b21))
X(1,2) = -(b12*a22*rcd22*(((c12*c21*d12*d21-c11*c22*d11*d22)*b11+b21*d12*d11*(c11*c22-c12*c21))*a12+a11*b11*c12*c22*(d11*d22-d12*d21))*(a11*a22-a12*a21)*(b11*b22-b12*b21)/((((d12*c21*b22*a22-b12*a21*d22*c22)*b11+d12*b12*b21*(-c21*a22+a21*c22))*a12+a11*a22*b11*c22*(-d12*b22+b12*d22))*(c11*c22-c12*c21)*(d11*d22-d12*d21))-b12*a12*rab21-b11*a22*rab12-b11*a12*rcd22*(((c12*c21*d12*d21-c11*c22*d11*d22)*b12+b22*d12*d11*(c11*c22-c12*c21))*a22+a21*b12*c12*c22*(d11*d22-d12*d21))*(a11*a22-a12*a21)*(b11*b22-b12*b21)/((((b11*d22*c22*a11-d12*c21*a12*b21)*b12-d12*b11*b22*(c22*a11-a12*c21))*a22-a12*a21*c22*b12*(b11*d22-b21*d12))*(c11*c22-c12*c21)*(d11*d22-d12*d21)))/((a11*a22-a12*a21)*(b11*b22-b12*b21))
X(2,1) = -(b22*a21*rcd22*(((c12*c21*d12*d21-c11*c22*d11*d22)*b11+b21*d12*d11*(c11*c22-c12*c21))*a12+a11*b11*c12*c22*(d11*d22-d12*d21))*(a11*a22-a12*a21)*(b11*b22-b12*b21)/((((d12*c21*b22*a22-b12*a21*d22*c22)*b11+d12*b12*b21*(-c21*a22+a21*c22))*a12+a11*a22*b11*c22*(-d12*b22+b12*d22))*(c11*c22-c12*c21)*(d11*d22-d12*d21))-b22*a11*rab21-b21*a21*rab12-b21*a11*rcd22*(((c12*c21*d12*d21-c11*c22*d11*d22)*b12+b22*d12*d11*(c11*c22-c12*c21))*a22+a21*b12*c12*c22*(d11*d22-d12*d21))*(a11*a22-a12*a21)*(b11*b22-b12*b21)/((((b11*d22*c22*a11-d12*c21*a12*b21)*b12-d12*b11*b22*(c22*a11-a12*c21))*a22-a12*a21*c22*b12*(b11*d22-b21*d12))*(c11*c22-c12*c21)*(d11*d22-d12*d21)))/((a11*a22-a12*a21)*(b11*b22-b12*b21))
X(2,2) = -(b22*a21*rcd22*(((c12*c21*d12*d21-c11*c22*d11*d22)*b11+b21*d12*d11*(c11*c22-c12*c21))*a12+a11*b11*c12*c22*(d11*d22-d12*d21))*(a11*a22-a12*a21)*(b11*b22-b12*b21)/((((d12*c21*b22*a22-b12*a21*d22*c22)*b11+d12*b12*b21*(-c21*a22+a21*c22))*a12+a11*a22*b11*c22*(-d12*b22+b12*d22))*(c11*c22-c12*c21)*(d11*d22-d12*d21))-b22*a11*rab21-b21*a21*rab12-b21*a11*rcd22*(((c12*c21*d12*d21-c11*c22*d11*d22)*b12+b22*d12*d11*(c11*c22-c12*c21))*a22+a21*b12*c12*c22*(d11*d22-d12*d21))*(a11*a22-a12*a21)*(b11*b22-b12*b21)/((((b11*d22*c22*a11-d12*c21*a12*b21)*b12-d12*b11*b22*(c22*a11-a12*c21))*a22-a12*a21*c22*b12*(b11*d22-b21*d12))*(c11*c22-c12*c21)*(d11*d22-d12*d21)))/((a11*a22-a12*a21)*(b11*b22-b12*b21))
This was calculated using straight-forward linear algebra by multiplying appropriate inverses on both sides to get two isolated X equations, and then solve()'ing for the corresponding components to be the same.
syms d1 d2 d3 d4 d5 d6 h11 h12 h13 h14 h21 h22 h23 h24 h41 h42... h45 h46 h51 h52 h55 h56 h61 h62 h65 h66eq1 = h11*d1+h12*d2+h13*d3+h14*d4 == 0;eq2 = h21*d1+h22*d2+h23*d3+h23*d4 == 0;eq3 = d1+d2+d3+d4-d5-d6 == 0;eq4 = h41*d1+h42*d2-h41*d3-h42*d4-h45*d5-h46*d6 == 0;eq5 = h51*d1+h52*d2+h51*d3+h52*d4-h55*d5-h56*d6 == 0;eq6 = h61*d1+h62*d2-h61*d3-h62*d4-h65*d5-h66*d6 == 0;% Solve for d1...d6
sol_d1 = isolate(eq1,d1)sol_d2 = isolate(eq2,d2)sol_d3 = isolate(eq3,d3)sol_d4 = isolate(eq4,d4)sol_d5 = isolate(eq5,d5)sol_d6 = isolate(eq6,d6)
gives:
sol_d1 = d1 == -(d2*h12 + d3*h13 + d4*h14)/h11 sol_d2 = d2 == -(d1*h21 + d3*h23 + d4*h23)/h22 sol_d3 = d3 == d5 - d2 - d4 - d1 + d6 sol_d4 = d4 == -(d3*h41 - d2*h42 - d1*h41 + d5*h45 + d6*h46)/h42 sol_d5 = d5 == (d1*h51 + d2*h52 + d3*h51 + d4*h52 - d6*h56)/h55 sol_d6 = d6 == -(d3*h61 - d2*h62 - d1*h61 + d4*h62 + d5*h65)/h66
This is what you wanted to get?
Best Answer