MatLab code for these Integrals.

Click For Summary

Discussion Overview

The discussion revolves around writing MATLAB code for evaluating specific integrals using the Monte Carlo method. Participants seek to clarify the challenges faced in coding these integrals and how to implement Monte Carlo simulations effectively.

Discussion Character

  • Homework-related
  • Technical explanation
  • Exploratory

Main Points Raised

  • One participant asks how to write MATLAB code for the integrals $$\iint e^{-(x^4+y^4)}\;\dx\dy$$ and $$\iint e^{-(x^4+y^4)}(x^2+y^2)x^2y^2e^{-2x^2y^2}\;\dx\dy$$.
  • Another participant questions what specific difficulties the original poster is encountering with MATLAB, suggesting that more information is needed to provide assistance.
  • A participant mentions the need to use the Monte Carlo method for their scientific research and expresses struggle with the integrals.
  • There is a suggestion to review resources on how MATLAB is typically used for Monte Carlo simulations, indicating that understanding the method is crucial for implementation.
  • One participant proposes that in a Monte Carlo simulation, evaluating a radius related to the integrals could be relevant, hinting at the relationship between the variables involved.

Areas of Agreement / Disagreement

The discussion does not present a consensus, as participants express varying levels of understanding and specific challenges related to MATLAB coding and the Monte Carlo method.

Contextual Notes

Participants have not fully articulated the specific problems they face with MATLAB, leaving some assumptions and details about their coding experience and knowledge of Monte Carlo methods unclear.

John Mark
Messages
3
Reaction score
0
How can I write proper language for these integrals in MatLab ?
Your helps really appreciated.



John Mark
 

Attachments

Physics news on Phys.org
Those integrals are:##\renewcommand{\dy}{\text{d}y} \renewcommand{\dx}{\text{d}x}##

1) $$\iint e^{-(x^4+y^4)}\;\dx\dy$$ 2) $$\iint e^{-(x^4+y^4)}(x^2+y^2)x^2y^2e^{-2x^2y^2}\;\dx\dy$$

What have you tried?
How would you normally handle integrals in matlab?
i.e. what's the trouble you are having here?

(Otherwise it just looks like a couple of homework problems.)
 
  • Like
Likes   Reactions: 1 person
I need to write the code of solutions by MonteCarlo method in MatLab for my scientific research. These are the integrals which I'm struggling with.
 
Have you had a look how MATLAB normally gets used to simulate monte-carlo?
http://www.mathworks.com/discovery/monte-carlo-simulation.html
http://www.columbia.edu/~mh2078/MCS04/MCS_overview.pdf
http://physics.gac.edu/~huber/envision/instruct/montecar.htm

How would you normally handle integrals in matlab?

Basically, I still don't know where your problem lies.
If you don't tell me, I cannot help you.

i.e. in a Monte Carlo sim, would want to evaluate a radius ... which is ##r^2=x^2+y^2## ?
Have you realized that ##(x^2+y^2)^2=x^4+y^4+2x^2y^2## ?
 

Similar threads

Replies
6
Views
4K
  • · Replies 4 ·
Replies
4
Views
4K
Replies
5
Views
3K
  • · Replies 32 ·
2
Replies
32
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K