Message Boards Message Boards

0
|
5285 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Can't get this code to work - warning from Solve

Posted 10 years ago

Hey there, I am very new to Mathematica. This is my code to get a graph for dynamic CMOS. This is just the first stage and I get a few errors. Can an expert guide me? I have already checked the documentation, yet can't solve it.

 In[26]:= aRatio = 6/11;
        iSize = {11*40, 6*40};
        iSize2 = {400, 300};
        view = {2, 1, 2};
        view1 = {4, 1, 2};
        font1 = {"Courier", FontSize -> 13, FontWeight -> "Bold"};
        pStyle1 = {RGBColor[1., 0, 0], PointSize[0.015], Thickness[0.007]};
        pStyle2 = {GrayLevel[0.5], PointSize[0.015], Thickness[0.007]};
        pStyle3 = {RGBColor[0, 0, 0], PointSize[0.015], Thickness[0.007]};

        In[78]:= Clear["soln3", "stage2", "stage4", "temp"]
        vdd = 5;
        k = 0.01;
        c0 = 5* 10^-12;
        vt = 1;
        m = 1*10^9;


        In[98]:= input1 = vt/m;


        In[99]:= N[1/1000000000]

        Out[99]= 1.*10^-9

        In[100]:= 
        soln = Simplify[
           Solve[{ip == 
              k*((vdd - vin - vt)*(vdd - vo[t]) - (vdd - vo[t])^2/2), 
             vin == m*t}, ip, {vin}]];



        During evaluation of In[100]:= Solve::ivar: 0.` is not a valid variable. >>

        In[101]:= stage1[t] = ip /. Part[Part[soln, 1] 1];

        During evaluation of In[101]:= ReplaceAll::reps: {True,True} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing. >>

        soln1 = NDSolve[{vo'[t] == stage1[t]/c0, vo[0] == vdd}, {vo[t]}, {t, 
            0, input1}];

        In[102]:= graph1[t_] vo[t] /. Part[Part[soln1, 1], 1];

        During evaluation of In[102]:= NDSolve::ndnum: Encountered non-numerical value for a derivative at t == 0.`. >>

        During evaluation of In[102]:= ReplaceAll::reps: {(vo^[Prime])[t]==100000000000 (0./. {0.,True})} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing. >>

        In[103]:= 
        Plot[graph1[t], {t, 0, vt/m}, PlotRange -> {{0, vt/m}, All},
          PlotStyle -> Thick, Frame -> True, GridLines -> Automatic, 
          FrameTicks -> Automatic, AspectRatio -> 0.5, 
          ImageSize -> {500, 250}];
POSTED BY: nffddn
3 Replies

I don't get the error message from Solve, so I suspect you had assigned a value to vin.

POSTED BY: Frank Kampas
In[9]:= soln = 
 Simplify[Solve[{ip == 
     k*((vdd - vin - vt)*(vdd - vo[t]) - (vdd - vo[t])^2/2), 
    vin == m*t}, {ip, vin}]]


Out[9]= {{ip -> 1/2 k (vdd - vo[t]) (-2 m t + vdd - 2 vt + vo[t]), 
  vin -> m t}}
POSTED BY: S M Blinder
Posted 10 years ago

Thanks to both of you. I got to solve that section. I have another question.

var1 = graph1[input1];

soln3 = Simplify[ Solve[{il3 == (k((vdd - vin - vt)(vdd - vo[t]) - ((vdd - vo[t])^2/2)) - (k/2*(vin)^2)), vin == m*t}, il3, {vin}]];

1) Solve was unable to solve the system with inexact coefficients. The answer was obtained by solving a corresponding exact system and numericizing the result. >>

stage2[t] = il3 /. Part[Part[soln3, 1], 1];

soln4 = NDSolve[{vo'[t] == stage2[t]/c0, vo[input1] == var1}, {t, input1, vdd/m}];

2) NDSolve::argm: NDSolve called with 2 arguments; 3 or more arguments are expected. >>

keep getting both warning/ error.......

POSTED BY: nffddn
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract