How to set a vector as initial condition for PDEs?
4 views (last 30 days)
Show older comments
I'm trying to set a vector, Cini, containing a spatially-varying quantity as my intial codition in a pde for all except the first instance of a loop (in this instance, initial condition is uniform for r<=R1). In the current wrong syntax (below), it's tripping the code up. How do I go about correctly implementing this?
function c0 = pdex2ic(r)
if r <= R1
if i==1
c0 = C0;
else
c0 = Cini;
end
else
c0 = 0;
end
end
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on PDE Solvers 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!