- You can realistically solve the ODE in MATLAB and obtain the solution with a relatively good accuracy using a smaller step size.
- Technically, there are various of ODE solvers and I think you can use the ode45 solver for this case.
- The strategy as described in the examples in the link: https://www.mathworks.com/help/matlab/ref/ode45.html
Solving a highly non linear equation in Matlab
27 次查看(过去 30 天)
显示 更早的评论
I would like to ask for some advices in order to solve numerically a highly non-linear differential equation that represents a height field measured on an experiment. This is the equation :
I would like to know :
- How realistic it would be to solve this equation numerically on Matlab ?
- What kind of tool can I use in order to do so ?
- Which kind of strategy would be efficient in order to solve it ?
Thank you in advance for your help,
Best regards,
1 个评论
Sam Chak
2022-4-4
编辑:Sam Chak
2022-4-4
采纳的回答
Torsten
2022-4-4
编辑:Torsten
2022-4-4
It's "only" an ODE of degree 6.
Rewrite it as a system of first-order ODEs. You will need 6 initial or boundary conditions.
Depending on whether these conditions are set in one or two points, use ode45,ode15s as solvers for initial value problems or bvp4c as a solver for boundary value problems.
0 个评论
更多回答(2 个)
John D'Errico
2022-4-4
编辑:John D'Errico
2022-4-4
This is a differential equation. An ODE, because it involves derivatives wrt only one variable. It is high order, and nonlinear, so there will surely be NO analytical solution available. So do not even bother trying to use a tool like dsolve.
Convert the problem into a system of 6 ODE's. You can see examples of how to do so in the docs for tools like ODE45.
Finally, consider that NO solution can be obtained unless you have 6 initial conditions. This is because, as I said above, no analytical solution will be found. So you need 6 conditions, essentially on the function value and its derivatives.
Then you just call a tool like ODE45.
Note that if all of this seems to be completely meaningless to you, a complete foreign language, then you need to spend some time learning about ODEs (Ordinary Differential Equations).
Is it solvable? Probably so. In MATLAB, or in ANY computational environment, that is entirely up to you, and to the the time you will invest in it, and your skill at working with ODEs. Will it take some effort? Probably, and that is true no matter where you try to solve it, and what tools you use. There are many tools and methods that can be used to solve ODEs. Surely some of them will work on your problem.
1 个评论
MOSLI KARIM
2022-8-18
here is my proposal for your problem
here is my proposal for your problem
function ODE_ordre6
tspan=[1 10];
y0=[1;1;1;1;1;1];
option=odeset('relto',1*10^-6);
[eta,F]=ode45(@fct,tspan,y0,option );
eta
F
plot(eta,F(:,1),'r-o',eta,F(:,2),'o-b',eta,F(:,3),'y-o',eta,F(:,4),'g-o',eta,F(:,5),'k-o',eta,F(:,6),'c-o')
xlabel('\eta')
ylabel('F')
legend('F','F(:,1)','F(:,2)','F(:,3)','F(:,4)','F(:,5)','F(:,6)')
% table(F1,F2,F3,F4,F5,F6
function dxdy=fct(eta,y)
dxdy=[y(2);y(3);y(4);y(5);y(6);((5*y(1)-4*eta*y(2)-3*(y(2)^2)*y(6))/y(1))];
end
end
MOSLI KARIM
2022-8-18
here is my proposal for your problem
Unrecognized function or variable 'here'.
%%%%%%%%%%%%%%%%%% CODE MATLAB
function ODE_ordre6
tspan=[1 10];
y0=[1;1;1;1;1;1];
option=odeset('relto',1*10^-6);
[eta,F]=ode45(@fct,tspan,y0,option );
eta
F
plot(eta,F(:,1),'r-o',eta,F(:,2),'o-b',eta,F(:,3),'y-o',eta,F(:,4),'g-o',eta,F(:,5),'k-o',eta,F(:,6),'c-o')
xlabel('\eta')
ylabel('F')
legend('F','F(:,1)','F(:,2)','F(:,3)','F(:,4)','F(:,5)','F(:,6)')
% table(F1,F2,F3,F4,F5,F6
function dxdy=fct(eta,y)
dxdy=[y(2);y(3);y(4);y(5);y(6);((5*y(1)-4*eta*y(2)-3*(y(2)^2)*y(6))/y(1))];
end
end
0 个评论
另请参阅
类别
在 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!