This study examines the simulation of charge and discharge modes of lithium-ion batteries in a distributed photovoltaic system using MATLAB/ Simulink modeling. The objective is to analyze the integration of solar panels with battery-based energy storage systems to optimize performance and efficiency. The methodology involves mathematical modeling of photovoltaic cells based on p-n junctions, with key parameters such as temperature (15–30°C) and irradiance (1000 W/m²), along with the design of a Solar Charge Controller (SCC) to regulate energy flow. Simulations were conducted on four 150 W photovoltaic panels under varying environmental conditions, integrated with parallel-connected 12 V 250 Ah batteries. Results show a system efficiency of 87% at 25°C and 1000 W/m² irradiance, with panel output voltages aligning with mathematical equations (0.15 A error). Discharge mode analysis, accounting for system losses (inverter 5%, SCC 3%, wiring 2%), confirms the battery can supply a 5 Ω load for approximately 2.00 hours at 45% State of Charge (SOC), representing a 9.5% reduction from the ideal calculation. Simulations also compare SCC performance using DC and photovoltaic sources, demonstrating consistency in energy flow regulation. Validation results indicate the Simulink model’s accuracy in representing real-world characteristics, though MATLAB code simulations exhibit higher precision. The study highlights the importance of SCC control and SOC management to enhance battery lifespan and stability in renewable hybrid energy systems. Implications include potential applications.