7 Replies Latest reply: Jun 16, 2011 8:29 AM by AlanStevens

ODE Solution for an electric circuit ( 5 states=> 2 inductors and 3 capacitors)

Hi

I was wondering if anybody could help me solve an linear system of equations using ODE.

I am trying to solve a rather simple electric circuit, but for some reason MathCad is having problems with the solution.

I was able to solve a similar problem with only 4 states ( that is, without C2 and RC2 components). However, i cannot understand why Odesolve cannot find a solution.

I simulated the circuit using an electromagnetic trasient analysis software, and the waveforms are very reasonable.

I was wondering if anybody could have an idea of what I could be doing wrong.

I have attached the full model with your reference.

Alex

• Re: ODE Solution for an electric circuit ( 5 states=> 2 inductors and 3 capacitors)

Mathcad is happier if the 1st order ODEs are separated - see attached (I used Mathcad's symbolics to do the separation, though I only show the result in the attached file).

Alan

PS You should check carefully that my rearrangements do actually represent your system correctly. It's all too easy to introduce an error when dealing with so many manipulations!

• Re: ODE Solution for an electric circuit ( 5 states=> 2 inductors and 3 capacitors)

HI Alan,

This is very helpful. However, I am very interested in seeing how you did the symbolic separation in MathCad.

That is were the trick is ( I really thought that MathCad would do something like that as part of the Odesolve function).

Could you please send me the MathCad file that shows how you obtain the 1st ODE in separate form.

Thank you

Alex

• Re: ODE Solution for an electric circuit ( 5 states=> 2 inductors and 3 capacitors)

Alex M. wrote:

HI Alan,

This is very helpful. However, I am very interested in seeing how you did the symbolic separation in MathCad.

That is were the trick is ( I really thought that MathCad would do something like that as part of the Odesolve function).

Could you please send me the MathCad file that shows how you obtain the 1st ODE in separate form.

Thank you

Alex

The attached should help.

Alan

• Re: ODE Solution for an electric circuit ( 5 states=> 2 inductors and 3 capacitors)

Hi Alan,

Could you please convert the file to V13?

I think you are using V14 or higher.

Thank you

• Re: ODE Solution for an electric circuit ( 5 states=> 2 inductors and 3 capacitors)

Alex M. wrote:

Hi Alan,

Could you please convert the file to V13?

I think you are using V14 or higher.

Thank you

Sorry, yes I used M15. Here are the two files in M13 format.

Alan

• Re: ODE Solution for an electric circuit ( 5 states=> 2 inductors and 3 capacitors)

Thank you Alan,

Not sure why, but M13 cannot find a the symbolic solution of the D's

I have attached a snapshot for your reference.

There is significant manual manipulation of the variables, but I guess it is a nice way to get the ODE separated.

Thanks

Alex

• Re: ODE Solution for an electric circuit ( 5 states=> 2 inductors and 3 capacitors)

Alex M. wrote:

Thank you Alan,

Not sure why, but M13 cannot find a the symbolic solution of the D's

Set M:= the 5x5 matrix and K:= the vector of K's and then just do M^-1*K-> (ie use the symbolic equals)

I have attached a snapshot for your reference.

No, you forgot!

Alan