Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need answer's for these questions in matlab If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there

need answer's for these questions in matlab

image text in transcribed

If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total. Write a function called number2letters that returns the number of letters needed to write down the number n in words. For example, 342 (three hundred forty two) contains 20 letters. Notice that we do not count spaces, nor do we use hyphens. The only input to the function is n, a positive integer smaller than 1000, but you do not need to check this. (Inspired by Project Euler.) Write a function called circular_primes that finds the number of circular prim numbers smaller than n, where n is a positive integer scalar input argument. For example, the number, 197, is a circular prime because all rotations of its digits: 197, 971, and 719, are themselves prim there are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97. It is important to emphasize that rotation means circular permutation not all possible permutations. Write function that is called like this [E, N] = cyclotron(V). All arguments are scalars. The input argument is the voltage applied to a cyclotron (figure), which is a device that accelerates subatomic particles-n this case, positively charged isotopes of hydrogen, called "deuterons" -which spiral outward in a clockwise direction. The cyclotron rapidly alternates the sign of the voltage difference V in units of volts between two "D" -shaped vacuum chambers (blue outlines), which are placed within a strong uniform magnetic field (not shown but perpendicular to the page). The deuteron is accelerated on as it is leaving one "D" and entering the other. While the deuteron is inside a given "D it moves at a constant speed, and the magnetic field causes it to move a semicircle. Each deuteron moves as follows (check the numbers in the figure): (1) It originates from a source (red dot) located at a distance s_0 to the left of the center of the s accelerated vertically into the upper "D" and then moves on a semi-circle of radius r_1. (2) It leaves the upper "D" and is accelerated vertically downward into the lower "D" where moves with a larger radius r_2. (3) It leaves the lower "D" and is accelerated vertically into the upper "D", etc, moving with eve r increasing radii r_n until (N) it is accelerated for the final time as it eaves the upper "D" and enters the lower "D", follows a semicircle of radius r_N, and emerges from the cyclotron at the left. The formulas for the radii are as follows: r_1 = squareroot mV/(qB^2), m = deuteron mass = 3.344 times 10^-27 kg, q = deuteron charge = 1.603 times 10^-19 coulomb, and B = magnetic field strength = 1.600 tesla. For greaterthanorequalto 2, r_n = squareroot r_n-1^2 + 2mV/(qB^2). These expressions give the radii in units of meters, and s_0 = r_1/2. The deuteron escapes through a window at the left that is placed so the particle cannot leave u t is more than 0.500 m to the left of the center of the cyclotron. The gap between the "D"s is exaggerated in the figure, has no effect, and can be assumed to be of zero width. The function returns energy E of the deuteron when it escapes in units of million electron volts (MeV), which equals VN times 10^-6, and the number N of times the deuteron enters the "D"s. Here is a sample run: >> [E, N] = cyclotron (4.8e5) % depicted in figure E = 16.32 N = 34

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions

Question

Be optimistic and enthusiastic.

Answered: 1 week ago