Skip to content

If your plots are straight lines at 2 meters for every method in problem 3 #20

Open
aaf14002 opened this issue Mar 27, 2020 · 1 comment

Comments

@aaf14002
Copy link

This is not an issue I currently have because I was able to correct it, but I know other students have had the same issue so I thought I would post about it in case someone else had the same problem. My initial plots for every converging method was just a horizontal line at the initial position of two meters. This was because I had missed a set of brackets in my smd function specifically in this line.

derivs = np.array([state[1],-zeta*w*state[1]-(w**2)*state[0]])

I originally didn't include the set of brackets after the first set of parenthesis, and this caused my function to not be able to run properly, since the values were not properly stored in an array. I also found it helpful to have a different for loop for every convergence method in problem 3.

for i in range(N_euler-1):
num_euler[i+1] = eulerstep(num_euler[i], smd, dt_euler)
print(i)

Like this but for every method. Finally, it is worth noting that if you have a problem that is identical for every one of your methods. Then the issue is likely in your smd function, but that is one of the few pieces of code that affects all of your methods.

@rcc02007
Copy link
Owner

rcc02007 commented Apr 8, 2020

Thanks @aaf14002 !

Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants