First time here? Check out the FAQ!

Ask Your Question
1

Use of min(x,y) in plot3d, integrals, etc.

asked 2 years ago

c.p. gravatar image

updated 2 years ago

Is there a way to get for the function `min(x,...,y)' the following?

  1. a plot3d? (in the case of two arguments)
  2. integrals?
  3. at least, numerical integrals?

It's likely my bad syntax the culprit, but here is my MWE:

var('x,y,z') 
plot3d(min(y,x),(x,0,1),(y,0,1)) #not the right plot
integrate(integrate(integrate(min(y,x,z),(x,0,1)),(y,0,1)),(z,0,1)) # this integrates f(x)=x
numerical_integral(numerical_integral(numerical_integral(min(y,x,z),(x,0,1)),(y,0,1)),(z,0,1))
Preview: (hide)

2 Answers

Sort by » oldest newest most voted
3

answered 2 years ago

FrédéricC gravatar image
Preview: (hide)
link

Comments

sorry...thanks

c.p. gravatar imagec.p. ( 2 years ago )
1

answered 2 years ago

achrzesz gravatar image

updated 2 years ago

var('x,y,z') 
plot3d(lambda x,y :min(y,x),(x,0,1),(y,0,1))

gives a reasonable plot (if you rotate the plot manually).

Numerical integration with mpmath:

from mpmath import *
mp.dps = 15; mp.pretty = True
f = lambda x,y,z: min(x,y,z)
quad(f,[0,1],[0,1],[0,1])
Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2 years ago

Seen: 371 times

Last updated: Nov 09 '22