Solving a Physics Problem with Mathematica: Get Help Now!

  • Thread starter Thread starter Saptarshi Sarkar
  • Start date Start date
  • Tags Tags
    Mathematica Physics
Click For Summary
SUMMARY

The forum discussion centers on troubleshooting a Mathematica code for plotting the trajectory of a projectile. The user is experiencing issues with the output plot, which appears distorted. The provided Mathematica code utilizes the Manipulate and Plot functions to visualize the trajectory based on parameters such as velocity (v), launch angle (\[CapitalPhi]), and height (h). A suggestion is made to simplify the equation by correctly handling the terms (x - L)^2 and (y - h) to achieve a clearer representation of the trajectory.

PREREQUISITES
  • Familiarity with Mathematica 12.3 syntax and functions
  • Understanding of projectile motion equations
  • Knowledge of the Manipulate and Plot functions in Mathematica
  • Basic concepts of non-dimensionalization in physics
NEXT STEPS
  • Review the Mathematica documentation for the Manipulate function
  • Study projectile motion equations and their graphical representations
  • Learn about simplifying equations in Mathematica for better clarity
  • Explore non-dimensionalization techniques in physics problems
USEFUL FOR

This discussion is beneficial for physics students, educators, and anyone using Mathematica for modeling projectile motion and seeking to improve their coding and plotting skills.

Saptarshi Sarkar
Messages
98
Reaction score
13
Homework Statement
Consider the situation demonstrated in the image below. A man standing a distance L away from the cliff throws a ball with speed v at an angle ϕ with the vertical. Height of the cliff is H and its slope makes an angle θ with the horizontal.

After laying down a suitable coordinate system

(a) Find the equation of the trajectory of the ball.
(b) Find the equation of the slope of the hill.
(c) Non-dimensionalize both the equations. How many free parameters are left in the problem?
(d) Construct a Manipulate command by varying all the free parameters in a suitable range. Play with parameters to find out in what cases you have ball land somewhere on the slope. What is the condition for which ball will hit the edge of the cliff (top of the cliff).
(e) Validate your observations in part (d) by doing algebraic calculations.
Relevant Equations
##y_{ball}=ax^2+bx+c##
##y_{cliff}=dx+e##
The question is

1583419886608.png


I have tried solving this problem several times over several days but each time the plot I get gets weird. Can someone please check what I did wrong?

My attempt is attached below (I did not non-dimensionalize it as I wanted to first check if my code works)

Attempt 1.jpg


Attempt 2.jpg


The Mathematica code I wrote is

Manipulate[Plot[{((-9.8 x^2)/(2 (v Sin [\[CapitalPhi]])^2)) + Cot[\[CapitalPhi]] x - ((9.8 L*x)/(v Sin [\[CapitalPhi]])^2) + h - ((9.8 L)^2)/(2 (v Sin [\[CapitalPhi]])^2) + L Cot[\[CapitalPhi]], -x Tan[\[CapitalTheta]] + H}, {x, -10, 10}, PlotRange -> {0, 20}], {v, 1, 10}, {\[CapitalPhi], 0.001, Pi/2}, {L,0, 10}, {h, 0, 10}, {H, 0, 10}, {\[CapitalTheta], 0, Pi/2}]

Please Help!

You can get the lecture notes here, which contains a similar solved example on page 5.

 
Physics news on Phys.org
I would find the equation of the trajectory of the ball with its launch point as the origin. That must be simplest. You can always change the origin afterwards.

It looks like that's what you have but you've expanded ##(x - L)^2## and ##(y-h)##. If you sort that out then your equation should simplify.
 
  • Informative
Likes   Reactions: Saptarshi Sarkar

Similar threads

  • · Replies 11 ·
Replies
11
Views
3K
Replies
18
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 16 ·
Replies
16
Views
1K
Replies
2
Views
1K
Replies
28
Views
2K
  • · Replies 19 ·
Replies
19
Views
2K
Replies
8
Views
1K
Replies
11
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K