0

Homework physics help

This is actually a physics assignment simulating a throw. Can someone please help me to plot a function based on the solution of the equation? I want to plot a function where the 'y' symbol is the variable. Please ask questions if u don't understand my problem. import sympy as sp import matplotlib.pyplot as plt import numpy as np from scipy import constants as constant x = sp.Symbol('x') t = sp.Symbol('t') y = sp.Symbol('y') y0 = 2.0 x0 = 0 v0 = 20 v0x = v0*np.sin(30) v0y = v0*np.cos(30) ax = 0 ay = -(constant.g) eq1 = sp.Eq(0.5*ax*t**2 + v0x*t + x0,x) eq2 = sp.Eq(0.5*ay*t**2 + v0y*t + y0,y) solve = sp.solve((eq1,eq2), (x, t))

28th Sep 2022, 1:21 PM
mariusep
3 odpowiedzi
+ 1
I found that the result of your equation is a 2d list with each element being a function of y. You can use sympy.plotting to generate subplots for each equation and combine them to a single plot like this. Maybe there is an easier way, but I am not an expert :) https://code.sololearn.com/c61vJw2tYyx0/?ref=app
28th Sep 2022, 6:13 PM
Tibor Santa
Tibor Santa - avatar
0
I think, It looks like you’re working on projectile motion — nice start! You’ve defined the equations correctly for horizontal and vertical motion. Since you want to plot y as a function of x, you’ll first need to eliminate t (time) from your equations. You can do this by solving the first equation for t, then substituting that result into the second equation. After substitution, you’ll get an expression for y(x) that you can turn into a numerical function using lambdify for plotting. Get expert physics assignment help at Studyunicorn.com from real professionals. We provide accurate solutions, clear explanations, and timely support to boost your grades and understanding. Trusted by students worldwide. https://www.studyunicorn.com/physics-homework-help
30th Oct 2025, 7:14 AM
Sophia Robart
Sophia Robart - avatar