level 1
大洋子♬
楼主
我的目标是用mma帮忙推公式,减去手算的麻烦。目标公式如下,论文里随便找的。

这是我一顿乱写的代码,得出结果是一致的。想问问特别最后一步,单对分母按需求进行合并同类项,有没有更简便的写法。

代码:
<< Notation`
Notation[
NotationTemplateTag[x_ || y_] \[DoubleLongLeftRightArrow]
NotationTemplateTag[((x_ y_)/(x_ + y_))]](*定义并联算符*)
Subscript[g,
m] (1/(j w Subscript[m, 2 ] Subscript[C, gd]) || 1/(
j w Subscript[C, ds]) || Subscript[R, L] || Subscript[R,
ds]) // Simplify
((Subscript[g, m] Subscript[R, ds] Subscript[R, L])/(Subscript[R, L] +
Subscript[R,
ds] (1 + j w Subscript[C, ds] Subscript[R, L] +
j w Subscript[C, gd] Subscript[m, 2] Subscript[R, L])))(*获得化简后的形式*)
Subscript[A, v] = (Subscript[g, m] Subscript[R, ds] Subscript[R, L])/(
Subscript[R, L] +
Subscript[R,
ds] (1 + j w Subscript[C, ds] Subscript[R, L] +
j w Subscript[C, gd] Subscript[m, 2] Subscript[R, L]));
Subscript[A, v] = Numerator[Subscript[A, v]]/
Collect[Denominator[Subscript[A, v]], {j, w, Subscript[R, L],
Subscript[R, ds]}];(*将分母按需要的形式提取公因式*)
Subscript[A, v]
((Subscript[g, m] Subscript[R, ds] Subscript[R, L])/(Subscript[R, ds] \
+ Subscript[R, L] +
j w (Subscript[C, ds] + Subscript[C, gd] Subscript[m, 2]) Subscript[
R, ds] Subscript[R, L]))(*得到最后结果与论文一致*)
2023年12月27日 08点12分
1

这是我一顿乱写的代码,得出结果是一致的。想问问特别最后一步,单对分母按需求进行合并同类项,有没有更简便的写法。
代码:<< Notation`
Notation[
NotationTemplateTag[x_ || y_] \[DoubleLongLeftRightArrow]
NotationTemplateTag[((x_ y_)/(x_ + y_))]](*定义并联算符*)
Subscript[g,
m] (1/(j w Subscript[m, 2 ] Subscript[C, gd]) || 1/(
j w Subscript[C, ds]) || Subscript[R, L] || Subscript[R,
ds]) // Simplify
((Subscript[g, m] Subscript[R, ds] Subscript[R, L])/(Subscript[R, L] +
Subscript[R,
ds] (1 + j w Subscript[C, ds] Subscript[R, L] +
j w Subscript[C, gd] Subscript[m, 2] Subscript[R, L])))(*获得化简后的形式*)
Subscript[A, v] = (Subscript[g, m] Subscript[R, ds] Subscript[R, L])/(
Subscript[R, L] +
Subscript[R,
ds] (1 + j w Subscript[C, ds] Subscript[R, L] +
j w Subscript[C, gd] Subscript[m, 2] Subscript[R, L]));
Subscript[A, v] = Numerator[Subscript[A, v]]/
Collect[Denominator[Subscript[A, v]], {j, w, Subscript[R, L],
Subscript[R, ds]}];(*将分母按需要的形式提取公因式*)
Subscript[A, v]
((Subscript[g, m] Subscript[R, ds] Subscript[R, L])/(Subscript[R, ds] \
+ Subscript[R, L] +
j w (Subscript[C, ds] + Subscript[C, gd] Subscript[m, 2]) Subscript[
R, ds] Subscript[R, L]))(*得到最后结果与论文一致*)