Recent content by LordV

  1. L

    Why aren't the <v^2> and <vr^2> curves different in my Hernquist model?

    Hello, I would appreciate very much some help on this problem. I have a Hernquist model (distribution function) and I am trying to generate equal mass initial conditions. The way I do it is this. I have the mass profile M(r) and I pick say 10^6 random numbers between 0 and 1=M(r->inf). Then I...
  2. L

    Mathematica Mathematica Experts: Convert Expression to C++ Code

    Hmmm, I think I did it(although I am sure there is a more elegant way). First I used CForm[expresion] /. Power -> pow and the I used the output as a string and I used: StringReplace["output",{"y0" -> "y[0]", "y1" -> "y[1]", "y2" -> "y[2]", "y3" -> "y[3]"}]
  3. L

    Mathematica Mathematica Experts: Convert Expression to C++ Code

    Hi all, here is a question for mathematica experts(or not :smile:) I have an expression of the form: -6615. y[0] + 282.72 y[0]^3 + 1.3244 y[0]^5 - 0.002624 y[0]^7 - 178.28 y[1] + 152.912 y[0]^2 y[1]-((1309.5 y[0]^3 y[1]^4)/(y[0]^2 + y[1]^2)^4)... and I want to transfer this expression to...
  4. L

    Mathematica Finding Roots of Interpolated Function in Mathematica

    I used NSolve and I got t->InverseFunction[InterpolatingFunction... is there any way to use this?
  5. L

    Mathematica Finding Roots of Interpolated Function in Mathematica

    Hello, I have an interpolated function at mathematica x->InterpolatingFunction blahblahblah which looks like a sin I want to find all the roots between {x0,x1} (in a list if possible) Is there any way to achieve this? I tried FindRoot and Reduce but I couldn't...
Back
Top