I am studying a solar panel using simulink tools and I got the Voltage and Power of the panel in the form of a plot and now I want to find the max value of power during the time of 0.01s which is the simulation time I gave?

I have two quantities Voltage and Power of a PV panel in the form of 2 different plots with respect to time and I want to find out the max power from the panel during the simulation time of 0.01s and at the same point of max Power I want to find the value of voltage. Could some one please help me out.
THANKS

 Accepted Answer

If you have the power data for example P=[1.0, 1.3, 1.5, 1.4, 1.0], just use
[Pmax,Imax]=max(P)
Pmax =
1.5000
Imax =
3
You'll get the maximum power value. The index (Imax=3) will tell you at what time it occurred.

3 Comments

Hi Fang thanks for the reply,
But I have the power as a continuous plot, I read the Voltage and current of a PV panel for 0.01s and multiplied them and got the power. So I don't have the power values as you gave. I have that as a graph with respect to time. Now I want to find the maximum value of the power and at the time of maximum value of power I want to find the value of voltage. So I gave the P and V using FROM BLOCK as inputs to a matlab fcn block and now planning to give some code to get the output I require. Could you please tell me how to read the max value of power from the plot of P and get the value of V at that time.
The simulation of a Simulink model runs as the time goes so it's hard to tell what maximum value you'll get if you want to run this algorithm all the time as the simulation runs. Imaging at the first step, you only get one data and at the second step you only get two data. The best way is to record your voltage and current data using a "To Workspace" block and then do post-processing once the simulation is done. For examplel;
V=[ 12 13 14 15 13 12];
I=[ 11 14 12 13 14 15];
P=V.*I;
[Pmax,Index]=max(P)
Thanks a lot for the help fang, that gave me what I want and I have an other doubt, I need a switch in simulink such that it should be closed from 0 to 0.0001seconds and later must be operated by a PWM signal I give from 0.0001s to 0.1s. This 2 parts consists 1 cycle. I need this cycle to repeat 10 times, means for 1s.cycle(switch close from 0 to 0.0001s and opearted by PWM signal from 0.0001 to 0.1s).
Could you please help me with this. PLEASE.

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!