Question

Loop- Code Matlab -Solar Array Sizing A customer would like to install a solar panel array...

Loop- Code Matlab -Solar Array Sizing

A customer would like to install a solar panel array for his small business. The daily peak power is estimated to be 50 kW and his budget is $10,000.

Task 1: If the price for a single solar panel is $50, given the volume discount table below, how many solar panels can he afford? (Hint: see bottom of problem)

Number of panels purchased

Discount per panel

1 – 5

0%

6-29

10%

30 – 99

15%

100+

20%

Task 2: Now, assuming each solar panel can supply 40 Watts, how much does it cost for his business to become 100% off-the-grid? Don’t forget to include the volume discount! (Hint: see bottom of problem)

Off-the-grid means to be completely powered from renewable energy. In this case is solar energy. Hint: Use a loop to solve this problem. Use the loop index to represent the number of solar panels, and change the discount percentage as necessary for each loop iteration.

Homework Answers

Answer #1

MATLAB code:

peakPower = 50000; % 50 kW
budget = 10000;

%% Task 1
pricePerSolarPanel = 50;
totalPrice = 0;
totalDiscountedPrice = 0;
solarPanels = 0;
% Count number of solar panels
while totalDiscountedPrice <= budget
    solarPanels = solarPanels + 1;
    totalPrice = totalPrice + pricePerSolarPanel;
    % Calculate discount
    if solarPanels >= 100
        discountRate = 20;
    elseif solarPanels >= 30
        discountRate = 15;
    elseif solarPanels >= 6
        discountRate = 10;
    else
        discountRate = 0;
    end
    % Calculate discounted total price
    totalDiscountedPrice = totalPrice - totalPrice*discountRate/100;
end
solarPanels = solarPanels - 1;
fprintf('Number of solar panels he can afford is %d\n', solarPanels);

%% Task 2
pricePerSolarPanel = 50;
powerPerSolarPanel = 40;
totalPrice = 0;
totalPower = 0;
totalDiscountedPrice = 0;
solarPanels = 0;
% Count number of solar panels
while totalPower < peakPower
    solarPanels = solarPanels + 1;
    totalPrice = totalPrice + pricePerSolarPanel;
    totalPower = totalPower + powerPerSolarPanel;
    % Calculate discount
    if solarPanels >= 100
        discountRate = 20;
    elseif solarPanels >= 30
        discountRate = 15;
    elseif solarPanels >= 6
        discountRate = 10;
    else
        discountRate = 0;
    end
    % Calculate discounted total price
    totalDiscountedPrice = totalPrice - totalPrice*discountRate/100;
end
fprintf('Cost for going 100%% off-the-grid is $%.2f\n', totalDiscountedPrice);

Output:

FOR ANY HELP JUST DROP A COMMENT

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
read PV Versus Diesel: A Cost-Benefit Analysis in the Nexus of Food and Fuel below and...
read PV Versus Diesel: A Cost-Benefit Analysis in the Nexus of Food and Fuel below and then answer the following questions: - What is the problem? - What are the alternatives? - What are the base case assumptions? - What measures do you suggest to compare the alternatives? PV Versus Diesel: A Cost-Benefit Analysis in the Nexus of food and fuel. U.S. Army provides field rations to forward troops. After Desert Storm and Desert Shield, where some troops ate packaged...
Exploring Innovation in Action Power to the People – Lifeline Energy Trevor Baylis was quite a...
Exploring Innovation in Action Power to the People – Lifeline Energy Trevor Baylis was quite a swimmer in his youth, representing Britain at the age of 15. So it wasn’t entirely surprising that he ended up working for a swimming pool firm in Surrey before setting up his own company. He continued his swimming passion – working as a part-time TV stuntman doing underwater feats – but also followed an interest in inventing things. One of the projects he began...
What role could the governance of ethics have played if it had been in existence in...
What role could the governance of ethics have played if it had been in existence in the organization? Assess the leadership of Enron from an ethical perspective. THE FALL OF ENRON: A STAKEHOLDER FAILURE Once upon a time, there was a gleaming headquarters office tower in Houston, with a giant tilted "£"' in front, slowly revolving in the Texas sun. The Enron Corporation, which once ranked among the top Fortune 500 companies, collapsed in 2001 under a mountain of debt...
Discuss ethical issues that can be identified in this case and the mode of managing ethics...
Discuss ethical issues that can be identified in this case and the mode of managing ethics Enron finds itself in this case. How would you describe the ethical culture and levels of trust at Enron? Provide reasons for your assessment. THE FALL OF ENRON: A STAKEHOLDER FAILURE Once upon a time, there was a gleaming headquarters office tower in Houston, with a giant tilted "£"' in front, slowly revolving in the Texas sun. The Enron Corporation, which once ranked among...
What tools could AA leaders have used to increase their awareness of internal and external issues?...
What tools could AA leaders have used to increase their awareness of internal and external issues? ???ALASKA AIRLINES: NAVIGATING CHANGE In the autumn of 2007, Alaska Airlines executives adjourned at the end of a long and stressful day in the midst of a multi-day strategic planning session. Most headed outside to relax, unwind and enjoy a bonfire on the shore of Semiahmoo Spit, outside the meeting venue in Blaine, a seaport town in northwest Washington state. Meanwhile, several members of...