## Appendix A MATLAB Program for the Proposed Method  
This appendix presents the MATLAB program developed to implement the proposed numerical scheme. ```
clear;%Clearallvariablesfromtheworkspace %Setgridparameters Nx=500;Ny=Nx;%Numberofgridpointsinxandydirections hx=0.03;hy=hx;%Gridspacinginxandydirections Lx=hx*Nx;Ly=hy*Ny;%Physicaldomainsizeinxandy %Generatespatialgrids(cell-centered) x=linspace(0.5*hx,Lx-0.5*hx,Nx); y=linspace(0.5*hy,Ly-0.5*hy,Ny)'; %Definemodelparameters epsilon=hx;%Interfacialwidthparameter Cahn=epsilon^2;%CoefficientforCahn-Hilliarddiffusion alpha=100;%Sourcetermscalingparameter %Generate2 Dspatialmesh [xx,yy]=meshgrid(x(1:end),y(1:end)); %InitializeaveragephasefieldaveMandperturbedfieldv fori=1:Nx
``````
forj=1:Ny %DefineaveragephasefieldaveMwithcircularinterface ifLx/3-sqrt((Lx/2-x(i))^2+(Ly/2-y(j))^2)<0 aveM(i,j))=-0.3;%Outsidethecircle else aveM(i,j)=0;%Insidethecircle end %AddrandomperturbationtoaveM v(i,j)=0.5*(0.5-rand(1))+aveM(i,j); end end %DefineFourierwavenumbersforspectralderivatives kx=2*pi/Lx*fftshift(-Nx/2:Nx/2-1);%Fouriermodesinx ky=2*pi/Ly*fftshift(-Ny/2:Ny/2-1)';%Fouriermodesiny %ComputsquaredwavenumbersforLaplacianandbi-Laplacianoperators k2x=-kx.^2; k2y=-ky.^2; [kxact,kyyt]=meshgrid(k2x,k2y); kxx=kxact'; kyy=kyyt'; %Settimeintegrationparameters dt=0.1; T=50; Nt=round(T/dt);%Totalnumberoftimesteps ns=Nt/10;%Intervalforvisualization %Timeintegrationloop forn=1:Nt %ComputeFFToftheright-handsideincludingsourceterm v_hat=fft2(v+dt*alpha*aveM); vf=fft2(v.^3-3*v);%NonlinearterminFourierspace %Computeddenominatorinsemi-implicitupdateformula deno=(1.0+dt*alpha-dt*2*(kxx+kyy)+dt*Cahn*(kx+kyy)).^2); %Semi-implicitupdateinFourierspace vnew=(v_hat+dt*(kx+kyy). *vf)./deno; %Transformbacktophysicalspace v=real(ifft2(vnew)); %Visualizationeverynstimsteps if(mod(n,ns)==0) figure(1); vv=v; vv(1,1)=-1;vv(end,end)=1;%Normalizextremaforvisualization surf(xx,yy,-vv');%Plotthenegativeofv shadinginterp;colormapgray; %Smoothshadingandgrayscalecolormap view(0,90);axisimage;%Top-downview,equalaxisscaling drawnow;%Updatethefigurewindow pause(0.01);%Briefpauseforrendering end
```

Listing 11: _Cont._

## References

* [PERSON] et al. (2024) [PERSON]; [PERSON]; [PERSON] Exploratory Study of a Green Function Based Solver for Nonlinear Partial Differential Equations. _Algorithms_**2024**, _17_, 564. [CrossRef]
* [PERSON] et al. (2021) [PERSON]; [PERSON] [PERSON]; [PERSON] [PERSON]; [PERSON] A Quantum Approach for Exploring the Numerical Results of the Heat Equation. _Algorithms_**2024**, _17_, 327. [CrossRef][PERSON]; [PERSON] [PERSON] Lie Symmetry Analysis, Closed-Form Solutions and Dynamics for the Kinetics of Phase Separation in Iron (Fe-Cr-X (X = Mo, Cu)) Based on Ternary Alloys. _Nonlinear Dyn._**2024**, _112_, 20255-20267. [CrossRef]
* (4) [PERSON]; [PERSON]; [PERSON]; [PERSON] Numerical Simulation of a Binary Alloy of 2D Cahn-Hilliard Model for Phase Separation. _Comput. Appl. Math._**2022**, _41_, 389. [CrossRef]
* (5) [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] 3D Pattern Formation from Coupled Cahn-Hilliard and Swift-Hohenberg Equations: Morphological Phases Transitions of Polymers, Bock and Diblock Copolymers. _Comput. Mater. Sci._**2022**, _210_, 111431. [CrossRef]
* (6) [PERSON]; [PERSON]; [PERSON] Viscoelastic Cahn-Hilliard Models for Tumor Growth. _Math. Models Methods Appl. Sci._**2022**, _32_, 2673-2758. [CrossRef]
* (7) [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] Continuum-Scale Modelling of Polymer Blends Using the Cahn-Hilliard Equation: Transport and Thermodynamics. _Soft Matter_**2021**, _17_, 5645-5665. [CrossRef]
* (8) [PERSON]; [PERSON]; [PERSON] Multi-Objective Optimization Assisting Three-Dimensional Quantitative Cahn-Hilliard Simulations of Microstructure Evolution in Fe-Cr Alloys During Spinodal Decomposition. _Comput. Mater. Sci._**2024**, _244_, 113260. [CrossRef]
* (9) [PERSON]; [PERSON]; [PERSON]; [PERSON] Spinodal Decomposition-Inspired Metamaterial: Tailored Homogenized Elastic Properties via the Dimensionless Cahn-Hilliard Equation. _Eur. J. Mech.