start velocity on boundary

More
4 years 7 months ago #2526 by nsc
Hey everyone,

I have a question about implementing the following problem:
[tex]u_{xx} - u_{tt} = 0[/tex]
on the unit square
[tex]x,t \in [0,1][/tex]
subjected to the boundary condition
[tex]u(0,t) = 0 \\ u(1,t) = 0 \\ u(x,0) = 0 \\ u_{t}(x,0) = \pi sin(\pi x)[/tex]

I do know how to specify the 0 boundary condition on its own. However, I am struggling with setting the starting velocity and the Dirichlet condition on the same edge. Is there a way to do that?
More
4 years 7 months ago #2530 by mneunteufel
Hi nsc,

I guess you have one GridFunction for saving u and another GridFunction for saving the velocity u_t.
Then, at the beginning, you can set the starting velocity by
Code:
gfut.Set(pi*sin(pi*x), definedon=mesh.Boundaries("your boundary"))
During the update scheme you have to take care that you carry on the boundary condition.

Best,
Michael
The following user(s) said Thank You: nsc
More
4 years 7 months ago #2569 by nsc
Replied by nsc on topic start velocity on boundary
Hi Michael,
thanks for the answer and sorry for not writing back so long.
For now, I have only used the automatic utility for solving the BVP, so coming up with my own update scheme is quite a challenge. Nevertheless, I will have a look at that.

Thanks again, nsc
Time to create page: 0.094 seconds