- #1

- 5

- 0

I'm in the process of writing some code to enable me to solve for the stellar structure and evolution of a star. Language is C++, unfortunately my coding isn't exactly up to scratch and i was wondering if anybody has any useful hints or tips. I'll attach a copy of my source code.

I use the most basic ODE equations

Assume star is held up by radiation pressure alone

Assume energy generation rate follows a power law

Assume opacity follows a power law

Assume no convection takes place

At the moment it's only supposed to solve for structure and i just can't get it to output any useful data. I know that the problem lies in my ability to code, not in my maths. If somebody could give me some help i would be extremely grateful.