I need to define two functions for a molecule with speed s.(adsbygoogle = window.adsbygoogle || []).push({});

a)it has a horizontal velocity between -s and s

b) v , the vertical velocity between +Sqrt[s^2-u^2] and -Sqrt[s^2-u^2]

This is what I have done

for a)

for b)Code (Text):f[s_]:=RandomReal[{-s,s}]

now , If I enter f[2] I get u, so I have s and u from first code. How do I use these values in the second code (without manually inputting them)?Code (Text):g[s_,u_]:=RandomReal[{-Sqrt[s^2-u^2],+Sqrt[s^2-u^2]}]

Thanks a bunch

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Definiing two functions (mathematica)

Loading...

Similar Threads for Definiing functions mathematica |
---|

MATLAB Coding up the step function |

Bi-exponential function fitting in Origin Lab SW |

Mathematica Looping through vectorized functions for a piecewise solution |

Mathematica Cannot do the integral of the Hyper-geometric function? |

Mathematica Cannot Plot This Function in Mathematica |

**Physics Forums | Science Articles, Homework Help, Discussion**