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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

18-Opal

## How to solve this eq with odesolve?

Hi,

How to solve for V2(t)?

1 ACCEPTED SOLUTION

Accepted Solutions
18-Opal
(To:Cornel)

@Werner_E @ttokoro
I did not found yet why Untitled-4_MCP10 do not work with laplace, maybe you can have a look.

But I found a way how to do also with odesolve by making more rearrangements....

20 REPLIES 20
18-Opal
(To:Cornel)

@Werner_E  this to be the only solution, to differentiate in order to escape from integral?

Below solution is for this circuit:

18-Opal
(To:Cornel)

@Werner_E @ttokoro
Below is for this circuit: I was expected that odesolve to be able to solve also this simple circuit...differential eq...

18-Opal
(To:Cornel)

Ok, I found...
@Werner_E  do you think that is this normal behaviour of solveblock? I mean to arrange V2'(t) like below in order solveblock to be able to solve this differential eq?  In first above case why odesolve block is not able to solve?

18-Opal
(To:Cornel)

Now below is for this circuit: so, the conclusion to be that odesolve block is to primitive?

18-Opal
(To:Cornel)

And even this variant seems to fail..
From this eq:

Solve for V2'(t):

Then introduce in first eq:

Then differentiate again..

Then odesolve block fail..

So, I am lost...

24-Ruby V
(To:Cornel)

I have not checked in detail how you derived this equation, but it sure is not correct as you have a lot of unit mismatches:

Just noticed that there is already an error in your first step:

18-Opal
(To:Werner_E)

Yeah, I see:
if there are no more mistakes, this should be it:

But anyway, this not solve the problem..

24-Ruby V
(To:Cornel)

Sometimes, as you found out yourself in another of your various postings, it helps to collect the summands with the highest order derivative and reorder the terms so its on the left hand side of the equation. But there is not guarantee that his would help in your case, too.

EDIT: Your new ODE is now only of second degree and rearranging/simplifying the equation seems to help (you have to check if the simplification done by me is correct)

18-Opal
(To:Werner_E)

Ok, I will look tomorrow (as right now it's night at me). It seems all right.

But anyway, this with the fact that ode needs to be rearranged inside odesolve block in the hope that one will find the correct rearrangement and thus odesolve can work/calculate/solve the ode this way is not very nice..

What one will you do if he will not find the correct order of the terms in the ode?

Let's also see if @ttokoro will come also with an answer based on laplace transform or odesolve for this circuit with R1, L1, C1 and R2...

24-Ruby V
(To:Cornel)

@Cornel wrote:

What one will you do if he will not find the correct order of the terms in the ode?

Cry and weep! Or use Laplace, or simulate, or try a different more capable Math software, or ...
But it seems to be a rule that you should not use  ".... a* y''(x) + ..... + b* y''(x)+-----" but rather ".... (a+b)*y''(x)+.....". Something we can remember.

But I guess that Laplace is the way to go here, (if the input voltage function V1(t) is not too nasty) but it was you who demanded just to use odesolve! 🙂

18-Opal
(To:Werner_E)

I hoped there wouldn't be so many problems with odesolve block. odesolve block seems more general. for example, if we add a diode to these circuits (which will probably be one of the future topics) then you can say goodbye to laplace, and should rely more on something like odesolve block...

These posted circuits are examples to test odesolve block, but it seems that odesolve block stuck and sucks and has problems, it is not that capable.

20-Turquoise
(To:Cornel)

24-Ruby V
(To:ttokoro)

You don't have to get rid of the units if you are solving with Laplace, but you would have to check "Units/Constants in Symbolics" in the calculation option and explicitely state ",s,t" (labelled as variables!) when you use "invlaplace".

The results are too large to be displayed (because the symbolics can't simplify the various units involved) but can be used numerically without problems. See attached file.

18-Opal
(To:Werner_E)

What am I missing here?

Though I see that units are labeled as variables...

20-Turquoise
(To:Cornel)

18-Opal
(To:ttokoro)

Img cannot help me as I have one mathcad file where I can see that you see, that your picture is showing...Werner and you posted already such a file above.
What I did, was to copy this part from below to another mathcad sheet...and I saw that calculation does not work anymore...and I am wondering why. I had enabled already Units/Constant in Symbolic...but without seeing any change in the calculation

18-Opal
(To:Werner_E)

@Werner_E  look at this:

This V3(t) result is with above odesolve block:

And this is with laplace made by ttokoro:

The correct answer is this with laplace, but I am wondering why odesolve block did not output the same result as laplace as the derived eq within odesole block of what we did yesterday seems also correct...

18-Opal
(To:Cornel)

@Werner_E @ttokoro
I did not found yet why Untitled-4_MCP10 do not work with laplace, maybe you can have a look.

But I found a way how to do also with odesolve by making more rearrangements....

24-Ruby V
(To:Cornel)

@Cornel wrote:

@Werner_E @ttokoro
I did not found yet why Untitled-4_MCP10 do not work with laplace, maybe you can have a look.

Let the sheet recalculate and it works OK.

The changes to the Calc Options only become active after the entire worksheet has been recalculated.

24-Ruby V
(To:Cornel)

Looks like Prime is not as capable as we would like it to be.

You may consider contacting PTC support and hope for the best in future versions of Prime.

BTW, the unit of the derivatives is not Volt. It seems to do not matter as long as the value is zero and fixing this does not help in any way to get a solution.

Announcements
Top Tags