필터 지우기
필터 지우기

Matlab Integration

조회 수: 3 (최근 30일)
John
John 2011년 4월 20일
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.
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:
[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.

답변 (3개)

Mike Hosea
Mike Hosea 2011년 4월 20일
If you have an ODE of the form dy/dt = f(y) then you just need to do something like
[t,y] = eulode(@(t,y)f(y),tspan,y0,h)
-- Mike

John D'Errico
John D'Errico 2011년 4월 20일
Since Euler is generally a fairly poor method for anyone to use beyond a homework assignment, why are you not using one of the well written existing ODE tools to solve an ODE? Everyone already has them in MATLAB. Start by reading the help, perhaps for ode45.
doc ode45

Walter Roberson
Walter Roberson 2011년 4월 20일
I am confused about whether you are trying to integrate or differentiate?
Your dydx has singularities at Isp=0 and Isp=10000 and has minima at Isp=713.5452629 and Isp=12243.31286 . With the two minima being on either side of one of the singularities, you would not be able to integrate this function unless you confined yourself to the area without singularities.
  댓글 수: 1
John D'Errico
John D'Errico 2011년 4월 22일
Solving an ordinary differential equation IS an integration.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by