Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

5
Second Order ODE - initial value problem
Post Body

I am working on a problem involving a car following another car. The leading car decelerates at a rate of 3 mi/s^2 until it comes to a complete stop. To save time from writing everything, I just included the variables down below.

The given 2nd order ODE is:

(x_fc - x_lc)* (d^2x_fc/dt^2) k* (dx_fc/dt) - k*v_lc = 0

dx_fc/dt = v_fc = v_fco

x_fc(t=0) = x_fco

# leading car, lc

# following car, fc

# initial speed, mph

v_lc = 30

v_fc = 30

# deceleration of lc

da_lc = -3 #mi/s^2

v_lc = 0

# sensitivity constant, k (mph)

k = 17

# length of car, l (ft)

l = 15

# distance from front of leading to front of following, d (ft)

d = 500

# average length of car, x (ft)

x_lc = 15

x_fc = 15

def dxfc_dt(t,y):

x_fc = y[0]

v_fc = y[1]

return [v_fc,k*(v_lc - v_fc)/(x_fc - x_lc)]

time = np.linspace(0,500,100)

z2 = solve_ivp(dxfc_dt,[0,0],time)

I believe I am on the right track but am confused with how to include some of the variables into the code. How do I include the distance between the cars, their average length, and the lead car's deceleration rate?

Author
Account Strength
90%
Account Age
7 years
Verified Email
Yes
Verified Flair
No
Total Karma
1,057
Link Karma
222
Comment Karma
810
Profile updated: 3 days ago
Posts updated: 6 days ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
3 years ago