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

Matlab integral

  1. Jan 9, 2012 #1
    I want to have a fast way (in Matlab) of computing the following integral:

    [tex] \int_0^z \cos(\theta(z))\ \mbox{d}z\ \forall z \in [0,1] [/tex]

    with [tex] \theta(z) = atan(z) + e^{\int_0^z \chi^2 +a^2\ \mbox{d}\chi} [/tex]

    I used an anomyous functions with a quad function to define the [itex] \theta [/itex] then I used a quadv to evalute the integral. Finally I used a for loop to get the integral for a list of discrete values for z in [0,1]. Of course this takes a lot of computation time, I think this has to do with the fact that quad is used in quadv. How can I make this a lot faster?
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?