{"id":1137,"date":"2016-10-03T12:16:11","date_gmt":"2016-10-03T10:16:11","guid":{"rendered":"http:\/\/www.supagro.fr\/wordpress\/modeleco\/?page_id=1137"},"modified":"2024-07-10T14:25:50","modified_gmt":"2024-07-10T12:25:50","slug":"activite-7-b-commande-display","status":"publish","type":"page","link":"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/auto-formation\/sequence1\/cours2-introduction-a-gams\/lecon7\/activite-7-b-commande-display\/","title":{"rendered":"Activity 7A : \u00ab Wheat\/maize \u00bb model \u2013 Displaying results"},"content":{"rendered":"<h4 style=\"text-align: right\"><span style=\"text-decoration: underline\">Length : around 15 minutes<\/span><\/h4>\n<h3><strong>First part :<\/strong><\/h3>\n<p>Based on the following programme excerpt :<\/p>\n<pre>*---------- DECLARATIONS ----------*\nsets C crops \/wheat,maize\/ ;\n\n*---------- DATA ----------*\nscalar\nLAND_A land availability in hectares \/50\/\nLABOUR_A labour availability in hours \/2000\/ ;\n\nparameter\nLN(C) labour needs per hectare and per crop (hours)\n\/wheat 25\nmaize 50\/\nYLD (C) yield per crop in tonnes per hectare\n\/ wheat 5\nmaize 10\/\nPC (C) selling price per crop in euros\n\/ wheat 150\nmaize 150\/\nCOST (C) cost per crop in euros per ha\n\/ wheat 300\nmaize 500\/\n;\nparameter\nGM(C) gross margin per crop in euros ;\nGM(C) = YLD(C)*PC(C)-COST(C);\n\n*---------- MODEL ----------*\nvariables Z total fram income (euros) ;\npositive variables X area per crop (hectares) ;\n\nequations\nOBJECTIVE objective function\nLAND land equation\nLABOUR labour equation\n;\n\nOBJECTIVE.. sum(c, GM(c)*X(c)) =E= Z ;\nLAND.. sum(c, X(c)) =l= LAND_A ;\nLABOUR.. sum(c, LN(c)*X(c)) =L= LABOUR_A ;\n\nmodel example first example \/all\/;\n\n*---------- SOLUTION ----------*\nsolve example using LP maximizing Z;\n\ndisplay X.m ;\ndisplay C;<\/pre>\n<script>\n                            if (window.qmn_quiz_data === undefined) {\n                                    window.qmn_quiz_data = new Object();\n                            }\n                    <\/script><script>window.qmn_quiz_data[\"15\"] = {\"quiz_id\":\"15\",\"quiz_name\":\"act 7A\",\"disable_answer\":0,\"ajax_show_correct\":0,\"progress_bar\":\"0\",\"contact_info_location\":0,\"qpages\":{\"1\":{\"id\":\"1\",\"quizID\":\"15\",\"pagekey\":\"JYHLtW2Z\",\"hide_prevbtn\":\"0\"}},\"skip_validation_time_expire\":0,\"timer_limit_val\":0,\"disable_scroll_next_previous_click\":0,\"disable_scroll_on_result\":0,\"disable_first_page\":\"0\",\"enable_result_after_timer_end\":0,\"enable_quick_result_mc\":0,\"end_quiz_if_wrong\":0,\"form_disable_autofill\":0,\"disable_mathjax\":0,\"enable_quick_correct_answer_info\":0,\"quick_result_correct_answer_text\":\"Correct! You have selected correct answer.\",\"quick_result_wrong_answer_text\":\"Wrong! You have selected wrong answer.\",\"quiz_processing_message\":\"\",\"quiz_limit_choice\":\"Limit of choice is reached.\",\"not_allow_after_expired_time\":0,\"scheduled_time_end\":false,\"prevent_reload\":0,\"limit_email_based_submission\":0,\"total_user_tries\":0,\"is_logged_in\":false,\"error_messages\":{\"email_error_text\":\"Not a valid e-mail address!\",\"number_error_text\":\"This field must be a number!\",\"incorrect_error_text\":\"The entered text is not correct!\",\"empty_error_text\":\"Please complete all required fields!\",\"contact_field_required_error_text\":\"Please complete all required fields!\",\"url_error_text\":\"The entered URL is not valid!\",\"minlength_error_text\":\"Required atleast %minlength% characters.\",\"maxlength_error_text\":\"Maximum %maxlength% characters allowed.\",\"recaptcha_error_text\":\"ReCaptcha is missing\",\"phone_error_text\":\"Phone number is invalid\"},\"questions_settings\":[]}\n                    <\/script>\t\t<div class='qsm-quiz-container qsm-quiz-container-15 qmn_quiz_container mlw_qmn_quiz  quiz_theme_default  '>\n\t\t\t\t\t\t\t\t<form name=\"quizForm15\" id=\"quizForm15\" action=\"\/wordpress\/modelecoen\/wp-json\/wp\/v2\/pages\/1137\" method=\"POST\" class=\"qsm-quiz-form qmn_quiz_form mlw_quiz_form\" novalidate enctype=\"multipart\/form-data\">\n\t\t\t\t<input type=\"hidden\" name=\"qsm_hidden_questions\" id=\"qsm_hidden_questions\" value=\"\">\n\t\t\t\t<input type=\"hidden\" name=\"qsm_nonce\" id=\"qsm_nonce_15\" value=\"4e98ad65ff\">\n\t\t\t\t<input type=\"hidden\" name=\"qsm_unique_key\" id=\"qsm_unique_key_15\" value=\"6a534c27c5892\">\n\t\t\t\t<div id=\"mlw_error_message\" class=\"qsm-error-message qmn_error_message_section\"><\/div>\n\t\t\t\t<span id=\"mlw_top_of_quiz\"><\/span>\n\t\t\t\t\t\t\t<section class=\"qsm-page \">\n\t\t\t\t\t\t\t\t<div class=\"quiz_section qsm-question-wrapper question-type-0 question-section-id-90 \" data-qid=\"90\">\n\t\t\t\t\t<div class='mlw_qmn_question ' >\n\t\t<p><strong>What will the DISPLAY c command show ?<\/strong><\/p>\n\t<\/div>\n\t\t<fieldset>\n\t\t<legend><\/legend>\n\t<div class='qmn_radio_answers '>\n\t\t\t\t\t\t\t\t<div class=\"qmn_mc_answer_wrap  mrq_checkbox_class\" id=\"question90-1 \">\n\t\t\t\t\t\t\t\t\t\t\t<input type='radio' class='qmn_quiz_radio qmn-multiple-choice-input ' name=\"question90\" id=\"question90_1\" value=\"0\" \/>\n\t\t\t\t\t<label class=\"qsm-input-label\" for=\"question90_1\">\n\t\t\t\t\tGiven 'maize'\t\t\t\t\t<\/label>\n\t\t\t\t\t \t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"qmn_mc_answer_wrap  mrq_checkbox_class\" id=\"question90-2 \">\n\t\t\t\t\t\t\t\t\t\t\t<input type='radio' class='qmn_quiz_radio qmn-multiple-choice-input ' name=\"question90\" id=\"question90_2\" value=\"1\" \/>\n\t\t\t\t\t<label class=\"qsm-input-label\" for=\"question90_2\">\n\t\t\t\t\tWheat, maize\t\t\t\t\t<\/label>\n\t\t\t\t\t \t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"qmn_mc_answer_wrap  mrq_checkbox_class\" id=\"question90-3 \">\n\t\t\t\t\t\t\t\t\t\t\t<input type='radio' class='qmn_quiz_radio qmn-multiple-choice-input ' name=\"question90\" id=\"question90_3\" value=\"2\" \/>\n\t\t\t\t\t<label class=\"qsm-input-label\" for=\"question90_3\">\n\t\t\t\t\tCereal selling prices\t\t\t\t\t<\/label>\n\t\t\t\t\t \t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"qmn_mc_answer_wrap  mrq_checkbox_class\" id=\"question90-4 \">\n\t\t\t\t\t\t\t\t\t\t\t<input type='radio' class='qmn_quiz_radio qmn-multiple-choice-input ' name=\"question90\" id=\"question90_4\" value=\"3\" \/>\n\t\t\t\t\t<label class=\"qsm-input-label\" for=\"question90_4\">\n\t\t\t\t\tCrop areas\t\t\t\t\t<\/label>\n\t\t\t\t\t \t\t\t\t<\/div>\n\t\t\t\t\t \t\t\t<label style=\"display: none !important;\" for=\"question90_none\">None<\/label>\n\t\t\t<input type=\"radio\" style=\"display: none;\" name=\"question90\" id=\"question90_none\" checked=\"checked\" value=\"\" \/>\n\t\t\t\t<\/div>\n\t<\/fieldset>\n\t<input type=\"hidden\" name=\"answer_limit_keys_90\" value=\"\" \/>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<div class=\"quiz_section qsm-question-wrapper question-type-0 question-section-id-93 \" data-qid=\"93\">\n\t\t\t\t\t<div class='mlw_qmn_question ' >\n\t\t<p><strong>What will the DISPLAY x.m command show ?<\/strong><\/p>\n\t<\/div>\n\t\t<fieldset>\n\t\t<legend><\/legend>\n\t<div class='qmn_radio_answers '>\n\t\t\t\t\t\t\t\t<div class=\"qmn_mc_answer_wrap  mrq_checkbox_class\" id=\"question93-1 \">\n\t\t\t\t\t\t\t\t\t\t\t<input type='radio' class='qmn_quiz_radio qmn-multiple-choice-input ' name=\"question93\" id=\"question93_1\" value=\"0\" \/>\n\t\t\t\t\t<label class=\"qsm-input-label\" for=\"question93_1\">\n\t\t\t\t\tThe value of the lowest X\t\t\t\t\t<\/label>\n\t\t\t\t\t \t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"qmn_mc_answer_wrap  mrq_checkbox_class\" id=\"question93-2 \">\n\t\t\t\t\t\t\t\t\t\t\t<input type='radio' class='qmn_quiz_radio qmn-multiple-choice-input ' name=\"question93\" id=\"question93_2\" value=\"1\" \/>\n\t\t\t\t\t<label class=\"qsm-input-label\" for=\"question93_2\">\n\t\t\t\t\tThe marginal value of all X\u2019s\t\t\t\t\t<\/label>\n\t\t\t\t\t \t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"qmn_mc_answer_wrap  mrq_checkbox_class\" id=\"question93-3 \">\n\t\t\t\t\t\t\t\t\t\t\t<input type='radio' class='qmn_quiz_radio qmn-multiple-choice-input ' name=\"question93\" id=\"question93_3\" value=\"2\" \/>\n\t\t\t\t\t<label class=\"qsm-input-label\" for=\"question93_3\">\n\t\t\t\t\tThe value of all X\u2019s\t\t\t\t\t<\/label>\n\t\t\t\t\t \t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"qmn_mc_answer_wrap  mrq_checkbox_class\" id=\"question93-4 \">\n\t\t\t\t\t\t\t\t\t\t\t<input type='radio' class='qmn_quiz_radio qmn-multiple-choice-input ' name=\"question93\" id=\"question93_4\" value=\"3\" \/>\n\t\t\t\t\t<label class=\"qsm-input-label\" for=\"question93_4\">\n\t\t\t\t\tThe value of the highest X\t\t\t\t\t<\/label>\n\t\t\t\t\t \t\t\t\t<\/div>\n\t\t\t\t\t \t\t\t<label style=\"display: none !important;\" for=\"question93_none\">None<\/label>\n\t\t\t<input type=\"radio\" style=\"display: none;\" name=\"question93\" id=\"question93_none\" checked=\"checked\" value=\"\" \/>\n\t\t\t\t<\/div>\n\t<\/fieldset>\n\t<input type=\"hidden\" name=\"answer_limit_keys_93\" value=\"\" \/>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<\/section>\n\t\t\t\t\t<input type=\"hidden\" name=\"qmn_question_list\" value=\"90Q93Q\" \/>\n\t\t\t\t\t\t\t<div id=\"mlw_error_message_bottom\" class=\"qsm-error-message qmn_error_message_section\"><\/div>\n\t\t\t\t\t<input type=\"hidden\" name=\"qmn_all_questions_count\" id=\"qmn_all_questions_count\" value=\"2\" \/>\n\t\t\t\t\t<input type=\"hidden\" name=\"total_questions\" id=\"total_questions\" value=\"2\" \/>\n\t\t\t\t\t<input type=\"hidden\" name=\"timer\" id=\"timer\" value=\"0\" \/>\n\t\t\t\t\t<input type=\"hidden\" name=\"timer_ms\" id=\"timer_ms\" value=\"0\"\/>\n\t\t\t\t\t<input type=\"hidden\" class=\"qmn_quiz_id\" name=\"qmn_quiz_id\" id=\"qmn_quiz_id\" value=\"15\" \/>\n\t\t\t\t\t<input type='hidden' name='complete_quiz' value='confirmation' \/>\n\t\t\t\t\t\t\t\t\t<\/form>\n\t\t\t\t\t\t<\/div>\n\t\t<div style=\"display: none;\" class=\"qsm-popup qsm-popup-slide\" id=\"modal-4\" aria-hidden=\"false\"><div class=\"qsm-popup__overlay\" tabindex=\"-1\" data-micromodal-close=\"\"><div class=\"qsm-popup__container qmn_quiz_container\" role=\"dialog\" aria-modal=\"true\"><div class=\"qsm-popup__content\"><img decoding=\"async\" src=\"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/wp-content\/plugins\/quiz-master-next\/assets\/clock.png\" alt=\"clock.png\"\/><p class=\"qsm-time-up-text\"> Time's up<\/p><\/div><footer class=\"qsm-popup__footer\"><button class=\"qsm-popup-secondary-button qmn_btn\" data-micromodal-close=\"\" aria-label=\"Close this dialog window\" onclick=\"location.reload();\">Cancel<\/button><\/footer><\/div><\/div><\/div>\n<h3><strong>Second part :<\/strong><\/h3>\n<p>Download the \u00a0<a href=\"https:\/\/www.supagro.fr\/ModelEco\/en\/modeles\/modelEco_primal1.zip\">primal1.zip<\/a>\u00a0 file and unzip it to your GAMS project folder (if you have not already done it), then open it in GAMS. Add the necessary lines to the model in order to display :<\/p>\n<ul>\n<li>The marginal value of the labour equation<\/li>\n<li>The optimum value of areas<\/li>\n<li>The minimum value of the soil equation<\/li>\n<li>The gross margin parameter<\/li>\n<\/ul>\n<p><strong>Then verify :<em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/em> <a href=\"http:\/\/www.supagro.fr\/wordpress\/modelecoen\/auto-formation\/sequence1\/cours2-introduction-a-gams\/lecon7\/activite-7-c-afficher-des-resultats\/\" rel=\"attachment wp-att-961\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.supagro.fr\/wordpress\/modeleco\/files\/2016\/08\/solution.png\" alt=\"solution\" width=\"119\" height=\"61\" \/><\/a><\/strong><br \/>\n<a href=\"http:\/\/www.supagro.fr\/wordpress\/modelecoen\/auto-formation\/sequence1\/cours2-introduction-a-gams\/\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4121 alignright\" src=\"http:\/\/www.supagro.fr\/wordpress\/modelecoen\/files\/2018\/11\/backUnit.png\" alt=\"\" width=\"211\" height=\"66\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Length : around 15 minutes First part : Based on the following programme excerpt : *&#8212;&#8212;&#8212;- DECLARATIONS &#8212;&#8212;&#8212;-* sets C crops \/wheat,maize\/ ; *&#8212;&#8212;&#8212;- DATA &#8212;&#8212;&#8212;-* scalar LAND_A land availability in hectares \/50\/ LABOUR_A labour availability in hours \/2000\/ ; <a class=\"more-link\" href=\"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/auto-formation\/sequence1\/cours2-introduction-a-gams\/lecon7\/activite-7-b-commande-display\/\">Continue reading <span class=\"screen-reader-text\">  Activity 7A : \u00ab Wheat\/maize \u00bb model \u2013 Displaying results<\/span><span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":92,"featured_media":0,"parent":372,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1137","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/wp-json\/wp\/v2\/pages\/1137","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/wp-json\/wp\/v2\/users\/92"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/wp-json\/wp\/v2\/comments?post=1137"}],"version-history":[{"count":26,"href":"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/wp-json\/wp\/v2\/pages\/1137\/revisions"}],"predecessor-version":[{"id":5109,"href":"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/wp-json\/wp\/v2\/pages\/1137\/revisions\/5109"}],"up":[{"embeddable":true,"href":"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/wp-json\/wp\/v2\/pages\/372"}],"wp:attachment":[{"href":"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/wp-json\/wp\/v2\/media?parent=1137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}