0% found this document useful (0 votes)
15 views2 pages

Practice Problems-Week1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views2 pages

Practice Problems-Week1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

2 week1.

nb

Physics through Computational Thinking

Practice Problems: Week 1 (Submission not required)


1. Explore numerical function N [x].

(a) N calculates numerical value of any expression. Lets find out Pi and E (the Euler number e) to 10 digits by evaluating the following
commands.
NPi

NPi, 10

N[E, 10]
(b) Find Pi to 100 digits.

(c) Find 21/2 and 213 up to 16 digits.


2. Can you reproduce the plot below by figuring out the suitable Mathematica code (one line only). Reproduce also the plot styling that
is x-range, y-range, labeling, colors, line stroke, frame etc. You may need to look up documentation of the Plot function to be able to do
this. Its a good idea to start navigating into documentation and also learn how to make your figures look nicer. See if you can figure out
a few styling techniques on your own to make the figure look even better that what is presented here.
2

exp(-x)
f (x)

0
log(x)
cos(2 x)
-1

-2
0 1 2 3 4 5
x

3. Sketch the following functions, first on a piece of paper analyzing them for their zeros, divergences, extrema and asymptotes. Next
cross - check your sketch by plotting the function on Mathematica.
Hyperbolic functions:

1. cosh( x) 2. sinh( x) 3. tanh(x) 4. cosech(x) 5. sech(x) 6. coth(x).

1-x 1 1-x
7. ln x 8. ln(ln(x)) 9. ln(x) / x 10. ln(ex - 1) 11. ln  1+x  12. x
ln  1+x 

2
13. e-x cos( x) 14. e-x sin(x) 15. e- x cos(x) 16. e- x sin(x) 17. x e-x 18. x - 1 + e-x

x 1/ x + x, x + x,12 + x, 2
19. x 20. x 21. x 22. +x, 23. 24.
1++x,12 e x +1

1 -1
1
25. e x 26. e x2 27. x-12 - x-6 28. cosh-1 (x) 29. coth-1 (x) 30. coth (x) -
x
2
4. For a quadratic function given by y = a x + b x + c, where a > 0, find the equation of the minimum (xmin , ymin ) as a function of b.
Now rewrite ymin as a function of xmin . What is this function? Can you make a plot to show that the minima of the parabola
y = a x2 + b x + c lies on the curve ymin (xmin )? Use Manipulate to vary b and demonstrate that the minima always lies on this curve.
week1.nb 3
4. For a quadratic function given by y = a x2 + b x + c, where a > 0, find the equation of the minimum (xmin , ymin ) as a function of b.
Now rewrite ymin as a function of xmin . What is this function? Can you make a plot to show that the minima of the parabola
y = a x2 + b x + c lies on the curve ymin (xmin )? Use Manipulate to vary b and demonstrate that the minima always lies on this curve.
Hint: Try the following code. Can you figure what’s going on? Modify this code to manipulate a and c also.

- b2
ManipulatePlota x2 + b x + c, c - a x2 , + c /. {a → 2, b → b1, c → 4} // Evaluate,
4a
{x, - 2, 2}, Frame → True, PlotRange → {- 5, 10}, {b1, - 6, 6}

5. Find the point of intersection for curves y = log x and y = x13 up to three decimal accuracy. Hint: You can do this by hit and trial or
use a built in Mathematica function like NSolve.
6. Plot cosh(x) and its quadratic approximation at x = 0. Find the fractional deviation the quadratic approximation near x = 0 has with
y(x)-cosh(x)
respect to cosh(x) at x = 0.5 and x = 1, that is if y(x) represent quadratic approximation to cosh(x) near x = 0, then find  
cosh(x) x = 0.5
y(x)-cosh(x)
and   .
cosh(x) x =1.0

7. Electric field lines of a quadrupole: Plot the electric field lines and equipotential surfaces for the quadrupolar configuration: four
charges of same magnitude and alternating sign on the corners of a square of side a, that is, +q at (0, 0) and (a, a) while -q at (a, 0) and
(0, a). Use combination of StreamPlot and ContourPlot as shown in the lecture inside a Show function.
8. Magnetic field of a magnetic dipole: Magnetic field of a magnetic dipole is given by

 μ0 +m, 5 5
B(r) = 2 cos θ r + sin θ θ (1)
3
4πr

Plot the magnetic field lines in the x-z plane as vector plot, stream plot and stream density plot. [Hint: Convert the magnetic field to
Cartesian coordinates first.]

You might also like