If I write in Maple
AC := Amp*sin(2*Pi/T*t);
then I am able to see the expression in algebraic way. But I can’t plot it because T is unset (plotting against t, of course).
If I write
T := 100e-6;
AC := Amp*sin(2*Pi/T*t);
plot(AC, t=0..1e-3);
then I can plot it, but the expression is shown with numbers but not symbols.
My question is the following:
If there is a way to nicely combine these both desires? So
- to have the variables declared,
- to have the expression written in symbols,
- to have it plotted.
I know that it is possible to write the expression firstly and then add its parameters. It work for small worksheets. But what to do if I have a 5-8-pages job and want to localize the variables in the beginning of the document (not to look for them everywhere)?
Thank you!
If you put equations for the parameters in a list (assigned earlier in the worksheet) then you can use so-called 2-argument
evalwhenever you want to instantiate your symbolic expressions with those values.For example, at the top of the worksheet you could have something like,
and then later on your can still create new expressions containing unassigned symbols
T,Amp, etc.And then, whenever you wish to use those particular values,
That last command succeeds because the 2-argument
evalcall acts liks so,Even after that
plotcall, you can still use unassignedT, etc, in new symbolic expressions.Hope that helps.