Approximate Integral with Euler's Method in Matlab

  • MATLAB
  • Thread starter John31
  • Start date
  • Tags
    Integration
In summary, The conversation is about using Euler's method in Matlab to approximate a complex integral. The function used for the approximation does not require an analytical derivative, but help is needed in understanding the argument being presented. The person has already written an m-file for Euler's method and is unsure how to incorporate it for this specific equation with only one variable.
  • #1
John31
5
0
I have a very complex integral I am trying to approximate the integral with in Matlab using Euler's method.

I derived the following function from the original so I do not need an analytical derivative, I just need some help deciphering the argument that is being presented.
Code:
dydx=@(Isp) 2943./100000./(2-1./12500000*(Isp-5000).^2)-2943./100000.*Isp./(2-1/12500000.*(Isp-5000).^2).^2.*(-1./6250000.*Isp+1./1250)-70000000000/981./Isp.^2.*exp(-1400000/981./Isp)

I have already written an m-file for Euler's method and the function labels are as follows:

Code:
[t,y] = eulode(dydt, tspan, y0, h,)
tspan= [ti,tf] where ti and tf = initial and final values of independent variables
y0=initial value of dependent variable
h= step size
However since the equation I want to integrate only has one variable I am a little confused on how to incorporate Euler's method.
 
Physics news on Phys.org
  • #2
Well, if your Euler m-file behaves like ode45, you should just be able set some interval t, set your initial conditions, step size, and call the function.
 

1. What is Euler's Method and how does it work?

Euler's Method is a numerical method used to approximate solutions to differential equations. It works by breaking down the problem into smaller steps and using linear approximations to estimate the solution at each step.

2. How is Euler's Method used to calculate approximate integrals in Matlab?

Euler's Method can be used to calculate approximate integrals in Matlab by first converting the integral into a differential equation, then applying the method to approximate the solution at each step.

3. What are the advantages and disadvantages of using Euler's Method for approximate integration?

One advantage of using Euler's Method for approximate integration is that it is relatively simple to implement and understand. However, it may not always provide accurate results and can be computationally intensive for complex integrals.

4. How can the accuracy of Euler's Method for approximate integration be improved?

The accuracy of Euler's Method can be improved by decreasing the step size, using a higher order method such as the Runge-Kutta method, or by using adaptive step sizes that adjust according to the error at each step.

5. Are there any limitations to using Euler's Method for approximate integration?

Yes, there are limitations to using Euler's Method for approximate integration. It may not always provide accurate results, especially for complex integrals or those with rapidly changing functions. It also relies on a fixed step size, which may not be suitable for all problems.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
998
  • Advanced Physics Homework Help
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
3K
Replies
7
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Introductory Physics Homework Help
Replies
5
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • Programming and Computer Science
Replies
1
Views
750
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
6K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
Back
Top