How to change integration variable ?
|
12-15-2019, 02:18 AM
(This post was last modified: 12-15-2019 02:22 AM by hamorabi.)
Post: #1
|
|||
|
|||
How to change integration variable ?
I'm trying to write a function that generates the general form of the Fourier series coefficients of a periodic waveform that is piece-wise defined.
This is the code I'm using at the moment. PHP Code: #cas For example, let's say the periodic waveform is defined as: x, from 0 to 1 1, from from 1 to 2 This is how it I can call the function: fseries([x,1],x,0,[1,2]) The problem I'm having is when it comes to passing the independent variable. I want to allow for flexibility in choosing any variable letter. At the moment, the code runs but it doesn't seem to recognize the variable letter (see first entry in attached image). Now, if I hard code the variable name in the code (change all var_x to x), it works fine (see second entry in attached image). I've tried different things such as defining the variable as a symbol, substituting, etc, but nothing seems to work. I'm a bit baffled at the moment. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)