Solving second order non-linear equations (time-domain)

조회 수: 4 (최근 30일)
Jake
Jake 2020년 8월 10일
편집: Alan Stevens 2020년 8월 11일
Hi everyone,
Im starting to learn ODE solving using MATLAB. I'm new to this, although I'm fairly comfortable using MATLAB. (I'm learning alone, as I go)
So, I want to solve an equation like the following one, and basically hoping to have a simulation (sort of) output as a plot. How do I approach this?
I'm posting this in advance and I will be looking for resources and other references after posting this :) Again, I'm not sure how to approach this and frankly, I'm not sure how to solve the equation itself.
Apologies for the broad question. Any pointer or lead will be highly appreciated, in a learning point of view.
Thanks in advance!
  댓글 수: 3
Jake
Jake 2020년 8월 11일
Thank you so much for the response!
Although I'm not familiar with the Symbolic toolbox, I'm fairly good with Simulink. I think I will try that. I understand that I have to study the math as well as solving it using MATLAB :) I was digging through the books too.
> if you have any questions regarding these,
I'm not sure if you were going to add some links here. I'd love to see some references though, if you have ay recommendations :)
Thank you again!
hosein Javan
hosein Javan 2020년 8월 11일
you're welcome.
regarding reference book: "differential equations, boyce and diprima"
you can solve either by homogeneous and particular solutions of second-order ode or by using laplace transform.

댓글을 달려면 로그인하십시오.

채택된 답변

Alan Stevens
Alan Stevens 2020년 8월 10일
편집: Alan Stevens 2020년 8월 11일
Here's the basic idea. First turn your second-order ODE into twofirst order ones, like so:
Then structure your code along the following lines:
P0 = [phi0 v0]; % Initial values of phi and v
tspan = [0 tend]; % Time over which to integrate
[t, P] = ode45(@phidot, tspan, P0); % Call ode solver
phi = P(:,1); % Extract values of phi
plot(t,phi) % plot results
% Function
function dphidt = phidot(t,P)
% Enter data needed e.g. omega4 = etc.
phi = P(1);
v = P(2);
dphidt = [v;
-2nv - wn4^2*phi + etc.];
end
Obviously the above coding is sketchy, but hopefully it's enough to give you the general idea.
  댓글 수: 1
Jake
Jake 2020년 8월 11일
편집: Jake 2020년 8월 11일
This makes a lot of sense. I hope I will be able to figure out the complete code soon, after referring to other notes and sources. Thank you so much for taking your time for this :) Means alot!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by