Ask Your Question
1

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

asked 2022-11-08 06:51:44 +0200

c.p. gravatar image

updated 2022-11-08 06:58:00 +0200

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))
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
3

answered 2022-11-08 08:07:57 +0200

FrédéricC gravatar image
edit flag offensive delete link more

Comments

sorry...thanks

c.p. gravatar imagec.p. ( 2022-11-09 07:56:45 +0200 )edit
1

answered 2022-11-08 08:52:42 +0200

achrzesz gravatar image

updated 2022-11-09 15:29:37 +0200

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])
edit flag offensive delete link more

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: 2022-11-08 06:51:44 +0200

Seen: 291 times

Last updated: Nov 09 '22