# [✓] Plot a graph for viscosity vs. molecular weight?

GROUPS:
 Hi, I just started learning mathematica. I'm trying to plot this plot the graph for viscosity vs molecular weight (attached pictures Formula [1] and books plot[2] from Cosgrove book of colloidal sciences.) I first try to sum functions (linear part EE(M) and non linear part EE(M)) but I don't think it works like that (line 3). So I used the "IF" command and it seems it is also wrong (line 5). I think I have problem with defining functions and parameters in mathematica. My .nb file is attached and I appreciate your help. P.S: Also look at line7 why mathematica doesn't plot when I use function's name? EE1[M1_] := a M1; EE2[M1_] := a M1^3.4; Plot[{a M1 + a M1^3.4}, {M1, 1, 100}, PlotRange -> Automatic] Mc = 54; ee[M_] := If[M < Mc, M, M^3.4](*ee is viscosity [\eta]*) Plot[If[M < Mc, M, M^3.4], {M, 1, 100}, PlotRange -> Automatic] Also why this code doesn't plot manipulate when i use function's name Manipulate[Plot[{EE1 + EE2}, {M1, 1, 100}, PlotRange -> Automatic], {a, 1, 3}]  Attachments:
3 months ago
4 Replies
 Christopher French 1 Vote Hold the expression using With and insert a value for a With[{a = 1}, Plot[{a M1 + a M1^3.4}, {M1, 1, 100}, PlotRange -> Automatic] ] Same thing can be done, instead of setting the value for Mc With[{Mc = 54}, ee[M_] := If[M < Mc, M, M^3.4];(*ee is viscosity[\eta]*) Plot[ee[M], {M, 1, 100}, Filling -> Axis] ] Make the EE functions of two arguments, then supply the value of a using the manipulator EE1[M1_, a_] := a M1; EE2[M1_, a_] := a M1^3.4; Manipulate[ Plot[EE1[M1, a] + EE2[M1, a], {M1, 1, 100}, PlotRange -> {0, 2*^7}], {a, 1, 3}]