Question

Matlab Problem

Plot the analytical and random walk solutions for concentration with D 0.01 att 1, 2, 5, and 10 s (four separate plots). Use an x-axis range from -2 to 2 and a y-axis range from 0 to 15e4 on all plots. Include the simulation end time in the plot title

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Save the code in MATLAB and get the results. The output graphs are also shown below-

  1. For N=1

clc

clear

close all;

N = 1; % Dimensions

F = @(t,X) zeros(N,1); % Drift

G = @(t,X) eye(N); % diffusion

S = sde(F,G,'startState',zeros(N,1)); % Start at the origin

X = S.simByEuler(10000,'ntrials',1,'Z',@(t,X) RandDir(N));

comet(1:numel(X),X);

plot(1:numel(X),X);

grid on;

80 60 40 20 0 -20 40 60 -80 -100 -120 2000 4000 6000 8000 10000 12000

(A) For N=2

Change the values of N=1 to N=2 in the above code.

20 0 -20 -40 -60 -80 02 04 08 08 1214 1012 1.2 1.4 .6 1.8 4 x 10 (C)For N-5 Change the values of N-1 to N 5 in the above code

40 20 0 -20 40 -60 -8아 -100 0.5 1 15 2 2.5 3 3.5 4 4.5 5 × 104 (C) For N-10 Change the values of N-1 to N-10 in the above cod

Add a comment
Know the answer?
Add Answer to:
Matlab Problem Plot the analytical and random walk solutions for concentration with D 0.01 att 1,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • MATLAB Program Problem A projectile is shot at an angle of 50 degrees with respect to...

    MATLAB Program Problem A projectile is shot at an angle of 50 degrees with respect to the horizontal at a velocity of 200 m/s. Earth's gravity is 9.81 m/s 2. Take the variable x as the range and y as the altitude. Create a MATLAB plot, which plots that trajectory. Now, assume the terrain slopes up by 1 m in y for every 10 m in x. On the same axis, plot the line of the terrain in a different...

  • The purpose of this problem is to become familiar with the use of MATLAB. Consider the...

    The purpose of this problem is to become familiar with the use of MATLAB. Consider the continuous-time function x(t) 2e0.5sin(87t)u(t), where u(t) is the unit step function. a) (10 points) Design a MATLAB routine to plot x(t) from t -5 to t = 5 using 10, 100, and 1000 equally spaced samples. The following MATLAB code fragment suggests how this 11. can be done (using 1000 equally spaced samples). Note that the function provided by MATLAB, but can be easily...

  • Please help me with this MATLAB programming problem! Im coding iin MATLAB2018 if that makes any d...

    Please help me with this MATLAB programming problem! Im coding iin MATLAB2018 if that makes any difference! The first picture is the question i need to answer. The picture below is used as reference to answer the question. The last picture (below) is the into to the problem, and is used as reference. 1. Use Matlab to create the following single plot with three subplots. All titles, gridlines, and axis labels should be as shown. Arc System Response 15 E...

  • Problem 1: Random Walk A random walk is a stochastic process. A stochastic process is a series of...

    python / visual studio Problem 1: Random Walk A random walk is a stochastic process. A stochastic process is a series of values that are not determined functionally, but probabilistically. The random walk is supposed to describe an inebriated person who, starting from the bar, intends to walk home, but because of intoxication instead randomly takes single steps either forward or backward, left or right. The person has no memory of any steps taken, so theoretically, the person shouldn't move...

  • Write a MATLAB Graphical User Interface (GUI) to simulate and plot the projectile motion – the...

    Write a MATLAB Graphical User Interface (GUI) to simulate and plot the projectile motion – the motion of an object projected into the air at an angle. The object flies in the air until the projectile returns to the horizontal axis (x-axis), where y=0. This MATLAB program should allow the user to try to hit a 2-m diameter target on the x-axis (y=0) by varying conditions, including the lunch direction, the speed of the lunch, the projectile’s size, and the...

  • python / visual studio Problem 1: Random Walk A random walk is a stochastic process. A...

    python / visual studio Problem 1: Random Walk A random walk is a stochastic process. A stochastic process is a series of values that are not determined functionally, but probabilistically. The random walk is supposed to describe an inebriated person who, starting from the bar, intends to walk home, but because of intoxication instead randomly takes single steps either forward or backward, left or right. The person has no memory of any steps taken, so theoretically, the person shouldn't move...

  • Matlab 5. (10 pts) The following table shows data from a chemical reactor as a reaction...

    Matlab 5. (10 pts) The following table shows data from a chemical reactor as a reaction is taking place. The concentration of the reactant is monitored as a function of time. 10 20 30 40 50 60 70 80 90 100 Time (s) Concentration (mg/L) 100 36.8 135 5 18 17 1.6 1.5 1.4 1.3 1.2 write a MATLAB script to generate a plot of concentration (y-axis) vs. time (x-axis). Use a black solid line with a circle as the...

  • MATLAB! Evaluate the function y=(x-(1/x))/(1+(1/x^2)) for x varying from -2 to 2 with 0.01 steps. Plot...

    MATLAB! Evaluate the function y=(x-(1/x))/(1+(1/x^2)) for x varying from -2 to 2 with 0.01 steps. Plot the function (y versus x) as a line such that it's blue when y<-0.2, red when y<0.2, and green for all the other values.

  • Matlab While loop help I'm doing a random walk problem and i need to make it...

    Matlab While loop help I'm doing a random walk problem and i need to make it so that when the walker goes over a certain position it gets reflected back onto the center (position=0). For this I'm trying to use while loops but they seem to get stuck. The program works fine until it reaches one of its limits (-10 or 10) then the while loops are supposed to prevent the position from going further and instead send the position...

  • Problem 1 MATLAB A Taylor series is a series expansion of a function f()about a given point a. For one-dimensional real...

    Problem 1 MATLAB A Taylor series is a series expansion of a function f()about a given point a. For one-dimensional real-valued functions, the general formula for a Taylor series is given as ia) (a) (z- a) (z- a)2 + £(a (r- a) + + -a + f(x)(a) (1) A special case of the Taylor series (known as the Maclaurin series) exists when a- 0. The Maclaurin series expansions for four commonly used functions in science and engineering are: sin(x) (-1)"...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT