On 02/23/2013 03:00 PM, Hugo Coolens wrote:
> I'm trying to plot 5 plots for 5 different values of tau in one
> picture, unfortunately the makelist command doesn't produce 5
> different expressions
> and the following plot2d command fails too.
>
> sigma:tau[11]+tau[12]+tau[22];
> A:sqrt(p^2+2*p*sigma)-p;
> hjmax(p,sigma,A):=sqrt((1+A/p)/((1-A/sigma^2)^2+A/p));
> eq1:subst([A=sqrt(p^2+2*p*sigma)-p,sigma=tau[11]+tau[12]+tau[22],p=tau[11]*tau[22],tau[11]=tau,tau[22]=tau],hjmax(A,sigma,p));
>
> eq2:subst(tau[12]=x, %);
> tauplots:makelist(eq2,tau,[0.1,0.2,0.4,1,5]);
> plot2d(tauplots, [x, 1e-3,
> 5],[legend,"$\\tau=0.1$","$\\tau=0.2$","$\\tau=0.4$","$\\tau=1$","$\\tau=5$"]);
Hi Hugo,
you just need to add a '' (two single quotes) operator in the makelist
command, to force the evaluation of eq2. Namely:
tauplots:makelist(''eq2,tau,[0.1,0.2,0.4,1,5]);
Regards,
Jaime