Filter löschen
Filter löschen

Matlab Integration

3 Ansichten (letzte 30 Tage)
John
John am 20 Apr. 2011
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.

Antworten (3)

Mike Hosea
Mike Hosea am 20 Apr. 2011
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 am 20 Apr. 2011
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 am 20 Apr. 2011
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 Kommentar
John D'Errico
John D'Errico am 22 Apr. 2011
Solving an ordinary differential equation IS an integration.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by