Matlab Integration
1 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(3 个)
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
0 个评论
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
0 个评论
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!