2023 Higher Education Society Cup Mathematical Modeling Ideas - Review: Optimization Model for Light Intensity Calculation

0 Question Ideas

(Share on CSDN as soon as the competition questions come out)

https://blog.csdn.net/dc_sinor?type=blog

1 question request

It is now known that a classroom is 15 meters long and 12 meters wide. Four light sources (1, 2, 3, and 4 respectively) are
evenly illumination intensity of each light source is one Unit, as
Insert image description here
shown below:

  • (1) How to calculate the light intensity at any point in the classroom? (The illumination intensity of the light source on the target point is inversely proportional to the square of the distance from the light source to the target point, and directly proportional to the intensity of the light source).
  • (2) Draw a functional relationship surface diagram between the illumination intensity and the position (horizontal and vertical coordinates) of each point 1 meter away from the ground, and try to give an approximate functional relationship formula at the same time.
  • (3) Assuming that 1 meter above the ground is exactly the height of students’ desktops, how to design the positions of these four point light sources so that students’ average satisfaction with lighting can be maximized?
  • (4) If the point light source in the question is replaced by a linear light source, what will be the results of questions (2) and (3) above?

(For questions (1) and (2), it is assumed that the distances between the horizontal (vertical) wall and the light source, the light source and the light source, and the light source and the wall are equal.)

2 Assumption agreement

  • 1. Light does not pass through windows, doors, etc., nor does it consider the consumption of light in the air, that is, the intensity of light remains unchanged;
  • 2 The room is not affected by external light sources;
  • 3 The classroom height is 2.5 meters;
  • 4 Does not consider the reflection of light;
  • The 5-ray light source emits uniform light.

3 Symbol Conventions

Insert image description here

4 Build the model

Insert image description here
Insert image description here

5 Model solution

Insert image description here
Insert image description here

6 Implementation code

Matlab implementation code
It is recommended to use python to implement it. The pictures will look better. Moreover, the current domestic trend will gradually eliminate matlab. Some schools are no longer able to use matlab.

clear
clc
max=0;min=4;
for i=0:0.1:3
    for j=0.1:0.1:4
        s=0;
        x1=8+i,y1=5-j
        x2=8+i,y2=10+j
        x3=4-i,y3=10+j
        x4=4-i,y4=5-j     
        for x=0:0.1:12
            for y=0:0.1:15
                for z=0:0.1:2.5
                    if x1~=x & y1~=y & x2~=x & y2~=y & x3~=x & y3~=y & x4~=x & y4~=y 
                      s=s+1./((x1-x).^2+(y1-y).^2+(2.5-z).^2)+1./((x2-x).^2+(y2-y).^2+(2.5-z).^2)+1./((x3-x).^2+(y3-y).^2+(2.5-z).^2)+1./((x4-x).^2+(y4-y).^2+(2.5-z).^2);
                    end
                end
            end
        end
        k=4./s;l=0;z=1;
        for x=0:0.1:12
            for y=0:0.1:15
           l=l+k.*(1./((x1-x).^2+(y1-y).^2+(2.5-z).^2)+1/((x2-x).^2+(y2-y).^2+(2.5-z).^2)+1./((x3-x).^2+(y3-y).^2+(2.5-z).^2)+1./((x4-x).^2+(y4-y).^2+(2.5-z).^2));
            end
        end
        if l>max
            max=l;
            x11=x1;y11=y1;x12=x2;y12=y2;x13=x3;y13=y3;x14=x4;y14=y4;
        end
        p=l./(120.*150);Q=0;
        for x=0:0.1:12
            for y=0:0.1:15
             Q=Q+(k.*(1./((x1-x).^2+(y1-y).^2+(2.5-z).^2)+1./((x2-x).^2+(y2-y).^2+(2.5-z).^2)+1./((x3-x).^2+(y3-y).^2+(2.5-z).^2)+1./((x4-x).^2+(y4-y).^2+(2.5-z).^2))-p).^2.^(1./2);
            end
        end
        if min>Q
           min=Q;
           x21=x1;y21=y1;x22=x2;y22=y2;x23=x3;y23=y3;x24=x4;y24=y4;
       end
   end
end
disp(['最大值','x11=',num2str(x11),'  ','y11=',num2str(y11),'  ','x12=',num2str(x12),'  ','y12=',num2str(y12),'  ','x13=',num2str(x13),'  ','y13=',num2str(y13),'  ','x14=',num2str(x14),'  ','y14=',num2str(y14)])
disp(['最平均','x21=',num2str(x21),'  ','y21=',num2str(y21),'  ','x22=',num2str(x22),'  ','y22=',num2str(y22),'  ','x23=',num2str(x23),'  ','y23=',num2str(y23),'  ','x24=',num2str(x24),'  ','y24=',num2str(y24)])
附录二:
clear
clc
max=0;min=4;li=4;
for i=0:0.1:3
    for j=0.1:0.1:4
        s=0;
        x1=8+i,y1=5-j
        x2=8+i,y2=10+j
        x3=4-i,y3=10+j
        x4=4-i,y4=5-j     
        for x=0:0.1:12
            for y=0:0.1:15
                for z=0:0.1:2.5
                    if x1~=x & y1~=y & x2~=x & y2~=y & x3~=x & y3~=y & x4~=x & y4~=y 
                  s=s+1./((x1-x).^2+(y1-y).^2+(2.5-z).^2)+1./((x2-x).^2+(y2-y).^2+(2.5-z).^2)+1./((x3-x).^2+(y3-y).^2+(2.5-z).^2)+1./((x4-x).^2+(y4-y).^2+(2.5-z).^2);
                    end
                end
            end
        end
        k=4./s;l=0;z=1;e=0
        for x=0:0.1:12
            for y=0:0.1:15
                l=l+k.*(1./((x1-x).^2+(y1-y).^2+(2.5-z).^2)+1/((x2-x).^2+(y2-y).^2+(2.5-z).^2)+1./((x3-x).^2+(y3-y).^2+(2.5-z).^2)+1./((x4-x).^2+(y4-y).^2+(2.5-z).^2));
                r=k.*(1./((x1-x).^2+(y1-y).^2+(2.5-z).^2)+1/((x2-x).^2+(y2-y).^2+(2.5-z).^2)+1./((x3-x).^2+(y3-y).^2+(2.5-z).^2)+1./((x4-x).^2+(y4-y).^2+(2.5-z).^2));
                e=e+(r-6*10^(-32))^2;
            end
        end
       S=(l-0.1278)^2+e
       if S<li
           li=S
           x11=x1,y11=y1,  x12=x2,y12=y2,  x13=x3,y13=y3,  x14=x4,y14=y4,
       en4
   en4
en4
disp(['x11=',num2str(x11),'  ','y11=',num2str(y11),'  ','x12=',num2str(x12),'  ','y12=',num2str(y12),'  ','x13=',num2str(x13),'  ','y13=',num2str(y13),'  ','x14=',num2str(x14),'  ','y14=',num2str(y14)])
li

Modeling information

Data Sharing: The strongest modeling data
Insert image description here
Insert image description here

Guess you like

Origin blog.csdn.net/math_assistant/article/details/132480110