{"id":220693,"date":"2025-05-28T15:59:14","date_gmt":"2025-05-28T15:59:14","guid":{"rendered":"https:\/\/learnexams.com\/blog\/?p=220693"},"modified":"2025-05-28T15:59:16","modified_gmt":"2025-05-28T15:59:16","slug":"can-you-plot-the-following-in-matlab-and-give-me-the-code","status":"publish","type":"post","link":"https:\/\/www.learnexams.com\/blog\/2025\/05\/28\/can-you-plot-the-following-in-matlab-and-give-me-the-code\/","title":{"rendered":"Can you plot the following in matlab and give me the code."},"content":{"rendered":"\n<p>Can you plot the following in matlab and give me the code.<\/p>\n\n\n\n<p>(a) the Lade &#8211; Duncan yield criterion: f(s)=s1s2s3-KLD*p3<\/p>\n\n\n\n<p>(b) the Matsuoka &#8211; Nakai yield criterion: f(s)=s1s2s3-KMN*p(s1s2+s2s3+s3s1)<\/p>\n\n\n\n<p>(c) the Drucker &#8211; Prager criterion: f(s)=J22-I1-K=0<\/p>\n\n\n\n<p>Take f=30\u00b0 and assume any other parameters if required.<\/p>\n\n\n\n<p>KLD=1-12sin2f(3-sinf)2+16sin3f(3-sinf)3<\/p>\n\n\n\n<p>KMN=3(1-sinf-sin2f+sin3f)9-9sinf-sin2f+sin3f=2sinf32(3-sinf); <\/p>\n\n\n\n<p>K=6Ccosf32(3-sinf)<\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-ast-global-color-1-color\">:<\/mark><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/learnexams.com\/blog\/wp-content\/uploads\/2025\/05\/image-486-1024x494.png\" alt=\"\" class=\"wp-image-220694\"\/><\/figure>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-ast-global-color-0-color\">The Correct Answer and Explanation is:<\/mark><\/strong><\/p>\n\n\n\n<p>Here is the plot of the three yield criteria\u2014<strong>Lade-Duncan<\/strong>, <strong>Matsuoka-Nakai<\/strong>, and <strong>Drucker-Prager<\/strong>\u2014in the \u03c3\u2081\u2013\u03c3\u2082 stress space (with \u03c3\u2083 fixed at 10 units):<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">MATLAB Code Equivalent<\/h3>\n\n\n\n<p>Below is the equivalent <strong>MATLAB code<\/strong> that you can run directly to reproduce these plots:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>phi = 30; % degrees\nphi_rad = deg2rad(phi);\nsin_phi = sin(phi_rad);\ncos_phi = cos(phi_rad);\n\n% Constants\nKLD = 1 - (12 * sin_phi^2) \/ (3 - sin_phi)^2 + (16 * sin_phi^3) \/ (3 - sin_phi)^3;\nKMN = (3 * (1 - sin_phi - sin_phi^2 + sin_phi^3)) \/ ...\n      (9 - 9 * sin_phi - sin_phi^2 + sin_phi^3);\nlambda_dp = (2 * sin_phi) \/ (sqrt(3) * (3 - sin_phi));\nC = 1;\nK_dp = (6 * C * cos_phi) \/ (sqrt(3) * (3 - sin_phi));\n\n% Stress range\n&#91;s1, s2] = meshgrid(linspace(0, 100, 100), linspace(0, 100, 100));\ns3 = 10; % fixed value\np = (s1 + s2 + s3) \/ 3;\n\n% (a) Lade-Duncan\nf_ld = s1 .* s2 .* s3 - KLD * p.^3;\n\n% (b) Matsuoka-Nakai\nf_mn = s1 .* s2 .* s3 - KMN * p .* (s1 .* s2 + s2 * s3 + s3 .* s1);\n\n% (c) Drucker-Prager\nI1 = s1 + s2 + s3;\nJ2 = ((s1 - p).^2 + (s2 - p).^2 + (s3 - p).^2) \/ 2;\nf_dp = sqrt(J2) - lambda_dp * I1 - K_dp;\n\n% Plotting\nfigure;\nsubplot(1,3,1);\ncontour(s1, s2, f_ld, &#91;0 0], 'r');\ntitle('Lade-Duncan');\nxlabel('\\sigma_1'); ylabel('\\sigma_2');\n\nsubplot(1,3,2);\ncontour(s1, s2, f_mn, &#91;0 0], 'g');\ntitle('Matsuoka-Nakai');\nxlabel('\\sigma_1'); ylabel('\\sigma_2');\n\nsubplot(1,3,3);\ncontour(s1, s2, f_dp, &#91;0 0], 'b');\ntitle('Drucker-Prager');\nxlabel('\\sigma_1'); ylabel('\\sigma_2');\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Explanation<\/h3>\n\n\n\n<p>The plotted yield criteria represent different models used in soil and rock mechanics to describe failure surfaces under complex stress states. Each criterion is expressed as a function of the principal stresses (\u03c3\u2081, \u03c3\u2082, \u03c3\u2083) and is derived from different theoretical assumptions:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Lade-Duncan Criterion<\/strong>:<br>This model incorporates the product of all three principal stresses, emphasizing the importance of the intermediate stress \u03c3\u2082. It is defined as: f(\u03c3)=\u03c31\u03c32\u03c33\u2212KLD\u22c5p3f(\\sigma) = \\sigma_1 \\sigma_2 \\sigma_3 &#8211; K_{LD} \\cdot p^3 where pp is the mean stress. The factor KLDK_{LD} depends on the internal friction angle \u03c6 and is calculated to capture granular behavior. The 0-contour shows the yield surface in \u03c3\u2081\u2013\u03c3\u2082 space.<\/li>\n\n\n\n<li><strong>Matsuoka-Nakai Criterion<\/strong>:<br>A refinement of the Lade-Duncan, this includes a linear combination of stress products and a mean stress term: f(\u03c3)=\u03c31\u03c32\u03c33\u2212KMNp(\u03c31\u03c32+\u03c32\u03c33+\u03c33\u03c31)f(\\sigma) = \\sigma_1 \\sigma_2 \\sigma_3 &#8211; K_{MN} p (\\sigma_1\\sigma_2 + \\sigma_2\\sigma_3 + \\sigma_3\\sigma_1) This form allows a better fit for experimental data on sand, especially under triaxial loading.<\/li>\n\n\n\n<li><strong>Drucker-Prager Criterion<\/strong>:<br>A simplification often used in computational plasticity, this is based on the second invariant of deviatoric stress J2J_2 and the first stress invariant I1I_1: f(\u03c3)=J2\u2212\u03bbI1\u2212Kf(\\sigma) = \\sqrt{J_2} &#8211; \\lambda I_1 &#8211; K It is the smooth approximation of the Mohr-Coulomb surface, easier for numerical implementations.<\/li>\n<\/ol>\n\n\n\n<p>Each contour plot identifies the yield surface by solving for when f(\u03c3)=0f(\\sigma) = 0. For \u03c6 = 30\u00b0, which is typical for sand, the constants KLD and KMN shape the yield surface appropriately for geotechnical materials.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/learnexams.com\/blog\/wp-content\/uploads\/2025\/05\/learnexams-banner7-68.jpeg\" alt=\"\" class=\"wp-image-220695\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Can you plot the following in matlab and give me the code. (a) the Lade &#8211; Duncan yield criterion: f(s)=s1s2s3-KLD*p3 (b) the Matsuoka &#8211; Nakai yield criterion: f(s)=s1s2s3-KMN*p(s1s2+s2s3+s3s1) (c) the Drucker &#8211; Prager criterion: f(s)=J22-I1-K=0 Take f=30\u00b0 and assume any other parameters if required. KLD=1-12sin2f(3-sinf)2+16sin3f(3-sinf)3 KMN=3(1-sinf-sin2f+sin3f)9-9sinf-sin2f+sin3f=2sinf32(3-sinf); K=6Ccosf32(3-sinf) : The Correct Answer and Explanation is: Here [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[25],"tags":[],"class_list":["post-220693","post","type-post","status-publish","format-standard","hentry","category-exams-certification"],"_links":{"self":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts\/220693","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/comments?post=220693"}],"version-history":[{"count":0,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts\/220693\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/media?parent=220693"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/categories?post=220693"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/tags?post=220693"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}