Message Boards Message Boards

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

Solve a matrix equation?

Posted 7 years ago

Hello, I am new to computing equation with Mathmatica and have got the following problem. I want to solve the following equation:

TeXForm[x(t) = e^(A(t-t_0) * x_0 + Integrate[e^(A(t-tau))*B*u(tau), tau,t_0,t]]

(the state-trajectory equation for control systems)

I have got the Matrix A:

A = {{-R/L, -1/L},{1/C, 0}}

The Matrix B:

B = {{0, 1/L},{-1/C, 0}}

x_0 = {i_L0, u_C0}
u[tau) = {i_WR0, u_GR0}

Here is my mathmatica code:

pt[A, DClink] = 
MatrixForm[{{-(Subscript[R, L]/L), -(1/L)}, {1/C, 0}}];

In[80]:= Subscript[B, DClink] = MatrixForm[{{0, 1/L}, {-(1/C), 0}}];

In[81]:= Subscript[x, 0] = {Subscript[i, L0], Subscript[u, C0]}

Out[81]= {Subscript[i, L0], Subscript[u, C0]}

In[82]:= term1[t_] := 
e^(Subscript[A, DClink]*(t - Subscript[t, 0])).Subscript[x, 0]

In[83]:= MatrixForm[term1[t]]

Out[83]//MatrixForm= \!\(
TagBox[
RowBox[{
SuperscriptBox["e", 
RowBox[{
TagBox[
RowBox[{"(", "", GridBox[{
{
RowBox[{"-", 
FractionBox[
SubscriptBox["R", "L"], "L"]}], 
RowBox[{"-", 
FractionBox["1", "L"]}]},
{
FractionBox["1", "C"], "0"}
},
GridBoxAlignment->{
      "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
       "Rows" -> {{Baseline}}, "RowsIndexed" -> {}},
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$]]], " ", 
RowBox[{"(", 
RowBox[{"t", "-", 
SubscriptBox["t", "0"]}], ")"}]}]], ".", 
RowBox[{"{", 
RowBox[{
SubscriptBox["i", "L0"], ",", 
SubscriptBox["u", "C0"]}], "}"}]}],
Function[BoxForm`e$, 
MatrixForm[BoxForm`e$]]]\)

In[84]:= u[t_] = {Subscript[i, WR0][t], Subscript[u, GR][t]};

In[85]:= term2[t_] := 
e^(Subscript[A, DClink]*(t - \[Tau])).Subscript[B, DClink].u[\[Tau]]

In[86]:= MatrixForm[term2[t]]


Out[86]//MatrixForm= \!\(
TagBox[
RowBox[{
SuperscriptBox["e", 
RowBox[{
RowBox[{"(", 
RowBox[{"t", "-", "\[Tau]"}], ")"}], " ", 
TagBox[
RowBox[{"(", "", GridBox[{
{
RowBox[{"-", 
FractionBox[
SubscriptBox["R", "L"], "L"]}], 
RowBox[{"-", 
FractionBox["1", "L"]}]},
{
FractionBox["1", "C"], "0"}
},
GridBoxAlignment->{
      "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
       "Rows" -> {{Baseline}}, "RowsIndexed" -> {}},
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$]]]}]], ".", 
TagBox[
RowBox[{"(", "", GridBox[{
{"0", 
FractionBox["1", "L"]},
{
RowBox[{"-", 
FractionBox["1", "C"]}], "0"}
},
GridBoxAlignment->{
    "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
     "Rows" -> {{Baseline}}, "RowsIndexed" -> {}},
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$]]], ".", 
RowBox[{"{", 
RowBox[{
RowBox[{
SubscriptBox["i", "WR0"], "[", "\[Tau]", "]"}], ",", 
RowBox[{
SubscriptBox["u", "GR"], "[", "\[Tau]", "]"}]}], "}"}]}],
Function[BoxForm`e$, 
MatrixForm[BoxForm`e$]]]\)

In[87]:= x[t] = 
term1[t] + Integrate[term2[\[Tau]], {\[Tau], Subscript[t, 0], t}]

Out[87]= e^(\!\(\*
TagBox[
RowBox[{"(", "", GridBox[{
{
RowBox[{"-", 
FractionBox[
SubscriptBox["R", "L"], "L"]}], 
RowBox[{"-", 
FractionBox["1", "L"]}]},
{
FractionBox["1", "C"], "0"}
},
GridBoxAlignment->{
     "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
      "Rows" -> {{Baseline}}, "RowsIndexed" -> {}},
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$]]]\) (t - Subscript[t, 0])).{Subscript[i, L0], 
Subscript[u, C0]} + \!\(
\*SubsuperscriptBox[\(\[Integral]\), 
SubscriptBox[\(t\), \(0\)], \(t\)]\(1 . \*
TagBox[
RowBox[{"(", "", GridBox[{
{"0", 
FractionBox["1", "L"]},
{
RowBox[{"-", 
FractionBox["1", "C"]}], "0"}
},
GridBoxAlignment->{
    "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
     "Rows" -> {{Baseline}}, "RowsIndexed" -> {}},
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$]]] . {
\(\*SubscriptBox[\(i\), \(WR0\)]\)[\[Tau]], 
\(\*SubscriptBox[\(u\), \(GR\)]\)[\[Tau]]} \[DifferentialD]\[Tau]\)\)

I want the final equation as a vector DGL as a function of t. E.g. the matrices should be expanded. Sorry if my post is not displayed very clearly, i will edit this post until the code is displayed clearly.

I am glad about every help.

Kind regards, M.G.

POSTED BY: M Gladen
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