MAY I PLEASE SOLVE THE ODE FOR YOU? MIGHT HELP IN PART IF NOT FULLY! TANDONRAHUL@LIVE.COM .
Optimize a group of parameters to minimize the delay which is constrained by a second-oder ODE, PLEASE HELP!
2 views (last 30 days)
Show older comments
The problem is detailed in the attachment.
In short, I have a second-order ODE. No closed form solution can be found. Unfortunately, the objective function I need to optimize IS depending on the solution of the ODE. In addition, there are also some other equations/inequalities which set more constraints. The good side is there equations/inequalities are analytically given. How should I opmtimize this problem? Which Matlab function should I use? Please help. Thanks a lot!
Accepted Answer
Alan Weiss
on 9 Jun 2015
Edited: Alan Weiss
on 9 Jun 2015
Without reading your problem, perhaps you can find some help in this example and in this information.
In short, I would try to use fmincon or fminunc to do the optimization, but would carefully try to choose an appropriate value of 'FinDiffRelStep' or 'DiffMinChange'.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
6 Comments
Alan Weiss
on 8 Jul 2015
Your problem most likely needs to be rescaled. In floating point arithmetic, the relative error of a calculation can be no better than about 2e-16, and is often worse. So if you are talking about a relative error of 1e-18, then you are out of luck using floating point arithmetic.
But if you need your absolute error to be smaller than 1e-18, then you need to scale your problem so that this absolute error corresponds to a relative error of 1e-12 or so. In other words, multiply your ceq function by 1e6 or some such thing. You might need to rerun your optimization after it finishes.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
More Answers (1)
RahulTandon
on 6 Jul 2015
%%declarations , you can change here
syms Y em b k E A t gzero gd k Fa Vdd clear;
em = 1.23e-16;
b = 0; % for simplicity
E = 8.85e-12;
A = 1e-12;
gd = 5e-9;
Fa = 1.8e-9;
Vdd = 1; % for ease!!
gzero = 1; %%???!!!
k = 0.363; %%ha ha !
clc;
%% symbolic evaluation Eqn1 = 'em*D2Y+b*DY+k*Y == (E*A/(2*(gzero-Y)))*(Vdd+(Y*(k*gd-Fa)*(gzero-gd)^2)^(1/2))^2'; Eqn2 = 'Y(0) == 0'; Eqn3 = 'DY(0) == 0'; % Y = dsolve(Eqn1,Eqn2,Eqn3); % did not solve on m PC, i shud try parallel % pooling etc. %% next, get the function handle M = matlabFunction(em*diff(Y,t,2)+b*diff(Y,t)+k*Y - (E*A/(2*(gzero-Y)))*(Vdd+(Y*(k*gd-Fa)*(gzero-gd)^2)^(1/2))^2,'vars',{'t' 'Y'});
%% third, , grafical/numerical evaluation clc; [T,Y] = ode45(M,[-10 10],[0 0]); clf; plot(T,Y);
0 Comments
See Also
Categories
Find more on Surrogate Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!