Can I solve ode without explicit expression for derivative?
2 次查看(过去 30 天)
显示 更早的评论
I would like to solve an ODE using Matlab's solvers, but where I don't have an explicit expression for the derivative. Specifically I want to simulate an electric motor. Normally this would be done with an equation like:
dI/dt = (E(t) - I(t)R) / L
Now I currently have an analytical expression for E(t), but really E(t) is the derivative of another underlying function, the flux Linkage, which I'll call phi. Then we have
E = -d phi(t) / dt
dI/dt = (E(t) - I(t)R) / L
Where R and L are constants.
My issue is that I would like to get the next value of the function phi from a finite element simulation at each time step, so I don't have an analytical expression for phi, or d phi(t) / dt.
Can I still use Matlab's ODE solvers to solve my problem, and if so, how?
Note that the problem usually requires a stiff solver like ode15s.
1 个评论
Tejas
2016-5-18
Hello Richard,
This may be possible.
You may have to write a wrapper, let's call it, "getE(t)", around your Finite Element Simulator's results to return E(t) at a given t. This means that you will have to precompute the values of phi(t), and write this wrapper function that returns the time gradient of phi(t) at any given value of "t". You might have to do some interpolation in order to get a value for phi (and hence E) at any given value of "t"
function dIdt = odefun(t,I)
dIdt = (getE(t) - I(t)*R)/L
end
回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!