MAT 128C University of Nairobi MATLAB Codes Problems Homework

Please write clearly logic solution for all the 4 problems. and the hand writing should be good. the final 2 question need to be typed based on C or C++ programs.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

DATE:
MAT128C, homework set #1.
DUE:
April 12, 2020
April 22, 2020
Attached sample code is a very primitive solution to an explicit Euler method applied to
a simple, normalized first order differential equation. Please review, follow the instructions,
and see that it works. The code, as written, solves
NOT FOR DISTRIBUTION
ẏ = −κ sin y + η
y(0) = 0.4
(1)
where κ = 1 and η = 1.1. The time interval is 0 ≤ t ≤ 100 with n dt = 100, 000 time
steps. Output of the function y n as a function of tn is in the code-generated file ”Dat” as
columns two and three.
0. A weak-link Josephson junction in superconducting electronics can be described by the
following equation
h̄ dϕ
= I − Ic sin ϕ
2eR dt
where h̄ = h/2π, h being Planck’s constant, e is the proton charge, and R is the
Ohmic resistance of the junction (R = 50Ω). The critical super-current of the junction is Ic = 1µA, and the applied current through the system is I. The voltage across
h̄ dϕ
the junction is V = 2e
, where ϕ is the quantum mechanical phase difference bedt
tween the two superconductors defining the junction.
Normalize this equation to put it in the form of (1) above (with κ = 1), and determine
the characteristic time scale.
1. Validate numerically the stability range for the (linearized, homogeneous) problem by
simulating the system in the a) stable and reasonable regime, b) stable and unreasonable regime, and finally c) the unstable regime. Show representative plots (generated
with MatLab, gnuplot, or something else reasonable), to visualize your results.
Show the comparable results for the original, nonlinear and inhomogeneous problem
with same parameters.
2. Validate the accuracy of the method by assessing the global error at, e.g., tN = 100 for
different time steps. Show that the global error scales as you would expect it to scale
for the Euler method. Which time step would you choose if your tolerance on the
global error is |y N − y(tN )| < 10−5 ? How is that result different if you choose η = 2.5, η = 0.3? 3. Copy the sample code, and revise the copy to solve the same problem with a RungeKutta method, RK2 using fractional predictor time step c = 1. Answer questions 1 and 2 above for this method. 4. Copy the sample code, and revise the copy to solve the same problem with a RungeKutta method, RK2 using fractional predictor time step c = 21 . Answer questions 1 and 2 above for this method. 5. Plot the physical super-current Ic sin ϕ against the physical time for the parameters given at the top of the problem set. c 2020 | N IELS G RØNBECH -J ENSEN | U NIVERSITY OF C ALIFORNIA | D AVIS , C ALIFORNIA 95616 COPYRIGHT: NIELS GRONBECH-JENSEN, UC DAVIS, 2018

Are you stuck with your online class?
Get help from our team of writers!

Order your essay today and save 20% with the discount code RAPID