max125

195 Reputation

8 Badges

9 years, 212 days

MaplePrimes Activity


These are questions asked by max125

The problem, find the general solution of y '' + 4y = t cos (2t).

Maple input:

de:=diff(y(t),t,t)+4*y(t)=t*cos(2*t);
sol:=dsolve(de,y(t));

Maple output:

sin(2*t)*_C2+cos(2*t)*_C1+(1/8)*t^2*sin(2*t)-(1/64)*sin(2*t)+(1/16)*t*cos(2*t)

The odd thing is the inclusion of the term -(1/64)*sin(2*t). It is not incorrect since you can collect this term with sin(2*t)*_C2. Is there a reason why it's there, and how can i remove it without inspecting it? Note that Wolfram doesn't have this extra term.

https://www.wolframalpha.com/input/?i=solve+y%27%27+%2B+4y+%3D+t*cos(2*t)

I attached the worksheet and added a more detailed calculation.

diffeq.mw

 

Is there something wrong with dsolve?

ode := diff(y(x), x) = sqrt(2*32.2*y(x)):
ics := y(0) = 0:
dsolve({ics, ode});

maple output:   y(x) = 0

The answer should be

y(x) = 16.1 x^2

Wolfram got it

 

I tried using restart, with(DEtools), still no luck. Though I don't think its necessary to call with(DEtools) for this simple equation.

To make the problem simpler, use dsolve on  dy/dx = √y , y(0)=0.

ode := diff(y(x), x) = sqrt(y(x)):
ics := y(0) = 0:
dsolve({ics, ode});

maple returns  y(x) = 0, which is incorrect.  Should be y(x) = x^2/4

I uploaded the worksheet just in case 'its just me'.

diffeqseperable.mw

I have a trigonometric equation that outputs with a solution in terms of _B1 which I want to remove.

restart: solve({7*cos(2*t)=7*cos(t)^2-5, t>=0, t<=2*Pi}, t, allsolutions, explicit);

output:

{t = arccos((1/7)*sqrt(14))},

{t = 2*Pi-arccos((1/7)*sqrt(14))},

{t = 2*arccos((1/7)*sqrt(14))*_B1-2*_B1*Pi+2*Pi*_Z1-arccos((1/7)*sqrt(14))+Pi}

Is there anyway to get rid of the _B1, or somehow evaluate it by a substitution?

 

Even numerically the answer still retains the _B1.

{t = 1.006853685}, {t = 5.276331623}, {t = -4.269477938*_B1+6.283185308*_Z1+2.134738969}

 

Also it would be nice to remove the _Z1 subscript too, as the domain of the equation is [0, 2pi].

I tried removing the 'AllSolutions' command , but then I am missing two solutions:

solve({7*cos(2*t)=7*cos(t)^2-5., t>=0 and t<=2*Pi}, t, Explicit);

 {t = 1.006853685}, {t = 2.134738969}

There should be 4 solutions in the domain [0, 2pi].

Maple gives me poor accuracy for simple arithmetic problems.

My calculator gives me 0.7 and 0.9 respectively.

I guess I could do evalf(convert(2.59/3.7,fraction)) = 0.7000000000

but this seems excessive.

I am trying to find the orthocenter in the x,y plane, given three coordinates  (x1,y1) (x2,y2) (x3,y3).

I am trying to avoid division by zero.

orthocenter.mw
 

restart:
orthocenter:=proc(x1,y1,x2,y2,x3,y3)
local m1,m2,m3,L1,L2,L3,slope;
slope:=(a,b,c,d)->(d-b)/(c-a);

if x1=x2 then L1:=x=x1;
elif y1=y2 then L1:=y=y1;
else m1:=-1/slope(x2,y2,x3,y3); L1:=y-y1=m1*(x-x1);
end if;

if x2=x3 then L2:=x=x2;
elif y2=y3 then L2:=y=y2;
else m2:=-1/slope(x1,y1,x3,y3);L2:=y-y2=m2*(x-x2);
end if;

if x1=x3 then L3:=x=x1;
elif y1=y3 then L3:=y=y1;
else m3:=-1/slope(x1,y1,x2,y2);L3:= y-y3= m3*(x-x3);
end if;
print(solve({L1,L2,L3},{x,y}));
end proc:

orthocenter(1,1,3,4,5,3);

{x = 11/4, y = 9/2}

(1)

orthocenter(0,0,0,3,4,1)

Error, (in slope) numeric exception: division by zero

 

 


 

Download orthocenter.mw

 

3 4 5 6 7 8 Page 5 of 8