TutorMe homepage
Subjects
PRICING
COURSES
Start Free Trial
Gowtham S.
It's Rocket Science that I am pursuing
Tutor Satisfaction Guarantee
MATLAB
TutorMe
Question:

How do you solve a quadratic equation using MATLAB? Discuss various possibilities? Assume a general quadratic function to be f(x) = a x^2 + b x + c

Gowtham S.

1. The 'solve' function can be used which returns both the solutions of a quadratic equation in an array. Please read the comments to know why that particular command is executed. eq = 'a * x^2 + b*x + c = 0'; % Equation declared soln = solve(eq); % Calling solve function and storing the results in 'soln' variable disp('The first root is: '), disp(soln(1)); disp('The second root is: '), disp(soln(2)); 2. The 'roots' command returns the root of the polynomial passed to it. You can find additional insights in the comments poly = [a b c]; soln = roots(poly); disp('The first root is: '), disp(soln(1)); disp('The second root is: '), disp(soln(2)); Both the method discussed above works well for simple problems. But when the computations are complex, it is better to use the 2nd option because it is a dedicated solver for polynomial roots, unlike a general 'solve' tool. It is also important to note that 'solve' command can be used with symbolic variables too. Yes, not just numbers, it can work well with the alphabets too.

C++ Programming
TutorMe
Question:

How do you read in only the last name of "John Smith" from a file or from the user-input?

Gowtham S.

I'll discuss various strategies that can be followed and I'll list down their efficiency too. 1. Typical answer, using 1 temporary variable for first name (Not memory efficient) scanf("%s %s", temp, last_name); 2. Another solution, but with 2 scanf() calls (memory efficient, but not time) scanf("%s", last_name); scanf("%s", last_name); 3. Tricky and efficient solution. If you want to skip some input use * sign after %. That is scanf("%*s %s", last_name); This 3rd solution would do the job efficiently. Good code should be a simpler one, doing the job in a straightforward way.

Aerospace Engineering
TutorMe
Question:

We tend to see the fluid flow accelerating when it passes through a convergent tube (you might have observed this while blocking the garden hose with your hand). But every single rocket employs a divergent nozzle (See for example: Atlas V rocket). Why is that so? Do we want the flow to slow down?

Gowtham S.

Yes, all the rocket nozzles diverge at the end. In garden hoses, the fluid flow is governed by the in-compressible phenomena. While in the case of the rockets, the plot changes totally. The theory of compressible flow suggests the usage of Convergent-Divergent nozzle to accelerate a compressible fluid. This is employed and what you see in the rockets is just the exit of the nozzle (a divergent section). Yeah! After all, it's rocket science.

Send a message explaining your
needs and Gowtham will reply soon.
Contact Gowtham
Ready now? Request a lesson.
Start Session
FAQs
What is a lesson?
A lesson is virtual lesson space on our platform where you and a tutor can communicate. You'll have the option to communicate using video/audio as well as text chat. You can also upload documents, edit papers in real time and use our cutting-edge virtual whiteboard.
How do I begin a lesson?
If the tutor is currently online, you can click the "Start Session" button above. If they are offline, you can always send them a message to schedule a lesson.
Who are TutorMe tutors?
Many of our tutors are current college students or recent graduates of top-tier universities like MIT, Harvard and USC. TutorMe has thousands of top-quality tutors available to work with you.