55 Reputation

3 Badges

3 years, 259 days

MaplePrimes Activity

These are replies submitted by Nick_99

@Mariusz Iwaniuk this does seem to work but to be honest I am interested in the region where xphi>0. xphi is some phase that I want to set equal to 0 at t=tin and study for t>tin. When I try to change the range I plot to start at tin I get an error message...

@Axel Vogt you are right, I hadn't realised it was complex. I plotted the real and the imaginary parts and I have everything I need now! Again, thanks for your help.

@mmcdara @nm I'm all set now, thanks very much for all your help!

@Axel Vogt how much time does your code require to run? Because I tried executing it and I have been waiting for a while now.

@mmcdara first of all thanks a lot, both your and nm's solution agree perfectly with the solution that dsolve/numeric gave me. There is only one thing left that I need to plot, which is why I needed the indefinite integral of f(t). If you can spare some more of your time and take a look at this I would really appreciate it.

I have the following code:






As := t -> [A0*(abs(z(t))/(1 + a*(g(t)^2 - g(t)^4)))^(1/2)]/omegas(t):

nm := t->1450669/1681*t + 4459704101248/1067737900495*hypergeom([131537/203808, 1], [335345/203808], 36887*exp(342569/506*t)/(57154 + 36887*exp(342569/506*t)))/(1 + 57154/36887/exp(342569/506*t))^(131537/203808):

h2 := t -> As(t)*exp(-I*nm(t)):
plot(h2(t), t = -0.005 .. 0.005);

Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

f := t -> 862.979774 + 1825.011621/((1 + 1.54943476*exp((-1)*677.0138344*t))^(131537/203808));
LL := limit(f(t), t = -infinity);
LR := limit(f(t), t = infinity);
LL, f(-0.06);
LR, f(0.06);
                       LL := 862.9797740

                       LR := 2687.991395

                    862.9797740, 862.9797740

                    2687.991395, 2687.991395

tf := unapply(CurveFitting:-Spline([seq([t, f(t)], t in [seq](-0.065 .. 0.05, 0.001))], t, degree = 1), t);
eval(diff(tf, t), t = -0.06);
eval(diff(tf, t), t = 0.05);


approx_f := t -> piecewise(t < -0.065, LL, 0.05 < t, LR, tf(t));
approx_int := t -> int(approx_f(t), t);
h3 := t -> As(t)*exp(-I*approx_int(t));
plot(h3(t), t = -0.005 .. 0.005);
Warning, unable to evaluate the function to numeric values in the region; complex values were detected

I want to plot either h2 or h3; both of them work for me since both nm(t) and approx_int(t) work well. It seems like there is a problem when I try plotting either one of them.

Can you please help me with this?

@Polovodov @acer @mmcdara

Thank you guys for your replies, they have been very helpful.

@acer thank you very much!

@acer I want the calls to 'k' to give me the final values for xphi; that is, the values of xphi that are plotted. I only intend to use 'k' after I have plotted xphi. After I have solved the differential equation above, I want to plot a function of xphi, so I need to be able to call all xphi values.

@vv thank you very much, this does work and I obtain a sensible graph; though, I don't really understand what you have done. If it's not too much trouble, can you please elaborate a bit on the commands you used and the process you followed? More importantly, is there a way to store all my xphi as some variable phi(t) so that later I can easily call phi(t) at any point t I want?

Page 1 of 1