简体   繁体   English

ODE45加快循环速度

[英]ODE45 speed up and for loops

I have a coupled first order ODE to solve of the form 我有一个耦合的一阶ODE来解决表格

dy = f(t, x)
dx = d(f, x)

which depend on a common parameter which I have to solve for over some range. 这取决于我必须在某个范围内解决的通用参数。 I can solve the system using ODE45 and a for loops which increments the parameter of interest at each loop, however, this is very slow. 我可以使用ODE45和for循环来解决系统,该循环会在每个循环中增加目标参数,但是,这非常慢。 Can I avoid solving this problem in loops? 我可以避免循环解决此问题吗? Or what is best practice with problems of this type. 或针对此类问题的最佳实践是什么。

Wanted to post a comment but I can't until I get 50 reputation. 想要发表评论,但直到获得50点信誉我才能发表评论。 What do you need to solve the parameter in each range? 您需要解决什么范围的参数? Can't you create a function for solving the parameter and put the function handle in the second argument for ode45? 您不能创建用于求解参数的函数并将函数句柄放在ode45的第二个参数中吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM