How to remove "y(x)" from this DE solution?

  • Context: Maple 
  • Thread starter Thread starter Dwightun
  • Start date Start date
  • Tags Tags
    Maple
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 2K views
Dwightun
Messages
2
Reaction score
0
TL;DR
DE solution
Hi,
I have my solved DE, like this:
1588938108626.png

How can i get sin(pi x /2) (without "y(x)=") to put it in array?
Thank you in advance
 

Attachments

  • 1588938041446.png
    1588938041446.png
    1.3 KB · Views: 271
Physics news on Phys.org
Dwightun said:
Summary:: DE solution

Hi,
I have my solved DE, like this:
View attachment 262344
How can i get sin(pi x /2) (without "y(x)=") to put it in array?
Thank you in advance
It is not correct to use the output of dsolve to define a function like you did above.
Instead, you can use the assign command, for example like this:
[CODE title="Maple 2018"]
restart;

# Specify ODE and initial conditions.
ode := diff(y(x), x, x) = -y(x);
ics := y(0) = 1, D(y)(0) = 0;

# Solve ODE and assign the output.
sol := dsolve({ode, ics}, y(x));
assign(sol);

# Now you can evaluate the solution.
plot(y(x), x = 0..2*Pi);
[/CODE]
 
Last edited:
  • Like
Likes   Reactions: Dwightun