计算不同消费行为的碳足迹排放量(Matlab代码实现)

👨‍🎓个人主页:研学社的博客    

💥💥💞💞欢迎来到本博客❤️❤️💥💥

🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。

⛳️座右铭:行百里者,半于九十。

📋📋📋本文目录如下:🎁🎁🎁

目录

💥1 概述

📚2 运行结果

🎉3 参考文献

🌈4 Matlab代码实现


💥1 概述

​碳足迹,英文为Carbon Footprint,是指企业机构、活动、产品或个人通过交通运输、食品生产和消费以及各类生产过程等引起的温室气体排放的集合。它描述了一个人的能源意识和行为对自然界产生的影响,号召人们从自我做起。目前,已有部分企业开始践行减少碳足迹的环保理念。

碳足迹排放量是个相当复杂的计算,根据不同的个人会有不同的变数,碳足迹的计算包括一切用于电力、建设我们的家园、运输(包括旅行时乘坐汽车、飞机、铁路和其它公共交通工具)的能源,以及我们所使用的所有消耗品。以上很多个人的因素,可分别计算(例如个人碳足迹,从你的家、旅行、食品等)。一旦你明白你所产生的碳足迹,你的碳足迹从哪来(也许这更重要),那你就可以开始减少它;很多方法方式产生碳足迹,但总有一些方法可以减少碳足迹。

此 MATLAB 函数用于计算不同消费行为的碳足迹排放量。它还提供了如何减少二氧化碳排放的方法。​

📚2 运行结果

主函数部分代码:

clear all, clear, clc
format short 
%greetings and explaination
menu('WELCOME TO CARBONFOOTPRINT CALCULATOR','next');
menu('Here You Can Calculate Your Carbon Emission Of Different Products By Simple Steps', 'next');
i=1;
strt=1;
% defining veriable that i will use in display part (added after ive done input part)
prod_1_type=0;
prod_1=0;
prod_2=0;
prod_3=0;
prod_4=0;
food_co2=0;
food_PR=0;
food_a=0;
baverage_co2=0;
baverage_PR=0;
baverage_a=0;
cloth_co2=0;
cloth_PR=0;
cloth_a=0;
other_co2=0;
other_PR=0;
other_a=0;
fr_type=0;
fr_co2=0;
pack_co2=0;
trans_co2=0;
trans_a=0;
fr_a=0;
%DESIRED CALCULATED OUTPUTS
PRODUCT=[0];
PRODUCT=string(PRODUCT);
AMOUNT=0;
CO2_AMOUNT=0;
PRICE=0;
MODE=0;
MODE=string(MODE);
DISTANCE=0;
CO2_PACK=0;
CO2_DISTANCE=0;
CO2=0;
PACK_TYPE=[0];
PACK_TYPE=string(PACK_TYPE);
TRANS_TYPE=[0];
TRANS_TYPE=string(TRANS_TYPE);
%%%%%%%%%%%%% input and calculations part $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
while strt==1
    b=1;
    
    %the 4 categories selction and calculation
    x=(['product number ', num2str(i)]);
    menu(x, 'next');
    %%%%%%%%%%%%%%%%% firstly, calculations for amounts %%%%%%%%%%%%%%%%
    while b<=1
        c=1;
        CAT=menu('firstly, choose the product category','food', 'beverages', 'clothes'  ,'other materials');
        switch CAT
            %food calculation
            case 1
                
                %types of food
                
                while c<=1
                    prod_1_type(i)=menu('please select your food category :','meat and seafood','Vegetables','Oil','Processed food', 'back');
                    if  prod_1_type(i)==5
                        c=2;
                        continue ;
                    end
                    switch prod_1_type(i)
                        %food type 1
                        case 1
                            
                            prod_1(i)=menu('please select your product :','beef','fish','lamb & mutton','pork','chicken','prawns','eggs', 'back');
                            
                            if  prod_1(i)==8
                                continue;
                            end
                            %food type 2
                        case 2
                            
                            prod_1(i)=menu('please select your product :','cabbage','onions','peas','potatoes','carrot','tomatoes','cassava','mushroom','corn','broccoli','cucumber','back');
                            if prod_1(i)==12
                                continue;
                            end
                            %food type 3
                        case 3
                            
                            prod_1(i)=menu('please select your product :','olive oil','palm oil','rapessed oil','sunflower oil','back');
                            if prod_1(i)==5
                                continue;
                            end
                            %food type 4
                        case 4
                            
                            prod_1(i)=menu('please select your product :','pizza','baked beans','sausages','dumplings','chicken pie','liver&bacon','steak','baked potatoes','back');
                            if prod_1(i)==9
                                continue;
                            end
                    end

🎉3 参考文献

[1]王微,林剑艺,崔胜辉,吝涛.碳足迹分析方法研究综述[J].环境科学与技术,2010,33(07):71-78.

部分理论引用网络文献,若有侵权联系博主删除。

🌈4 Matlab代码实现

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

荔枝科研社

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值