Hello, I’m quite new to Julia.
I’m having a problem with “plot” and “exporting”.
Can anyone give help for a newbie?
Using VoronoiFVM for one-dimensional PDE, the solution is expressed as Array{Float64,1}.
I want to express it as a graph with time as e.g. (x, solution[2,:], t)
Like a “surface” graph.
This problem also occurs for the exporting solution.
The exported csv file only shows the solution for the final time period.
Code below without the equations
using VoronoiFVM
using ExtendableGrids
using PyPlot
using Plots
Length=0.0075;
edge_n=100; # number of edges
X1=collect(0.0:Length/edge_n:Length)
grid=ExtendableGrids.simplexgrid(X1)
ExtendableGrids.plot(grid,Plotter=PyPlot)
using DelimitedFiles
let
t=0.0; del_t=60.0
@gif for i=1:600
t=t+del_t
solve!(solution,inival,system,tstep=del_t)
writedlm("results.csv", solution[2,:])
@views begin
P1=heatmap(reshape(solution[1,:],length(X1),1),colorbar=:right,color=:viridis,yflip=true,clim=(230,260))
P2=heatmap(reshape(solution[2,:],length(X1),1),colorbar=:right,color=:viridis,yflip=false,clim=(230,260))
P3=heatmap(reshape(solution[3,:],length(X1),1),colorbar=:right,color=:viridis,yflip=true)
P4=Plots.plot(solution[2,:],ylim=(230,260), yflip = false)
P=Plots.plot(P1,P2,P3,P4,layout=(1,4))
end
inival.=solution; del_t*=1.00
end
end
This is the current graph that time flows as “gif”. P2 and P4 are what I am focusing on.
Can it be converted to (x, solution, t) graph or exported to csv file?