Solving a highly non linear equation in Matlab
Afficher commentaires plus anciens
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 commentaire
- 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
Réponse acceptée
Plus de réponses (2)
John D'Errico
le 4 Avr 2022
Modifié(e) : John D'Errico
le 4 Avr 2022
1 vote
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 commentaire
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
le 18 Août 2022
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
Catégories
En savoir plus sur Ordinary Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!