final value of x in PDE
1 view (last 30 days)
Show older comments
if i have PDE as following:
u=M
t=t
x=r
and i want to calculate the value of x at t=0 u0, and final value of it t=infinity and u=final
i have the initial and final value of u
how can i write a command to solve this one?
5 Comments
Answers (2)
Vishisht
on 18 Feb 2024
To solve the given partial differential equation (PDE) using the method of characteristics, we can start by rewriting the PDE in characteristic variables.
Given:
- \( u = M \)
- \( t = t \)
- \( x = r \)
The PDE in characteristic variables becomes:
\[ \frac{\partial u}{\partial t} = 0 \]
\[ \frac{\partial x}{\partial t} = M \]
Now, we integrate these characteristic equations to obtain expressions for \( u \) and \( x \) in terms of \( t \) and initial conditions:
1. Integrating \( \frac{\partial u}{\partial t} = 0 \) gives \( u = u_0 \), where \( u_0 \) is the initial value of \( u \).
2. Integrating \( \frac{\partial x}{\partial t} = M \) gives \( x = Mr + x_0 \), where \( x_0 \) is the initial value of \( x \).
Given the initial and final values of \( u \) and the final value of \( x \), you can find the constants \( u_0 \) and \( x_0 \) using the provided information.
Once you have \( u_0 \) and \( x_0 \), you can use these expressions to find the values of \( x \) at \( t = 0 \) and the final value of \( x \) as \( t \rightarrow \infty \).
For example, if you know the initial value of \( u \) (\( u_0 \)), you can directly set \( x = x_0 \) to find the value of \( x \) at \( t = 0 \). And if you have the final value of \( u \), you can set \( u = \text{final} \) and solve for \( x \) as \( t \rightarrow \infty \).
Please provide the specific initial and final values of \( u \) and any other relevant information so that a more detailed solution can be provided.
Torsten
on 18 Feb 2024
Edited: Torsten
on 18 Feb 2024
i want to solve this equation for r at given time and concentration
I assume that the time for which you want to get r is in the output of "pdepe".
If c is the concentration vector at time t and r is the vector of radial discretization points, you can try
rq = interp1(c,r,cq)
where cq is the concentration for which you want to get the corresponding radius rq.
This might cause problems if c is not monotonic.
If so, try
c = [0 0 3 5 8 10 14];
r = [0 1/6 1/3 1/2 2/3 5/6 1];
cq = 6.25;
idx = find(diff(sign(c-cq)),1);
rq = ((cq-c(idx))*r(idx+1) + (c(idx+1)-cq)*r(idx))/(c(idx+1)-c(idx))
See Also
Categories
Find more on Eigenvalue Problems in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!