Homework Solution: A bar with uniform cross-sectional area A, elastic modulus E, and length L is loaded with distributed loads qfx). The b…

    A bar with uniform cross-sectional area A, elastic modulus E, and length L is loaded with distributed loads qfx). The bar is fixed on the left end and attach to the spring of stiffness K, which is relaxed when the bar is undeformed. A as .02m2, the Youngs modulus E as 210 GPa (Steel ASTM A36), K = 1 000kN/m 1. Spring constant K q(x) f( spring) Cross sectional Area : A(m2) L (m) Ed2u(x) =-q(x);0 < x < L u(0) = 0, F =-Ku(L) B. C: (2x)2 Jo-12- x=[0,乳 2 g(x) = 2x o (2 (40 points) Write a MATLAB program which: - Takes as input: Length of the bar, number of intervals N and qo - Assembles the FD matrices. Run your program using length L-5 (unit: m), q,-5 (unit: KN), and when N-2,4,8 and N=16. 2. (10 points) Find the exact solution to the problem, then plot the exact solution with FD solutions for N-2, 4, 8 and N-16 on the same plot. media%2F06f%2F06f9aca1-dfa0-4473-8ecd-68 I need help writing the code for #3 and 4. I was able to write the code for #1 and 2 but I am stuck on 3 and 4 and I am also running out of time. Please help I will attach my codes for 1 and 2 in case you need it. For #1 the code is below clear all clc L= input('what is the length of the bar'); N= input('what is the number of intervals '); q0= input('what is this value'); E= 2.1e11; A= 0.02; h = L/N; k= 1000000; A_1= zeros(N); for c=2:N-1 A_1(c,c)=-2; A_1(c,c-1)=1; A_1(c,c+1)=1;   end A_1(N,N-1)=2; A_1(1,1)=-2;   A_1 (1,2)= 1; A_1(N,N)=-2-2*h*k/(A*E); A_1; x= h:h:L; for i= 1:N if x(i)<= L/2 q(i)= q0*((2*x(i))^2)/L^2; else q(i)=q0*(2-2*x(i)/L); end end A_1 q b= zeros(N,1); for i= 1:N b(i)= - ((h^2)*q(i)/(E*A)); end b U= A_1^-1*b For #2 the code is below clc clear all E= 2.1e11; A= 0.02; L= 5; q0= 5000; G = [2 4 8 16 4096] for j= 1:5 N= G(j); k= 1000000; A_1= zeros(N); h = L/N; for c=2:N-1 A_1(c,c)=-2; A_1(c,c-1)=1; A_1(c,c+1)=1;   end A_1(N,N-1)=2; A_1(1,1)=-2;   A_1 (1,2)= 1; A_1(N,N)=-2-2*h*k/(A*E); A_1 x= h:h:L; for i= 1:N if x(i)<= L/2 q(i)= q0*(2*x(i))^2/L^2; else q(i)=q0*(2-2*x(i)/L); end end A_1 q b= zeros(N,1); for i= 1:N b(i)= - ((h^2)*q(i)/(E*A)); end b U= A_1b plot (x,U) hold on end  
    A bar with uniform cross-sectional area A, elastic modulus E, and length L is loaded with distributed loads qfx). The bar is fixed on the left end and attach to the spring of stiffness K, which is relaxed when the bar is undeformed. A as .02m2, the Young's modulus E as 210 GPa (Steel ASTM A36), K = 1 000kN/m 1. Spring constant K q(x) f( spring) Cross sectional Area : A(m2) L (m) Ed2u(x) =-q(x);0

    Expert Answer

     
    For Case #3 the code is clear all

    A cease with homogeneous cross-sectional area A, extensile modulus E, and prolixity L is loaded with distributed loads qfx). The cease is unwandering on the left object and subjoin to the leap of slang K, which is relaxed when the cease is undeformed. A as .02m2, the Youngs modulus E as 210 GPa (Steel ASTM A36), K = 1 000kN/m 1. Leap continuous K q(x) f( leap) Cross sectional Area : A(m2) L (m) Ed2u(x) =-q(x);0 < x < L u(0) = 0, F =-Ku(L) B. C: (2x)2 Jo-12- x=[0,乳 2 g(x) = 2x o (2 (40 points) Transcribe a MATLAB program which: - Takes as input: Prolixity of the cease, reckon of intervals N and qo - Assembles the FD matrices. Run your program using prolixity L-5 (unit: m), q,-5 (unit: KN), and when N-2,4,8 and N=16. 2. (10 points) Find the proper discontinuance to the gist, then devise the proper discontinuance with FD discontinuances control N-2, 4, 8 and N-16 on the corresponding devise.

    media%2F06f%2F06f9aca1-dfa0-4473-8ecd-68

    I insufficiency acceleration fitness the order control #3 and 4. I was talented to transcribe the order control #1 and 2 excepting I am accumulate on 3 and 4 and I am as-well ordinary extinguished of date. Please acceleration I conciliate subjoin my orders control 1 and 2 in condition you insufficiency it.

    Control #1 the order is below

    clear all

    clc

    L= input(‘what is the prolixity of the cease’);

    N= input(‘what is the reckon of intervals ‘);

    q0= input(‘what is this value’);

    E= 2.1e11;

    A= 0.02;

    h = L/N;

    k= 1000000;

    A_1= zeros(N);

    control c=2:N-1

    A_1(c,c)=-2;

    A_1(c,c-1)=1;

    A_1(c,c+1)=1;

     

    end

    A_1(N,N-1)=2;

    A_1(1,1)=-2;

     

    A_1 (1,2)= 1;

    A_1(N,N)=-2-2*h*k/(A*E);

    A_1;

    x= h:h:L;

    control i= 1:N

    if x(i)<= L/2

    q(i)= q0*((2*x(i))^2)/L^2;

    else

    q(i)=q0*(2-2*x(i)/L);

    end

    end

    A_1

    q

    b= zeros(N,1);

    control i= 1:N

    b(i)= – ((h^2)*q(i)/(E*A));

    end

    b

    U= A_1^-1*b

    Control #2 the order is below

    clc

    clear all

    E= 2.1e11;

    A= 0.02;

    L= 5;

    q0= 5000;

    G = [2 4 8 16 4096]

    control j= 1:5

    N= G(j);

    k= 1000000;

    A_1= zeros(N);

    h = L/N;

    control c=2:N-1

    A_1(c,c)=-2;

    A_1(c,c-1)=1;

    A_1(c,c+1)=1;

     

    end

    A_1(N,N-1)=2;

    A_1(1,1)=-2;

     

    A_1 (1,2)= 1;

    A_1(N,N)=-2-2*h*k/(A*E);

    A_1

    x= h:h:L;

    control i= 1:N

    if x(i)<= L/2

    q(i)= q0*(2*x(i))^2/L^2;

    else

    q(i)=q0*(2-2*x(i)/L);

    end

    end

    A_1

    q

    b= zeros(N,1);

    control i= 1:N

    b(i)= – ((h^2)*q(i)/(E*A));

    end

    b

    U= A_1b

    devise (x,U)

    hold on

    end

     

    A cease with homogeneous cross-sectional area A, extensile modulus E, and prolixity L is loaded with distributed loads qfx). The cease is unwandering on the left object and subjoin to the leap of slang K, which is relaxed when the cease is undeformed. A as .02m2, the Young’s modulus E as 210 GPa (Steel ASTM A36), K = 1 000kN/m 1. Leap continuous K q(x) f( leap) Cross sectional Area : A(m2) L (m) Ed2u(x) =-q(x);0

    Expert Solution

     

    Control Condition #3 the order is
    clear all
    clc
    L= input(‘what is the prolixity of the cease’);
    N= input(‘what is the reckon of intervals ‘);
    q0= input(‘what is this value’);
    E= 2.1e11;
    A= 0.02;
    h = L/N;
    k= 1000000;
    A_1= zeros(N);

    control c=2:N-1
    A_1(c,c)=-2;
    A_1(c,c-1)=1;
    A_1(c,c+1)=1;

    end

    A_1(N,N-1)=2;
    A_1(1,1)=-2;

    A_1 (1,2)= 1;
    A_1(N,N)=-2-2*h*k/(A*E);

    A_1;
    x= h:h:L;

    control i= 1:N
    if x(i)<= L/2
    q(i)= q0*((2*x(i))^2)/L^2;
    else
    q(i)=q0*(2-2*x(i)/L);
    end
    end
    A_1
    q

    b= zeros(N,1);

    control i= 1:N
    b(i)= – ((h^2)*q(i)/(E*A));
    end
    b

    U= A_1^-1*b
    Control Condition #2 the order is
    clc
    clear all

    E= 2.1e11;
    A= 0.02;
    L= 5;
    q0= 5000;
    G = [2 4 8 16 4096]

    control j= 1:5
    N= G(j);
    k= 1000000;
    A_1= zeros(N);
    h = L/N;

    control c=2:N-1
    A_1(c,c)=-2;
    A_1(c,c-1)=1;
    A_1(c,c+1)=1;

    end

    A_1(N,N-1)=2;
    A_1(1,1)=-2;

    A_1 (1,2)= 1;
    A_1(N,N)=-2-2*h*k/(A*E);

    A_1
    x= h:h:L;

    control i= 1:N
    if x(i)<= L/2
    q(i)= q0*(2*x(i))^2/L^2;
    else
    q(i)=q0*(2-2*x(i)/L);
    end
    end
    A_1
    q

    b= zeros(N,1);

    control i= 1:N
    b(i)= – ((h^2)*q(i)/(E*A));
    end
    b

    U= A_1b
    devise (x,U)
    hold on
    end