In numerical methods, Matlab is required to do this problem the whole process is required, urgent u

Updated on technology 2024-02-08
8 answers
  1. Anonymous users2024-02-05

    1.Create a new m file and store the integrand:

    function f=fun(x)

    f=1./x;

    2.Create another M file and put it in the Romberg integration program:

    function [i,t]=romberg(fun,a,b,eps,varargin)

    The Romberg formula solves for numerical integrals.

    Input parameter: -fun: integrand.

    a, b: the endpoint of the integration interval.

    eps: accuracy requirements, the default value is 1e-6

    p1,p2,..fun.

    Output parameter: -i: the value of the obtained integral.

    t:The lower triangular matrix resulting from the Romberg integration process.

    if nargin<4|isempty(eps);

    eps=1e-6;

    endn=1;h=b-a;

    t(1,1)=h/2*sum(feval(fun,[a,b],varargin));

    tol=1;

    while tol>eps

    h=h/2;n=2*n;k=log2(n);

    x=a+(2*(1:n/2)-1)*h;

    fx = feval(fun,x,varargin);Calculate the value of the function.

    t(k+1,1)=1/2*t(k,1)+h*sum(fx);

    for j=1:k

    t(k+1,j+1)=(4^j*t(k+1,j)-t(k,j))/(4^j-1);

    endtol=abs(t(k+1,k+1)-t(k,k));

    endi=t(k+1,k+1);

    3.Invoke the calculation in the command window:

    y=vpa(romberg(@fun,1,3,1e-5),6)y =

  2. Anonymous users2024-02-04

    The problem of finding heterogeneous arrays...

  3. Anonymous users2024-02-03

    Since to calculate the shear frequency and phase angle margin, you can consider using the margin function directly to draw a BODE diagram

    s=tf('s');

    g=10/(s*(2*s+1)*(s^2+;

    margin(g)

    As can be seen from the figure, the shear frequency wc= and the phase angle margin is -136 degrees. Obviously, the closed-loop system is unstable.

    Due to the instability of the closed-loop system, the time domain indicators (overshoot and adjustment time) are not available, and if you want to verify it with a step response curve, you can use :

    step(feedback(g,1))

    It is easy to see that the step response of a closed-loop system is indeed divergent.

  4. Anonymous users2024-02-02

    Eh: It's a pity that I don't understand your major, MATLAB is okay, can you describe the problem in detail?

  5. Anonymous users2024-02-01

    1.Solve the parsed form of the single argument.

    a=dsolve('dp1=40*p1/v','dp2=40*p1/v-40*p2/v')

    The answer is: >ans =

    2*c6*exp((40*t)/v)

    c5/exp((40*t)/v) +c6*exp((40*t)/v)

    Bring in the source P1(0)=10C, P2(0)=20C, and solve C5=5C, C6=15C

    2.Take two points in the concentration data, p2(20)=, p2(40)=, bring them into the analytical formula of p2, and use fsolve() to solve c and v, I hope it can help you.

  6. Anonymous users2024-01-31

    The subject's question belongs to the mathematical statistical drawing problem. The process of its implementation.

    1. Use the unifrnd random function and round it with the integer function to generate a grade vector in the range of 50 100.

    2. Use the mean function to calculate its average score.

    3. Use the for loop statement to sort out the data with a score greater than or equal to 60 points, and then find out the number of 4, and calculate the passing rate.

    5. Use the for loop statement, and then use the if conditional statement to distinguish "90 100 points."','Score 80 89 points','Score 70 79 points','Score 60 69 points','score of 60 points or less", and make a mark.

    6. Use the sum function to count the number of conditions.

    7. Use the bar function to make a histogram.

    8. Use the pie function to make a pie chart.

    According to the above requirements, the following results can be obtained.

  7. Anonymous users2024-01-30

    :pi/20:pi;

    y1=sin(x)

    y2=-sin(x)

    y3=sin(x)*sin(9*x)

    figure(1)

    subplot(3,1,1)

    plot(x,y1)

    axis([0,pi,-1,1])

    subplot(3,1,2)

    plot(x,y2)

    axis([0,pi,-1,1])

    subplot(3,1,3)

    plot(x,y3)

    axis([0,pi,-1,1])

    title('Continuously modulated waveforms')

    9y1=sin(t)

    y2=-sin(t)

    y3=sin(t)*sin(9*t)

    7.Function file.

    function [s,c]=yuan(r)s=r.^2*pi

    c=2*pi*r

  8. Anonymous users2024-01-29

    Leave a mailbox!! How can you give the source program if you don't give the mailbox.。。

Related questions
10 answers2024-02-08

a = "n c hundred du q49232 ah ah ah pp"

mid(trim(a), 9, 5) 'From the 9th character from left to right (spaces are also counted), count 5 characters you want. >>>More

12 answers2024-02-08

Control of chemicals and hazardous substances.

HP's manufacturer's Code of Conduct states that "chemicals and other raw materials may pose a hazard if they are released into the environment, so seek to ensure their safe operation, safe operation, safe storage, ** or safe reuse and disposal." >>>More

2 answers2024-02-08

The following methods can be roughly judged:

1) Look at the color: **The higher the purity of the jewelry, the darker the color. In the absence of a gold medal, the general color can be determined according to the following colors: >>>More

3 answers2024-02-08

19: a tool returned an error code

You can find such a post: >>>More

14 answers2024-02-08

Studies have shown that less than 5% of what the human eye sees and what the ear hears leaves an impression, or 95% of what we have felt does not leave a deep impression on us. >>>More