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

Community email notifications are disrupted. While we are working to resolve, please check on your favorite boards regularly to keep up with your conversations and new topics.

How to show all values of this variable?

Cornel
18-Opal

How to show all values of this variable?

Hi,

How to show all the values of ic1(t). If I put iC1(1ms) for example the calculation is done, but I want to have a vector of all the values of iC1(t). Is it possible?

Cornel_0-1717153852207.png

Cornel_1-1717153966760.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Werner_E
24-Ruby V
(To:Cornel)

Here you are:

Werner_E_0-1717194971745.png

As you can see the evaluation fails for the first and the last value of t.

You are using numerical differentiation for a function derived with "odesolve" for arguments from 0s to t.end

The algorithm used by Prime for this seems to use the function values ​​of arguments before and after the point in question. But in the result of a 'function' determined by "odesolve" there are no function values ​​for arguments before the first initial value of t (0 s) or after the last value (t.end). So the numerical derivative can't be calculated for these end values.

The evaluation should be possible without this problem using the function i.C1(t), which, as I have shown, is determined together with the others in the solution block.

View solution in original post

14 REPLIES 14

A linear inhomogeneous ordinary differential equation of second order and its initial values ​​are given. Its closed-form solution is easily possible if the inhomogeneity vE(t) is given. Please state this. I will then try to answer in MC14.

Werner_E
24-Ruby V
(To:Cornel)

Here you are:

Werner_E_0-1717194971745.png

As you can see the evaluation fails for the first and the last value of t.

You are using numerical differentiation for a function derived with "odesolve" for arguments from 0s to t.end

The algorithm used by Prime for this seems to use the function values ​​of arguments before and after the point in question. But in the result of a 'function' determined by "odesolve" there are no function values ​​for arguments before the first initial value of t (0 s) or after the last value (t.end). So the numerical derivative can't be calculated for these end values.

The evaluation should be possible without this problem using the function i.C1(t), which, as I have shown, is determined together with the others in the solution block.

I would like to complete this task in the classic way. To do this, I need the function n vE(t) so that I can use it in MC14. There is a sentimental reason for my request: I remember my student days when easy exercises of this kind were stressful.


@AlfredFlaßhaar wrote:

I would like to complete this task in the classic way. To do this, I need the function n vE(t) so that I can use it in MC14. There is a sentimental reason for my request: I remember my student days when easy exercises of this kind were stressful.


vE(t) is a simple square wave signal

Werner_E_0-1717230570785.png

similar to the one posted here  Why these 2 function implementation of square wave...

You also may use one of the alternatives I provided there (Tf = 1 ms,  Vmax = 10 V) or if its more convenient for you, you may also use a definition using the Heaviside function:

Werner_E_1-1717231381421.png

Werner_E_2-1717231635894.png

 

But I guess that the periodic nature of the function vE will make deriving a closed form symbolic solution using the "classic way' to solve this 'easy exercise' somewhat difficult.

Good luck!

Thank you very much! Yes, now it gets much more difficult. The inhomogeneity is a piecewise continuous periodic function. Let's see if a Fourier series for vE(t) helps?


@AlfredFlaßhaar wrote:

Thank you very much! Yes, now it gets much more difficult. The inhomogeneity is a piecewise continuous periodic function. Let's see if a Fourier series for vE(t) helps?


You sure can get an approximation that way.

Werner_E_2-1717256519761.png

Best wishes for your efforts!

I have known about this series expansion for a long time. I have attached the status of solving the ODE "closed". Apparently I am doing something wrong in the symbolic evaluation or MC14 is overwhelmed. Even with just one Fourier summand, MC fails. But the solution is actually quite simple. I would like some advice.

You are using boolean equals so you can't expect them to have any effect.

If your question is about the two boolean expressions you try to evaluate symbolically (why?) and which seems to take an infinite time - this is because you defined t as a range and the symbolics tries to evaluate your expressions using this implicit t-loop.

You can "undefine" t with respect to the symbolics by writing t:=t and then you get a result

Werner_E_0-1717348982956.png

But because you never defined the Wronski determinant (there is a difference between using := and the fat boolean = ) you just see W(t) in the results.

 

I also doubt that an approximating  'solution' using just a few summands of the Fourier series would be any better than the solution derived numerically by using odesolve. But then I may be proven wrong.

 

Thank you for your advice, I have tried to incorporate it. Now I am stuck with the calculation of u(t) at the end of the attached file and would like to ask for help again.

I did not bother to modify the sheet you posted earlier (exchanging the = for := and whatever may be necessary additionally) but chances are that Mathcad is not capable enough to evaluate the involved integrals!?

Sorry, I forgot to attach the file. Please help.

Here you are.

I made n a global variable so I can define it at the end.

Here the result for n=5. Feel free to set higher values if you dare 😉

Werner_E_0-1717418134443.png

 

The symbolic results (large sums) are so large that Mathcad refuses to display them, but nonetheless you can use them in further calculations, plots, etc.

I also changed vhom(t) to vhom1(t), because you never have defined a function vhom in your sheet.

 

Its up to @Cornel  to decide if an approximation of that kind is helpful for him.

 

Thank you very much. It is not my intention to make suggestions to Cornel on this task. Rather, I am trying to enjoy my age-appropriate thinking.

The Laplace transform of a square wave with amplitude A and period T is

A*tanh(s*T/4)/s.

 

Success!

Luc

Top Tags