Hi Reem, can you please format your examples as code in future posts? Makes it easier to copy things.
Let's look at your problem though. First of all, there are three variables: t
, r
, and theta
. You can define your result as a function of all three like this:
x[t_, r_, theta_] :=
1.1993963068181815*^7 r^2 t -
118134.46969696967 E^(-((8.464929859719441*^-6 t)/r^2)) r^2 1 +
1 + 17.22301136363636 r t Cos[theta];
Things to note: Use underscores for each function argument, you want to use all arguments as patterns. On the right hand side of your definition, the rule x[t]->...
certainly doesn't do what you expect. And lastly, defining the same function with different numbers of arguments (like x[t]
and x[t,r,theta]
) is possible, but it's not something you should try unless you're sure you understand "simple" functions that have only one definition.
Alright, so now that you have a definition for x[t,r,theta]
, you can pick a fixed value for t
and theta
and plot x
as a function of t
, like this:
Plot[x[t, .01, 3], {t, 0, 10}]
Or, if you already know the fixed values you'll want to use, you can also do this (and it might make more sense depending on the context):
x[t_] := 1.1993963068181815*^7 r^2 t -
118134.46969696967 E^(-((8.464929859719441*^-6 t)/r^2)) r^2 1 +
1 + 17.22301136363636 r t Cos[theta] /. {r -> .01, theta -> 3};
Plot[x[t], {t, 0, 10}]
But you can't make a plot of something that still contains symbolic expressions. You can also make a Plot3D
with two variables, if that makes more sense for your problem.