Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7951767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:39:40+00:00 2026-06-04T02:39:40+00:00

I’m using ode45() in matlab for some work in dynamics, using this procedure to

  • 0

I’m using ode45() in matlab for some work in dynamics, using this procedure to calculate the largest Lyaponov exponent of the Lorenz system.

The process involves solving a system of differential equations starting from x0, and comparing this with a trajectory starting very close to x0.

At each time step, the second trajectory needs to be re-adjusted before advancing the time step, so I would like to be able to call ode45() just once – is this possible?

A starting attempt for an alternative solution is presented here, but it doesn’t work; as far as I can see, the matrices r and R obtained below should be similar:

% Time 
ti = 0; tf = 1; res = 10;
T = linspace(ti, tf, res);

% Solve the system first time
[~,R] = ode45('tbmLorenz',T,x0);

% Alternate trajectory
r = zeros(size(R));

% Temporary cordinates
temp = zeros(3,3);

% Solve for second trajectory
for i = 2:(res-1)
    % Time step
    ts = T((i-1):(i+1));

    % Solve three steps
    [~,temp] = ode45('tbmLorenz',ts,r(i-1,:));

    r_i = temp(2,:)

    % Code to alter r_i goes here

    % Save this
    r(i,:) = r_i;
end

… but they aren’t:

r =
    1.0000    3.0000    4.0000
    9.7011   20.6113    7.4741
   29.9265   16.4290   79.0449
   -5.7096  -15.2075   49.2946
  -12.4917  -13.6448   44.7003
  -13.6131  -13.8826   45.0346
  -13.5061  -13.1897   45.4782
  -13.0538  -13.0119   44.5473
  -13.4463  -13.8155   44.4783
         0         0         0
>> R
R =
    1.0000    3.0000    4.0000
    9.7011   20.6139    7.4701
   29.9663   16.5049   79.1628
   -5.7596  -15.2745   49.3982
  -12.4738  -13.5598   44.7800
  -13.5440  -13.8432   44.9084
  -13.5564  -13.3049   45.4568
  -13.1016  -12.9980   44.6882
  -13.3746  -13.7095   44.4364
  -13.7486  -13.6991   45.4092

That the last line of r is zero is not a problem.

Any ideas? Cheers!
\T

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T02:39:41+00:00Added an answer on June 4, 2026 at 2:39 am

    Ode45 is an adaptive algorithm with varying step size by definition. You can fix the step size if you want, but then you are not using ode45, you’re using something else.

    If you want to solve this type of problem, I suggest you use a fixed time step. This link has code for what you need.

    If you insist on using ode45, then you must adjust the simulation file itself with time-interpolated inputs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am reading a book about Javascript and jQuery and using one of the
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.