Utilizing a "guess and check" method inside an ODE

6 vues (au cours des 30 derniers jours)
Adam Cutright
Adam Cutright le 25 Avr 2019
Commenté : Adam Cutright le 25 Avr 2019
I am trying to solve a 2nd order differential equation using a combination of ode45 and a "shooting" method.
k*T''+k'*T'=0
What I want to do is to define specific values of k for a span of x (which is my independent variable). k would have different values at every value of x. Then I will find my T value at every x using the ode45 code, and use it to recalculate k which would then be fed back in and so on and so forth until I achieved convergence.
To summarize: k=f(T) and T=f(x), solve k algebraically and use ode45 to solve the ode using different values of k and recalculate k at the new values of T. Repeat until I have T and k that agree with one another. Any suggestions?
  2 commentaires
Star Strider
Star Strider le 25 Avr 2019
I’m not certain what you’re asking. If you’re ‘optimizing’ ‘k’, see if Optimizing a Simulation or Ordinary Differential Equation (link) will do what you want.
Adam Cutright
Adam Cutright le 25 Avr 2019
Apologies for my unclear issue. Basically k=f(T) and also T=f(x) so my main goal is to find T over a range of x, but in order to do that I also need to know k at every x value. My idea was to start with some guessed values of k, find T using the guessed k values, and then feed the T values back into my equation for k in order to have new guesses for k which can be used to find T. And so on and so forth until I have correct values not only for k, but also for T. Does this make more sense?

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by