Cant Solve ODE with dsolve

I am having issues solving this Differential Equation using dsolve
DEQ:
dT/dt = (A1*exp(1i*(w*t+phi))+A1)*(B1*exp(1i*w*t)-T(t))
CODE:
A1 = 7.9443e-5;
B1 = 10;
w = 7.3e-5;
phi = 0;
syms T(t)
ode = diff(T) == (A1*exp(1i*(w*t+phi))+A1)*(B1*exp(1i*w*t)-T);
cond = T(0) == 10;
TSol(t) = dsolve(ode,cond);
%The solution comes out to be:
TSol = exp(-(5861854777884531*dt)/73786976294838206464 + ...
(exp((dt*5386449269523189i)/73786976294838206464)*1953951592628177i)/1795483089841063) * ...
int((29309273889422655*exp(x*(5861854777884531/73786976294838206464 + ...
16159347808569567i/147573952589676412928) - ...
(exp((x*5386449269523189i)/73786976294838206464)*1953951592628177i)/1795483089841063) * ...
cos((5386449269523189*x)/147573952589676412928))/18446744073709551616, ...
x, 0, t, 'IgnoreSpecialCases', true, 'IgnoreAnalyticConstraints', true) + ...
10*exp(- (5861854777884531*t)/73786976294838206464 + ...
(exp((t*5386449269523189i)/73786976294838206464)*1953951592628177i)/1795483089841063) * ...
exp(-1953951592628177i/1795483089841063)
I dont understand what this portion of the solution or the rest of it means.
int((29309273889422655*exp(x*(5861854777884531/73786976294838206464 + 16159347808569567i/147573952589676412928) - (exp((x*5386449269523189i)/73786976294838206464)*1953951592628177i)/1795483089841063)*cos((5386449269523189*x)/147573952589676412928))/18446744073709551616, x, 0, t, 'IgnoreSpecialCases', true, 'IgnoreAnalyticConstraints', true)
Is it possible for someone to explain why I get (x, 0, t, 'IgnoreSpecialCases', true, 'IgnoreAnalyticConstraints', true) in my solution and how do I fix it to get a proper analytical solution. I am running MATLAB R2019a.
I solved a similar differential equation seen below and this work using dsolve so I am not sure why my current DEQ doesn't work:
DEQ: dT/dt = (A1*exp(1i*(w*t+phi)))*(B1*exp(1i*w*t)-T(t))

 Risposta accettata

So you have a linear first-order differential equation looking something like this:
Then I'd suggest that special cases are combinations of A1 B1 and w equals zero. If I run your code without the numerical values of A1 B1 phi and w I get:
TSol = dsolve(diff(T) == (A1*exp(1i*(w*t+phi))+A1)*(B1*exp(1i*w*t)-T),cond)
TSol =
10*exp(-(A1*exp(phi*1i)*1i)/w)*exp(- A1*t + (A1*exp(phi*1i)*exp(t*w*1i)*1i)/w) + exp(- A1*t + (A1*exp(phi*1i)*exp(t*w*1i)*1i)/w)*int(A1*B1*exp(A1*u + u*w*1i - (A1*exp(phi*1i)*exp(u*w*1i)*1i)/w)*(exp(phi*1i + u*w*1i) + 1), u, 0, t, 'IgnoreSpecialCases', true, 'IgnoreAnalyticConstraints', true)
>> pretty(TSol)
t
/
/ A1 #3 1i \ | / A1 #3 exp(#1) 1i \
exp| - -------- | #2 10 + #2 | A1 B1 exp| A1 u + #1 - ---------------- | (exp(phi 1i + #1) + 1) du
\ w / / \ w /
0
where
#1 == u w 1i
/ A1 #3 exp(t w 1i) 1i \
#2 == exp| - A1 t + -------------------- |
\ w /
#3 == exp(phi 1i)
It is a long expression, but it containe nothing extraordinarily complicated, but if for example w is zero this falls appart. You should be able to convert this into a regular m-function in a couple of minutes. It seems to fit the ode rather nicely.
HTH

4 Commenti

Walter  Parker
Walter Parker il 14 Mag 2020
Hello thank you for your response. I have two follow up questions how did you run the script without numerical values of A1, B1, w. Does this mean that I need to solve for the integral portion (seen below) of this results and combine the previous portion and the integral part together to get my analytical solution.
t
/
| / A1 #3 exp(#1) 1i \
#2 | A1 B1 exp| A1 u + #1 - ---------------- | (exp(phi 1i + #1) + 1) du
/ \ w /
0
You simply define those as symbolic variables too. I tried to define them as positive (this implies that they are also real numbers):
syms t A1 A2 w phi positive
syms T(t)
% etc...
The idea was that this would constrain the ODE enough to get rid of the special cases.
Yes, that integral is part of your analytical solution, you will have to evaluate that for every value of t, "unfortunately". The integral looks tricky to find an explicit solution to. You can compare that integral with the similar integral of linera first-order ODEs with constant coefficients:
has the similar solution:
Walter  Parker
Walter Parker il 21 Mag 2020
Thank you so much for your help. I was finally able to complete my project due to your input.
My pleasure.

Accedi per commentare.

Più risposte (1)

Walter Roberson
Walter Roberson il 14 Mag 2020

0 voti

There does not appear to be an analytic solution to that. I checked with Maple.
Two functions that look very similar can turn out to have very different properties.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by