Ask Your Question

sagemb's profile - activity

2018-01-29 16:19:21 +0100 received badge  Taxonomist
2017-09-04 22:30:58 +0100 received badge  Popular Question (source)
2016-09-05 04:16:48 +0100 received badge  Famous Question (source)
2016-01-09 21:43:00 +0100 received badge  Popular Question (source)
2013-12-25 16:07:47 +0100 received badge  Notable Question (source)
2013-06-21 10:47:38 +0100 received badge  Popular Question (source)
2012-05-07 10:43:17 +0100 answered a question contour plot not working as expected

Oh, I see. Thank you very much!

BR M

2012-05-07 04:34:12 +0100 asked a question contour plot not working as expected

Hi all,

I am looking at ways to determine the sign of an angle between a reference vector (a,b) and any other vector(x,y) of the plane. To do so, I have decided to use the determinant of the matrix: [[a b],[x y]] which equals ax-by. I wanted then to check that the formula works by displaying the plane area which positive and negative signs using the contour_plot.

Here is my question:

Why is the 3rd graph not showing 2 horizontal areas instead of the vertical displayed?

var('x y')
f(x,y,a,b)=(a*y-b*x)/abs(a*y-b*x)
plota1b1=contour_plot(f(x,y,1,1),(-10,10),(-10,10),cmap='jet',colorbar=true)
plota0b1=contour_plot(f(x,y,0,1),(-10,10),(-10,10),cmap='jet',colorbar=true)
plota1b0=contour_plot(f(x,y,1,0),(-10,10),(-10,10),cmap='jet',colorbar=true)
show(plota1b1)
show(plota0b1)
show(plota1b0)

Thanks

2012-04-24 15:25:47 +0100 asked a question Recursive max_symbolic???

Hi

Over a (x,y) space, I have n functions resp f_1(x,y), f_2(x,y), ..., f_n(x,y) and I would like to create g(x,y) =max(f_1(x,y), f_2(x,y), ..., f_n(x,y), constant)

I now know it is possible to use max_symbolic with 2 functions, but then if I have say 100 of them, it gets clumpsy.

Does anyone know a way to do that?

Thanks

2012-04-20 10:59:08 +0100 asked a question Function value at parametric path

Hi,

How can I get the value of a 2D function, say f(x,y)=x^3+y^3, along the path determined by a parametric function, say M(x(t)=cos(t),y(t)=sint(t))?

2012-04-19 15:52:55 +0100 asked a question min(f,g) where f and g take two variables

Hi

Is it possible to create a function h(x,y) that would be the minimum (or maximum) of any two other 2-variable functions?

Like h(x,y)=max(f(x,y),g(x,y))? (this does not work)

This seems to be a rather useful function but I can't seem to find it.

any ideas?

Thanks N.

2012-04-18 05:39:09 +0100 answered a question Defining a function and forcing max or min value

Yes, that's what I wanted to achieve. Thank you very much!

It also works with 2 functions, which is what I needed in the end.

Thanks again

f(x)=cos(x)

g(x)=sin(x)

h(x)=max_symbolic(f(x),g(x))

a=plot(f,-pi,pi)

b=plot(g,-pi,pi,color='green')

c=plot(h,-pi,pi,color='red')

show(a+b+c)

2012-04-17 13:16:36 +0100 received badge  Student (source)
2012-04-17 09:09:01 +0100 received badge  Editor (source)
2012-04-17 09:08:11 +0100 asked a question Defining a function and forcing max or min value

Hi,

Is it possible to define a funtion, say f, and have it be the maximum (or minimum) of another function and a constant?

Example (pseudo-script): if g(x)=log(abs(x)), let f(x)=g(x) if g(x)>0, and f(x)=0 for all g(x)<0

Thanks N.C.