cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Odesolve bug? Another bug?

Cornel
18-Opal

Odesolve bug? Another bug?

Hi,

Change variable a from below and look at the V2(t)...Why odesolve block is behaving like this? Is it normal?
Prime 10 file attached.
The expected behaviour is like a =7.

Cornel_3-1718623701982.png

 

Cornel_4-1718623713461.png

 

Cornel_5-1718623726172.png

 

Cornel_6-1718623740384.png

 

Cornel_7-1718623753126.png

 

Cornel_9-1718623787557.png

 

Cornel_10-1718623800847.png

 

Cornel_11-1718623813812.png

32 REPLIES 32

The green curve looks like a solution - but it is not a solution because there is no clearly defined tangent at the upper and lower peaks and there is no first derivative (differential quotient) as a cause. It is possible that the MC algorithm has rounded off the peak internally (e.g. through interpolation).
MC should be able to handle the step-by-step solution described. Unfortunately, I cannot do the programming myself - I am only a theoretician.

LucMeekes
23-Emerald III
(To:Cornel)

It's not an Odesolve BUG, it's just complications of numerically computing the voltages and currents, given the non-linear /discontinuous behaviour of the derivative of the diode function I(Vx).

There are other tools better equipped/specifically geared for this kind of calculations, e.g. LTspice:

LucMeekes_2-1718783894265.png

(a simple diode model with a breakdown voltage of 20 V) gives:

LucMeekes_1-1718783797413.png

And with the diode modelled per the I(Vx) function:

LucMeekes_3-1718783975030.png

we get virtually the same result:

LucMeekes_4-1718784006266.png

There are minute differences. The top line of V2 here sits at 0.7 V, while with the previous circuit it is at 0.8 V.

Note that the capacitor value is so small, it could just as well be left out. That would render a non-differential equation to be solved.

If the capacitor is increased significantly (as TTokoro did) you'd see some effect of it:

LucMeekes_5-1718784334482.pngLucMeekes_6-1718784352934.png

Success!
Luc

Luc, we are talking about a first order differential equation which needs to be solved numerically. 

We can see also in your simulation that the simulation algorithm can solve this differential eq in the end without problems, without missing any pulses. 

So, I am wondering If such reason with continuity/discontinuity is a reason in this case, as we can see other tools does not have problems in giving the correct solution/plot. 

Thus, that I said that maybe odesolve block algorithm in Mathcad is very weak or have some faulty behaviour. 

Then If we need to switch to other better tools even for such exercices, which is not so so so complicated (in the end it's a first order differential eq), then what calculations remains to do in Mathcad? Simple school equations? I am wondering why these guys from Mathcad it boasts that Mathcad is an engineering tool? As we can see that with this engineer math tool cannot solve a first order differential eq or a circuit with one resistor, one capacitor, one diode...I think engineering îs much more than this. I know that You and me cannot do anything even If I sau this, but .. 

But without having with us Mathcad development team...so that can give an answer even they...

@DJNewman 

Top Tags