I am a beginner using Mathematica. I am doing a physics experiment that involves this 3D surface; the function $ f(x, y) $. I need a program that can give me the contour level in the $ z $-axis which encloses an area that I specify.
So far I have managed to create an algorithm that can accept a contour level and then output the area that it encloses:
Here is the code: (credits to Kuba :Area between Contours in ContourPlot)
f[x_, y_] :=
1/0.005*2.86*10^(-5)*
Sin[Pi/2 -
ArcTan[(0.04367/35)*((Sin[2*Pi*35*y])^2)*2*(Pi/0.00763)*
Cos[2*(Pi/0.00763)*x]]]*(2*
Pi*35*(0.04367/35)*((Sin[2*Pi*35*y])^2)*Sin[2*(Pi/0.00763)*x]*
Cos[2*Pi*35*
y] + (2*9.81*(0.023 -
2*1.9*10^(-3) - (0.04367/35)*((Sin[2*Pi*35*y])^2)*
Sin[2*Pi/0.00763*x]))^0.5)
plot = RegionPlot[0.0036 <= f[x, y], {x, 0, 0.007632}, {y, 0, 1/35},
PlotPoints -> 100]
poly = Cases[Normal@plot, Polygon[n_] :> n, \[Infinity]]
Graphics`Mesh`MeshInit[];
PolygonArea /@ poly // Total
The value 0.0036
, seen in RegionPlot
, is the contour level in this case. And the program outputs an area value of 0.0000394488
when I run it. But how do I specify an area value and then get the contour level out of the program?
This is for my school project which is due soon; any help is immensely appreciated!!!
Mesh
MeshInit[]; PolygonArea /@ poly // Total FindRoot[area[0.000039], {x = 0}] $\endgroup$