Skip to main content
1-Visitor
April 10, 2025
Question

Numericall solving of differential equation with multiple derivatives and time dependant components

  • April 10, 2025
  • 1 reply
  • 983 views
I am using Mathcad Release 15.0 and DatecodeM030

Hello, I would like to numerically solve a system of partial differential equations of this kind for voltages and currents:
i.e.:
U1(t)=R1*i1(t)+L*d/dt(i1(t)+M1*d/dt(i2(t))+d/dt(M2(t))*Ik
U2(t)=R1*i2(t)+L*d/dt(i2(t)+M1*d/dt(i1(t))+d/dt(M3(t))*Ik
The equations contain several differentials of different currents and also time dependant components
How could this be solved in mathcad?

    1 reply

    25-Diamond I
    April 10, 2025

    A solve block with "odesolve" might do the job.

    Set up a Mathcad sheet and post it here so we have something to work with and see, which variables and functions are defined in which way and which functions you are actually looking for.

    JH_011-VisitorAuthor
    1-Visitor
    April 10, 2025

    Hi Werner,

     

    below is what we are trying to do, I think one error is that I am working currently with units. But I am am not sure at all regarding the setup.

    25-Diamond I
    April 10, 2025

    odesolve in MC15 unfortunately does not work with units. Thats one of the very few improvements in Prime.

    I also wonder what you mean by

    Werner_E_2-1744297894166.png  orWerner_E_3-1744297913502.png

    "If" is defined as a constant, so its derivative would be zero anyway.

    If this is an attempt to prepare the calculation for future changes where "If" is not constant but dependent on time, you would have to define "If" as a function of time, even if its constant

    Werner_E_5-1744299779112.png

     

    and use "If(t)" instead of just "If" throughout.

     

    You did not define t0. Guess you should just use 0 instead.

     

    You only have to provide initial conditions for the two functions isp1 and isp2. The other functions are already defined!

     

    BTW, I would suggest NOT defining a range for "t" at the top. This range should only be used for plotting later, so you should define it just before the plot, if necessary at all.

     

    I tried to set up your sheet without units (next step would be to add units, just strip them for the solve block, and re-add them to the solved functions) but ran into an error in the solve block.
    Maybe you have to look at the correctness of the two equations in the solve block?

     

    MC15 sheet attached