Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

MatLab code for these Integrals.

  1. Jan 31, 2014 #1
    How can I write proper language for these integrals in MatLab ?
    Your helps really appreciated.

    Best,

    John Mark
     

    Attached Files:

  2. jcsd
  3. Jan 31, 2014 #2

    Simon Bridge

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    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.)
     
  4. Feb 1, 2014 #3
    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.
     
  5. Feb 1, 2014 #4

    Simon Bridge

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    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## ?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook