Jan-18-2021, 03:30 PM
(This post was last modified: Jan-18-2021, 03:30 PM by edwinostby.)
(Jan-18-2021, 03:00 PM)jefsummers Wrote: Several issues.
In line 4 you define a function with 2 arguments but in line 19 you call it with one. The function does not use the second argument, so eliminating that would help. However, in line 5 you make a call to a function called f that is not defined.
Thanks for the reply!
I am struggling to use Euler's method to solve this equation "f'(t) = 4 + 3 *f(t)". As in line 4, i tried to do this;
def derived_f(t, ft): return(4 + 3 *ft)And then back in line 19 add this:
derived_f(f[t])
into the call function making it look like this;
f[i + 1] = f[i] + derived_f(t[i]) + derived_f(f[t]) * hBut i am still getting the same error:
Error:f[i + 1] = f[i] + derived_f(t[i]) + derived_f(f[t]) * h
TypeError: derived_f() missing 1 required positional argument: 'ft'
Really new at python so I might be missing something obvious here, but how should i add the argument 'ft' to remove the error in the code?Thanks in advance!