Student Support Forum: 'numerical evaluation after strictly symbolic so...' topicStudent Support Forum > General > "numerical evaluation after strictly symbolic so..."

 Next Comment > Help | Reply To Topic
 Author Comment/Response Andrew 12/06/11 2:49pm my file works somewhat more like I wanted. But still having some problems since after finishing the symbolic portion of the analysis I would like to enter values for the circuit constants (resistances, inductances, etc). However, when I do so, the entire notebook updates with the numerical values when it is desired that only the portions of the notebook after the numerical values are entered should substitute values into the symbols. The help docs are pretty cryptic and I'm not sure if I should be using a "Dialog" or defining the values using ":=" or "N[]" functions. So anybody got a tip for this one? (See below for the notebook cut and paste) Thanks Andrew (Dialog Level 3) In[47]:= ClearAll eqns = {Subscript[i, ac][s] == 1/s/Subscript[L, i]*(Subscript[v, i][s] - Subscript[v, ac][s]), Subscript[v, i][s] == d[s]*Subscript[V, dc], Subscript[i, Z][s] == 1/Subscript[Z, f]*Subscript[v, ac][s], Subscript[v, ac][s] == Subscript[v, S][s] + s*Subscript[L, gs]*(Subscript[i, ac][s] - Subscript[i, Z][s]), Subscript[Z, f] == 1/(s*Subscript[C, f] + 1/Subscript[R, f])} (Dialog Level 3) Out[47]= ClearAll (Dialog Level 3) Out[48]= {Subscript[i, ac][s] == (-Subscript[v, ac][s] + Subscript[v, i][s])/( s Subscript[L, i]), Subscript[v, i][s] == d[s] Subscript[V, dc], Subscript[i, Z][s] == Subscript[v, ac][s]/Subscript[Z, f], Subscript[v, ac][s] == s Subscript[L, gs] (Subscript[i, ac][s] - Subscript[i, Z][s]) + Subscript[v, S][s], Subscript[Z, f] == 1/(s Subscript[C, f] + 1/Subscript[R, f])} (Dialog Level 3) In[49]:= Solve[eqns, {Subscript[i, ac][s]}, {Subscript[v, i][s], Subscript[i, Z][s], Subscript[v, ac][s], Subscript[Z, f]}] (Dialog Level 3) Out[49]= {{Subscript[i, ac][s] -> ( s d[s] Subscript[L, gs] Subscript[V, dc] + d[s] Subscript[R, f] Subscript[V, dc] + s^2 d[s] Subscript[C, f] Subscript[L, gs] Subscript[R, f] Subscript[V, dc] - Subscript[R, f] Subscript[v, S][s])/( s (s Subscript[L, gs] Subscript[L, i] + Subscript[L, gs] Subscript[R, f] + Subscript[L, i] Subscript[R, f] + s^2 Subscript[C, f] Subscript[L, gs] Subscript[L, i] Subscript[R, f]))}} (Dialog Level 3) In[50]:= Expand[%] (Dialog Level 3) Out[50]= {{Subscript[i, ac][s] -> (d[s] Subscript[L, gs] Subscript[V, dc])/( s Subscript[L, gs] Subscript[L, i] + Subscript[L, gs] Subscript[R, f] + Subscript[L, i] Subscript[R, f] + s^2 Subscript[C, f] Subscript[L, gs] Subscript[L, i] Subscript[R, f]) + ( d[s] Subscript[R, f] Subscript[V, dc])/( s (s Subscript[L, gs] Subscript[L, i] + Subscript[L, gs] Subscript[R, f] + Subscript[L, i] Subscript[R, f] + s^2 Subscript[C, f] Subscript[L, gs] Subscript[L, i] Subscript[R, f])) + (s d[s] Subscript[C, f] Subscript[L, gs] Subscript[R, f] Subscript[V, dc])/( s Subscript[L, gs] Subscript[L, i] + Subscript[L, gs] Subscript[R, f] + Subscript[L, i] Subscript[R, f] + s^2 Subscript[C, f] Subscript[L, gs] Subscript[L, i] Subscript[R, f]) - ( Subscript[R, f] Subscript[v, S][s])/( s (s Subscript[L, gs] Subscript[L, i] + Subscript[L, gs] Subscript[R, f] + Subscript[L, i] Subscript[R, f] + s^2 Subscript[C, f] Subscript[L, gs] Subscript[L, i] Subscript[R, f]))}} (Dialog Level 3) In[51]:= tfs = {Subscript[G, id][ s] == ((d[s] Subscript[L, gs] Subscript[V, dc])/( s Subscript[L, gs] Subscript[L, i] + Subscript[L, gs] Subscript[R, f] + Subscript[L, i] Subscript[R, f] + s^2 Subscript[C, f] Subscript[L, gs] Subscript[L, i] Subscript[R, f]) + (d[s] Subscript[R, f] Subscript[V, dc])/( s (s Subscript[L, gs] Subscript[L, i] + Subscript[L, gs] Subscript[R, f] + Subscript[L, i] Subscript[R, f] + s^2 Subscript[C, f] Subscript[L, gs] Subscript[L, i] Subscript[R, f])) + (s d[s] Subscript[C, f] Subscript[L, gs] Subscript[R, f] Subscript[V, dc])/( s Subscript[L, gs] Subscript[L, i] + Subscript[L, gs] Subscript[R, f] + Subscript[L, i] Subscript[R, f] + s^2 Subscript[C, f] Subscript[L, gs] Subscript[L, i] Subscript[R, f])), Subscript[G, iv][s] == (Subscript[R, f] Subscript[v, S][s])/( s (s Subscript[L, gs] Subscript[L, i] + Subscript[L, gs] Subscript[R, f] + Subscript[L, i] Subscript[R, f] + s^2 Subscript[C, f] Subscript[L, gs] Subscript[L, i] Subscript[R, f]))} (Dialog Level 3) Out[51]= {Subscript[G, id][s] == (d[s] Subscript[L, gs] Subscript[V, dc])/( s Subscript[L, gs] Subscript[L, i] + Subscript[L, gs] Subscript[R, f] + Subscript[L, i] Subscript[R, f] + s^2 Subscript[C, f] Subscript[L, gs] Subscript[L, i] Subscript[R, f]) + ( d[s] Subscript[R, f] Subscript[V, dc])/( s (s Subscript[L, gs] Subscript[L, i] + Subscript[L, gs] Subscript[R, f] + Subscript[L, i] Subscript[R, f] + s^2 Subscript[C, f] Subscript[L, gs] Subscript[L, i] Subscript[R, f])) + (s d[s] Subscript[C, f] Subscript[L, gs] Subscript[R, f] Subscript[V, dc])/( s Subscript[L, gs] Subscript[L, i] + Subscript[L, gs] Subscript[R, f] + Subscript[L, i] Subscript[R, f] + s^2 Subscript[C, f] Subscript[L, gs] Subscript[L, i] Subscript[R, f]), Subscript[G, iv][s] == (Subscript[R, f] Subscript[v, S][s])/( s (s Subscript[L, gs] Subscript[L, i] + Subscript[L, gs] Subscript[R, f] + Subscript[L, i] Subscript[R, f] + s^2 Subscript[C, f] Subscript[L, gs] Subscript[L, i] Subscript[R, f]))} (Dialog Level 3) In[52]:= Simplify[tfs] (Dialog Level 3) Out[52]= {Subscript[G, id][s] == ( d[s] (Subscript[R, f] + s Subscript[L, gs] (1 + s Subscript[C, f] Subscript[R, f])) Subscript[V, dc])/(s (Subscript[L, i] Subscript[R, f] + Subscript[L, gs] (Subscript[R, f] + s Subscript[L, i] (1 + s Subscript[C, f] Subscript[R, f])))), Subscript[G, iv][s] == (Subscript[R, f] Subscript[v, S][s])/( s (Subscript[L, i] Subscript[R, f] + Subscript[L, gs] (Subscript[R, f] + s Subscript[L, i] (1 + s Subscript[C, f] Subscript[R, f]))))} (Dialog Level 3) In[53]:= Limit[( (Subscript[R, f] + s Subscript[L, gs] (1 + s Subscript[C, f] Subscript[R, f])) Subscript[V, dc])/(s (Subscript[L, i] Subscript[R, f] + Subscript[L, gs] (Subscript[R, f] + s Subscript[L, i] (1 + s Subscript[C, f] Subscript[R, f])))), Subscript[L, gs] -> 0] (Dialog Level 3) Out[53]= Subscript[V, dc]/(s Subscript[L, i]) (Dialog Level 3) In[54]:= Limit[Subscript[R, f] /( s (Subscript[L, i] Subscript[R, f] + Subscript[L, gs] (Subscript[R, f] + s Subscript[L, i] (1 + s Subscript[C, f] Subscript[R, f])))), Subscript[L, gs] -> 0] (Dialog Level 3) Out[54]= 1/(s Subscript[L, i]) (Dialog Level 3) In[55]:= Subscript[L, gs] == Subscript[L, g] + Subscript[L, s] (Dialog Level 3) Out[55]= Subscript[L, gs] == Subscript[L, g] + Subscript[L, s] Value as given is not small enough to be neglected compared to Subscript[L, i]. (Dialog Level 3) In[56]:= plantGid = TransferFunctionModel[{(Subscript[R, f] + s Subscript[L, gs] (1 + s Subscript[C, f] Subscript[R, f])) Subscript[V, dc], s (Subscript[L, i] Subscript[R, f] + Subscript[L, gs] (Subscript[R, f] + s Subscript[L, i] (1 + s Subscript[C, f] Subscript[R, f])))}, s] (Dialog Level 3) Out[56]= \!\(\* TagBox[ SubsuperscriptBox[ FormBox[ TagBox[ RowBox[{"(", "", GridBox[{ { RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"s", " ", SubscriptBox["L", "gs"]}], "+", SubscriptBox["R", "f"], "+", RowBox[{ SuperscriptBox["s", "2"], " ", SubscriptBox["C", "f"], " ", SubscriptBox["L", "gs"], " ", SubscriptBox["R", "f"]}]}], ")"}], " ", SubscriptBox["V", "dc"]}], RowBox[{"s", " ", RowBox[{"(", RowBox[{ RowBox[{"s", " ", SubscriptBox["L", "gs"], " ", SubscriptBox["L", "i"]}], "+", RowBox[{ SubscriptBox["L", "gs"], " ", SubscriptBox["R", "f"]}], "+", RowBox[{ SubscriptBox["L", "i"], " ", SubscriptBox["R", "f"]}], "+", RowBox[{ SuperscriptBox["s", "2"], " ", SubscriptBox["C", "f"], " ", SubscriptBox["L", "gs"], " ", SubscriptBox["L", "i"], " ", SubscriptBox["R", "f"]}]}], ")"}]}]} }, AllowScriptLevelChange->False, BaseStyle->{Deployed -> False}, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxItemStyle->{ "ItemsIndexed" -> {{{1, 1}, {}} -> { Deployed -> True, ShowStringCharacters -> False}, {{}, {1, 1}} -> { Deployed -> True, ShowStringCharacters -> False}}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "", ")"}], Function[BoxForm`e\$, MatrixForm[BoxForm`e\$]]], StandardForm], FormBox[ StyleBox["\<\"\[InvisibleSpace]\"\>", ShowStringCharacters->False], StandardForm], FormBox[ StyleBox["\<\"\[ScriptCapitalT]\"\>", Editable->False, ShowStringCharacters->False], StandardForm], MultilineFunction->None], {TransferFunctionModel, {{ Control`CommonDump`pVar -> \$CellContext`s, Hash -> 811670249}}}]\) URL: , URL: ,

 Subject (listing for 'numerical evaluation after strictly symbolic so...') Author Date Posted numerical evaluation after strictly symbolic so... Andrew 12/06/11 2:49pm Re: numerical evaluation after strictly symboli... Forum Modera... 12/06/11 3:16pm
 Next Comment > Help | Reply To Topic