-1
$\begingroup$

I have a pretty simple code, working fine and producing a plot that is ALMOST what I desire:

b2[K_] := 1 - (K/938.27 + 1)^-2

Fbeta[K_] := Log[1.02*10^6*b2[K]/(1 - b2[K])] - b2[K]
dEdx[K_] := 0.17/b2[K]*(Fbeta[K] - 4.31)

myplot = Plot[NIntegrate[1/dEdx[K], {K, kappa, K0}] /
              NIntegrate[1/dEdx[K], {K, 0, K0}], {kappa, 0, 1000}]

Basically I would like the x-axis to be rescaled so that it goes from 0 to 1. I have made several tries substituting the variables, but only got a bunch of errors and I have run out of ideas ...

Is there a simple method I am not aware of to normalize the values on the x-axis?

$\endgroup$
  • $\begingroup$ What's a reasonable value for K0? $\endgroup$ – dionys Apr 29 '16 at 18:41
2
$\begingroup$

You did not define K0 so I added a Manipulate to control its value.

b2[K_] := 1 - (K/938.27 + 1)^-2

Fbeta[K_] := Log[1.02*10^6*b2[K]/(1 - b2[K])] - b2[K] 

dEdx[K_] := 0.17/b2[K]*(Fbeta[K] - 4.31)

Manipulate[
 myplot = Plot[
   NIntegrate[1/dEdx[K], {K, 1000 kappa, K0}]/
    NIntegrate[1/dEdx[K], {K, 0, K0}], {kappa, 0, 1}, PlotRange -> {0, 1}],
 {{K0, 1000, Subscript[K, 0]}, 1000, 5000, 25, Appearance -> "Labeled"}]

enter image description here

$\endgroup$
  • $\begingroup$ ... to control its value, +1. $\endgroup$ – user9660 Apr 30 '16 at 4:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.