This piece of code sets up and solve Finite Element Problem Click to go back
How the code goes...Multiply free parameter matrices for parameters and add to obtain global matrix
// // MULTIPLY EACH BLOCK MATRIX FOR THE CORRESPONDING PARAMETER // m1=k0*ma1; m2=kleft*ma2; m3=kright*ma3; m4=aa*ma4; m5=Bi*ma5; // // ADD ALL MATRICES TO GET TOTAL ONE // Aglobal=m1; Aglobal=Aglobal+m2; Aglobal=Aglobal+m3; Aglobal=Aglobal+m4; Aglobal=Aglobal+m5; // // ATTACH A SOLVER TO THE MATRIX (THIS DECOMPOSES THE MATRIX) // set(Aglobal, solver=sparsesolver); // // SOLVE GLOBAL PROBLEM // u[] = Aglobal^-1*RHSunico[];