Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Hello,
I'm using Mathcad Prime 11.
I'm trying to solve a differential equation with conditional logic (if) due to the presence of a diode in the circuit.
The input values are defined, and in the worksheet, some graphs are already plotted (e.g., I_TEST, VL1N).
I'm using Odesolve to compute the solution.
Is this the correct approach?
It doesn't work with the following error "Plot failed"
Cou you help me?
Thank you very much
Solved! Go to Solution.
Mathcad's odesolve and are not good for I_TES(t) treatment. It can not solve
or
. It try to solve 11.1 ms, the closs point of two functions.
I also assume 6.28 ms is the tangent line's start point.
If you change the conditions such as d1, you should fix the start and end point of the plot. It shows the charge of Cstab decrease by I_TES(t) pulse train discharges.
Some observations:
Your schematic is a bit enigmatic. You put a diamond symbol with a diode symbol inside. The diamond is connected in parallel to the capacitor. Is that to say your diode is in parallel to the capacitor? If yes, is the cathode side up, or down?
(Note: I'd expect the diode to be in series with the resistor.)
On the solve block:
The initial condition "VC(0 ms)=0 V" must be with the constraints, not with the initial guesses. (You don't need intial guesses with odesolve.
The little program sets a constraint on VC(t). The IF statement in there will not work. if the condition is true, VC(t) will become VL1N(t), which is also a voltage. But if the condition is false (the 'else' case), then VC(t) will become whatever the boolean construct Cstab*d/dt{VC(t)} = -I_TES(t) will result in, and note; because it's a boolean construct, that result can only be 1 (True) or 0 (False).
You should set up a constraint on d/dt{VC(t)} rather than on VC(t), so you may have to rethink how to incorporate the diode behaviour. Maybe it helps if you first solve the circuit without a diode, then put the diode behaviour in.
The solver expression should not read VC1(t)= odesolve.... but VC1=odesolve.... Check the help (? in upper right corner of the window) to see how to use odesolve.
Success!
Luc
Hello Luc,
I'll take another look at it on Friday.
You're right, the schematic is a bit ambiguous 🙂 This version is definitely clearer.
Thx.
Emilien
Hello ttokoro,
Thank you for your help, and sorry for the delay.
I tried the file, but I don't think it's working as expected
The output voltage decreases when the load increases due to insufficient energy stored in the capacitor to maintain the voltage.
Attached : LTspice simulation
Have a nice weekend,
Emilien
Mathcad's odesolve and are not good for I_TES(t) treatment. It can not solve
or
. It try to solve 11.1 ms, the closs point of two functions.
I also assume 6.28 ms is the tangent line's start point.
If you change the conditions such as d1, you should fix the start and end point of the plot. It shows the charge of Cstab decrease by I_TES(t) pulse train discharges.
Hello ttokoro,
Thank you very much. You're really skilled with Mathcad
This function is more complicated than expected with Mathcad, ahah
Have a nice day !
Emilien
Assuming average decrease of capacitor voltage, the start and end points of the effect of pulse train can be solved by using minerr function. Still the integral of narrow pulse wave shows error even increases the TOL to 10^-12.
Using average value of ITES odesolve can solve all conditions. The result of D1=0.1 also has no error.
