Purchase Solution

Math and Computational physics programming in MATLAB

Not what you're looking for?

Ask Custom Question

MATLAB - - Must be programmed and scripted as MATLAB file.

Please return with attached .m file.

See attached file for full problem description.

Purchase this Solution

Solution Summary

The expert examines math and computational physics programming in MATLAB.

Solution Preview

Here are two Matlab script files attached.

balle.m answers question 1 and it is essentially your original file with modifications in just a few lines:
"
max_range_interp1 = interp1(yplot(istep-1:istep+1),xplot(istep-1:istep+1), 0, 'spline') ;
time_flight_interp1 = tau * interp1(yplot(istep-1:istep+1),[istep-2:istep], 0, 'spline') ;
fprintf('Maximum range is %g metersn', max_range_interp1);
fprintf('Time of flight is %g secondsn', time_flight_interp1);
max_range_improvement = max_range_interp1 - r(1)
time_flight_improvement = time_flight_interp1 - istep*tau
"

balle2.m is modified significantly more, to answer just question 2
In the 2nd script, I have discarded the cumbersome interactive input (if you want to modify parameters, you do it directly in the script).
The result is that the smaller ball is 2.6 meters = 103 inches behind the larger ball when the larger ball hots the ground, which is indeed much more than the 2 inches claimed by Galileo.
I have also changed some notations for easier traceability.

Other explanations are in the comments.

I have explained all the essentials, however if you feel you need more explanations you can ask your questions in the feedback.

Finally, as requested by Brainmasss, I past the texts of the two files below, however you do not need these texts as you have the uploaded files balle.m and balle2.m

=================
Here are the pasted texts:
=================
function balle()

% balle - Program to compute the trajectory of a baseball
% using the Euler method.
clear; help balle; % Clear memory and print header

%* Set initial ...

Purchase this Solution


Free BrainMass Quizzes
The Moon

Test your knowledge of moon phases and movement.

Intro to the Physics Waves

Some short-answer questions involving the basic vocabulary of string, sound, and water waves.

Introduction to Nanotechnology/Nanomaterials

This quiz is for any area of science. Test yourself to see what knowledge of nanotechnology you have. This content will also make you familiar with basic concepts of nanotechnology.

Basic Physics

This quiz will test your knowledge about basic Physics.

Classical Mechanics

This quiz is designed to test and improve your knowledge on Classical Mechanics.