Hi,
I understand you are using MATLAB to plot the V-I and P-V characteristics of a solar PV module at various temperatures.
This can be achieved with the help of MATLAB’s ‘set_param’ and ‘sim’ functions.
Refer the below steps to plot curves for changing temperatures:
- Define a range of temperatures in an array. Iterate through these stored values using a 'for' loop and change the model parameters with MATLAB's 'set_param' function in each loop.
- Use 'sim' function to execute the simulation in each iteration, followed by the ‘simOut.get' function to get the results.
- To ensure corresponding curves are plotted on the same plot, use ‘hold on’ inside the ‘for’ loop. When working with numerous figures at the same time, you can also utilize MATLAB's 'figure' function to switch between plots/figures.
Refer to the sample code below:
temperatures = [298, 303, 318, 323];
numTemps = length(temperatures);
temperature = temperatures(i);
set_param('model_name/Temp', 'Value', 'temperature')
plot(V, I, 'DisplayName', sprintf('Temp = %dK', temperature));
plot(V, V.*I, 'DisplayName', sprintf('Temp = %dK', temperature));
Similarly, you may create arrays for other changing parameters and loop over them in the same manner you would with the temperature parameter.
Refer to the below documentations for better understanding:
Hope this helps.