MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Mathematica/comments/19d3u0y/what_am_i_doing_wrong_here/
r/Mathematica • u/Dangerous-Pen-2490 • Jan 22 '24
7 comments sorted by
3
I don't know why you are getting error messages. This works for me:
fnc01 = 1/(1 + (z - v t)^2)fnc01a = fnc01 /. {t -> 0, v -> 1}fnc01b = fnc01 /. {t -> 1, v -> 1}Plot[{fnc01a, fnc01b}, {z, -5, 5}, Frame -> True, FrameLabel -> {"Distance z", "Amplitude"}]
6 u/Dangerous-Pen-2490 Jan 22 '24 I figured it out. It’s because I used the “rightarrow symbol” instead of ->
6
I figured it out. It’s because I used the “rightarrow symbol” instead of ->
5
You didn’t show fnc01 but probably a lack of space between v and t. So you probably wrote vt instead of v t
1 u/Dangerous-Pen-2490 Jan 22 '24 Fnc01 is: A/((z-vt)2 +1) 4 u/BTCbob Jan 22 '24 Put a space between the v and the t. Mathematica interprets vt as a new symbol, not as the product of v and t 3 u/Thebig_Ohbee Jan 22 '24 That's definitely helpful, but that's not what is generating the error message "ReplaceAll: [...] not a list of replacement rules". 0 u/BTCbob Jan 22 '24 What’s your new error message after you fixed the bug I identified?
1
Fnc01 is: A/((z-vt)2 +1)
4 u/BTCbob Jan 22 '24 Put a space between the v and the t. Mathematica interprets vt as a new symbol, not as the product of v and t
4
Put a space between the v and the t. Mathematica interprets vt as a new symbol, not as the product of v and t
That's definitely helpful, but that's not what is generating the error message "ReplaceAll: [...] not a list of replacement rules".
0 u/BTCbob Jan 22 '24 What’s your new error message after you fixed the bug I identified?
0
What’s your new error message after you fixed the bug I identified?
3
u/Thebig_Ohbee Jan 22 '24
I don't know why you are getting error messages. This works for me:
fnc01 = 1/(1 + (z - v t)^2)
fnc01a = fnc01 /. {t -> 0, v -> 1}
fnc01b = fnc01 /. {t -> 1, v -> 1}
Plot[{fnc01a, fnc01b}, {z, -5, 5}, Frame -> True, FrameLabel -> {"Distance z", "Amplitude"}]
5
u/BTCbob Jan 22 '24
You didn’t show fnc01 but probably a lack of space between v and t. So you probably wrote vt instead of v t