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

  • Thread starter Thread starter Dwightun
  • Start date Start date
  • Tags Tags
    Maple
Click For Summary
To extract the solution of a differential equation (DE) in a usable format without defining it as a function, the discussion emphasizes the importance of using the assign command after solving the DE. An example is provided where a second-order ordinary differential equation is solved with initial conditions. The solution is obtained using the dsolve function, and then the assign command is applied to facilitate further evaluation and plotting of the solution. This method allows for the representation of the solution, such as sin(pi x / 2), in an array format without explicitly defining it as y(x).
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: 245
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 Dwightun

Similar threads

Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
7K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K