Mathematica: draw a double integral

In summary, the conversation is about writing a MATLAB m-file to draw a double integral with variables located in the bounds of the integral. The desired integral is given as ∫∫_Ω Φhat (x, y) dA, where Ω = {(x, y): 0 ≤ x ≤ h cos(θ)/sin(θ), 0 ≤ y ≤ |h cos(θ)|}, and Φhat(x, y) = (θ − pi/2)/sin(θ)^4 * h * [|h cos(θ)|x cos(θ) − y sin(θ) − (cos(θ)^2 / sin(θ)) (x sin(θ) + y cos(
  • #1
matinking
17
0
I've written a MATLAB m-file to draw a double integral as below.My problem is how to draw a double integral when the variables are located in the bounds of the integral not under its operator!
m-file:
tetha = pi/4;
lamb = -1;
h = 4;
tetha0 = 0;
syms x y l

n = [h.*((cos(tetha)).^2)./sin(tetha); h.*abs(cos(tetha)); 0];
ft = ((tetha - pi/2)./sin(tetha)).^4;
Rt = [cos(tetha) -sin(tetha); sin(tetha) cos(tetha)];
zt = [cos(tetha0) -sin(tetha0); sin(tetha0) cos(tetha0)];
lt = [x;y];

integrand = @(x,y)(ft.*h.*((abs(cos(tetha)).* (x.*cos(tetha)-y.*sin(tetha)))-((cos(tetha)).^2/sin(tetha)).*(x.*sin(tetha)+y.*cos(tetha))));
PhiHat = @(a,b)(dblquad(integrand,0,a,0,b));
ezsurfc(PhiHat,[0,5,0,5])
 
Physics news on Phys.org
  • #2
hold onplot3(lt(1),lt(2),lamb.*h.*(abs(cos(tetha))-((cos(tetha)).^2/sin(tetha))),'o','MarkerSize',5,'MarkerFaceColor','k')set(gca,'xlim',[0 5],'ylim',[0 5])</code>The desired integral is as below:∫∫_Ω Φhat (x, y) dAwhere: Ω = {(x, y): 0 ≤ x ≤ h cos(θ)/sin(θ), 0 ≤ y ≤ |h cos(θ)|,Φhat(x, y) = (θ − pi/2)/sin(θ)^4 * h * [|h cos(θ)|x cos(θ) − y sin(θ) − (cos(θ)^2 / sin(θ)) (x sin(θ) + y cos(θ))]Thanks.
 

1. What is Mathematica?

Mathematica is a computational software program used for mathematical, scientific, and engineering calculations. It also has data analysis, visualization, and programming capabilities.

2. How do I draw a double integral in Mathematica?

To draw a double integral in Mathematica, you can use the Integrate function with multiple variables, followed by the RegionPlot or ContourPlot functions to visualize the result. Alternatively, you can use the NIntegrate function for numerical integration.

3. Can I customize the appearance of the double integral plot?

Yes, you can customize the appearance of the double integral plot by using various options such as color, style, axes labels, and more in the RegionPlot or ContourPlot functions. You can also use the PlotLegends function to add a legend to the plot.

4. How do I change the limits of the double integral in Mathematica?

To change the limits of the double integral, you can use the PlotRange option in the RegionPlot or ContourPlot functions. You can also specify the limits directly in the Integrate function.

5. Is there a way to include multiple functions in a double integral plot?

Yes, you can include multiple functions in a double integral plot by using the Show function. First, plot the individual functions using the RegionPlot or ContourPlot functions, and then use the Show function to combine them into one plot.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
898
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
572
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
696
  • Calculus and Beyond Homework Help
Replies
5
Views
687
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
953
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
493
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
Back
Top