Author Topic: Some basic Octave GNU questions  (Read 367 times)

0 Members and 1 Guest are viewing this topic.

Offline MathWizardTopic starter

  • Super Contributor
  • ***
  • Posts: 2536
  • Country: ca
Some basic Octave GNU questions
« on: October 10, 2026, 10:25:21 pm »
I'm beginner level friendly with Octave, and I had been solving time domain ODE's and systems of ODE's in spreadsheets before, but that's slow and tedious, with all the matrices and complex numbers. So I jumped back into Octave. And for now I'm not using the ODE solver lsode, I'm just automating some of how I solve them in spreadsheet.

Some questions are)

Say you had a system of ODE's, and you find a characteristic polynomial on paper and then in Octave solve it with the roots function, and say put the results in a column vector. And say you put that same system matrix into Octave, and find the eigen value roots with the "eig" function, and put them in a column.

Will the roots function, and the eig function, always put the roots in the same order ? And are complex roots always 1st ?

Also if you have a list or vector, etc, is there any easy way, or commands to easily separate the complex numbers from the solely real numbers in the list/vector/etc?

For a vector or list in general, is there a fast easy way to normalize it to say start with a leading 1, or what about find the largest number or say the closest to entry to 1, and then normalize that entry and the rest to that ?

When finding the basis vectors of a null space, say from homogeneous ODE's and eigenvalue problems like above with matrices (not in lsode). So using the "null" function on matrices from the above eigenvalue problems. Like below in a 3rd order system and I had 3 different, null space basis column vectors. Is there an easy way to normalize them, as if I had chosen 1 as the free parameter when finding the basis vectors?

And when I did it in the spread sheet, I choose z=1 each time as the free parameter, for all the 3rd row entries. So my results look a fair bit different. I hope there's no row swapping going on.

But either way it would be nice quickly normalize such vectors or rows/column's /lists, in this case I would make the 3 real entries near 1, I'd make them 1. I can imagine doing it with a bunch of steps, but is there some quick command or thing already built for it ?

n1 =

   0.9508 +      0i
   0.0483 + 0.2999i
   0.0059 + 0.0610i

n2 =

   0.9508 +      0i
   0.0483 - 0.2999i
   0.0059 - 0.0610i

n3 =

   0.020641
   0.101109
   0.994661

« Last Edit: October 10, 2026, 10:31:15 pm by MathWizard »
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 5744
  • Country: Earth
Re: Some basic Octave GNU questions
« Reply #1 on: October 11, 2026, 02:18:31 pm »
I think these are several different implementation-related questions rather than Octave-specific questions.

Could you clarify what exactly you're trying to achieve and what isn't working as expected?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->