Question: Problem 1 . [ 7 5 points ] Consider the following system of ordinary differential equations: d ( v e c ( x ) )

Problem 1.[75 points] Consider the following system of ordinary differential equations:
d(vec(x))dt=-vec(x)+W(vec(x)),vec(x)(0)=vec(x)0.
vec(x)inRN is an N-dimensional vector and WinRNN is an NN matrix.
The time derivative is applied elementwise. In other words, for vec(x)=(x1,x2,dots,xN)inRN,d(vec(x))dt=(dx1dt,dx2dt,dots,dxNdt).
is a hyperbolic tangent function defined as follows. For a scalar zinR,(z)=tanh(z)=ez-e-zez+e-z is the standard hyperbolic tangent. For a vector vec(x)=(x1,x2,dots,xN)inRN, is applied elementwise. In other words, (vec(x))=((x1),(x2),dots,(xN))inRN. Therefore, W(vec(x)) is a matrix-vector product.
Each element of the matrix W is drawn from a Gaussian distribution with mean 0 and standard deviation gN2. In Python, the matrix W can be generated by:
W=g?
umpy.N2* numpy.random.randn (N,N)
Each element of the initial condition vec(x)0inRN is drawn from a Gaussian distribution with mean 0 and standard deviation 1. In Python, the matrix vec(x)0 can be generated by:
x0= numpy.random.randn(N)
In the following problems, find numerical solutions of the ODE under different values of g, using the explicit Euler method with step size dt=0.1 and taking 500 steps. Choose N=100, i.e., vec(x) is a 100-dimensional vector.
(25 pts) Set up the numerical algorithm (using Euler's method) that find a numerical solution of the ODE.
(25 pts) Let g=1.0. Find the numerical solution vec(x)(t) of the ODE in the interval tin[0,50].(a) Plot the first 5 elements of vec(x)(t), i.e.,x1(t),dots,x5(t) and (b) describe the behavior of the solution in words.
(25 pts) Let g=2.0. Find the numerical solution vec(x)(t) of the ODE in the interval tin[0,50].(a) Plot the first 5 elements of vec(x)(t), i.e.,x1(t),dots,x5(t) and (b) describe the behavior of the solution in words. Note that the behavior of the solution when g=1.0 and g=2.0 are drastically different.
Problem 1 . [ 7 5 points ] Consider the following

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!