'I am interested in drawing the solution for various ODEs and PDEs

How to draw the solution y=sinx+c for the ODE dy/dx = cosx? I tried in excel but did not reach a solution. I am new to this. Please help

ode


Solution 1:[1]

If you really want to do that in Microsoft Excel, then you can implement, for example, the Euler method for simplicity as follows:

B1 cell : initial value of y, for example, 0
B3 cell : initial value of x, for example, 0
B4 cell : step size, for example, 0.1, which should be sufficiently small

D1 cell : =$B$2
E1 cell : =$B$1

D2 cell : =D1+$B$3
E2 cell : =E1+COS(D1)*$B$3

Next, select the D2 cell and copy it to D3, D4, ... by dragging the fill handle, up to the point that you want to get. Then, select the E2 cell and copy it to E3, E4, ... by double-clicking the fill handle. This gives (x, y) data in D and E columns, and you can make a plot with them. The above initial values correspond to c=0 in your equation. enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 tueda