ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 22 Nov 2020 23:49:14 +0100Plot ratio of Bessel functionshttps://ask.sagemath.org/question/54361/plot-ratio-of-bessel-functions/I am new to SageMath and to this page. I'm running this version:
`SageMath version 9.2, Release Date: 2020-10-24 Using Python 3.8.5.`
I tried to plot the ratio of two functions related to Bessel functions.
First I defined `f` as the first derivative of `bessel_J(1, x)`
and `g`as `x*bessel_J(1, x)`:
f(x) = bessel_J(1, x)
g = derivative(f, x)
Then I defined `h` as their ratio:
h = g / (x*f)
Then, I tried to plot `h` with:
plot(h, (x, 0, 10))
The result is an empty plot, showing only the x, y axes, and this is not correct.
Am I doing something wrong? Is it possible to plot such a function and, if yes, how?wmaddoxSun, 22 Nov 2020 23:49:14 +0100https://ask.sagemath.org/question/54361/connecting plots by lineshttps://ask.sagemath.org/question/38845/connecting-plots-by-lines/There are 2 plots in a graphics_array (e.g. sin and cos). How do I "connect" these plots with connecting lines (e.g. a dashed line at angle=pi)?Chris_Mon, 18 Sep 2017 15:21:55 +0200https://ask.sagemath.org/question/38845/How do I plot a function undefined in some areas?https://ask.sagemath.org/question/34850/how-do-i-plot-a-function-undefined-in-some-areas/ I am trying to plot `f(x,z)` which is undefined in some areas. When I try to plot some other function, I can get it to work easily because Sage restricts the plot to the area where the function is real. E.g.:
plot3d(sqrt(1-x^2-y^2), (x,-5,5), (y,-5,5))
The border is a bit weird, but it works. I cannot get a working plot with my code, however. I also tried to wrap the function with a `try ... except` statement but I don't know what to return:
var("x y z")
def wrap(exp, a, b):
try:
return exp(x=a, z=b)
except ValueError:
return None
plot3d(lambda x,y: wrap(f, x, y), (x, -t, t), (y, -t, t)).show(aspect_ratio=1)
My function is `f` and it contains variables `x` and `z`.LazzaSun, 18 Sep 2016 22:02:42 +0200https://ask.sagemath.org/question/34850/