WICHTIG: Der Betrieb von goMatlab.de wird privat finanziert fortgesetzt. - Mehr Infos...

Mein MATLAB Forum - goMatlab.de

Mein MATLAB Forum

 
Gast > Registrieren       Autologin?   

Partner:




Forum
      Option
[Erweitert]
  • Diese Seite per Mail weiterempfehlen
     


Gehe zu:  
Neues Thema eröffnen Neue Antwort erstellen

How can I use an NxM matrix as intitial condition in 'pdepe'

 

Goleo
Forum-Newbie

Forum-Newbie


Beiträge: 1
Anmeldedatum: 28.05.19
Wohnort: ---
Version: ---
     Beitrag Verfasst am: 28.05.2019, 17:32     Titel: How can I use an NxM matrix as intitial condition in 'pdepe'
  Antworten mit Zitat      
I'm using the pdepe solver to solve 4 PDEs simultaniously. Now I want to use the solution as an initial boundary condition for a next step, e.g. u0(1,:)= sol(end,:,1) This works pretty well, as long as I just use a single value for the initial condition, e.g. u0(1)=sol(end,end,1), but fails as soon as I try the whole vector.

This seems to be in fact quite similar, but didn't work in my case: https://stackoverflow.com/questions.....nitial-condition-in-pdepe

[code]

sol = pdepe(m,...,@(x)icfun(x,sol)...
...

%icfun
u0=icfun(x,sol)

u0(1,:)=sol(end,:,1)
u0(2,:)=sol(end,:,2)
u0(3,:)=sol(end,:,3)
u0(4,:)=sol(end,:,4)

end

[code]

What didn't work, was the hint from the link above in the way I interpreted it.

[code]
A=sol;
a=sol(end,:,1);

sol = pdepe(m,...,@(x)interp1(a,A',x,'pchip')'....

[code]

I expected to be able to use a vector as an intial boundary condition for just one pde, what gives an NxM matrix for the 4 PDEs. Instead, an error occurs, stating that the initial boundary conditions needs to be a column vector.

'Error using pdepe (line 231) Invalid output of ICFUN. ICFUN must return a column vector.'

How is it possible to hand over the whole vectors instead of single values?
Private Nachricht senden Benutzer-Profile anzeigen


Neues Thema eröffnen Neue Antwort erstellen



Einstellungen und Berechtigungen
Beiträge der letzten Zeit anzeigen:

Du kannst Beiträge in dieses Forum schreiben.
Du kannst auf Beiträge in diesem Forum antworten.
Du kannst deine Beiträge in diesem Forum nicht bearbeiten.
Du kannst deine Beiträge in diesem Forum nicht löschen.
Du kannst an Umfragen in diesem Forum nicht mitmachen.
Du kannst Dateien in diesem Forum posten
Du kannst Dateien in diesem Forum herunterladen
.





 Impressum  | Nutzungsbedingungen  | Datenschutz | FAQ | goMatlab RSS Button RSS

Hosted by:


Copyright © 2007 - 2024 goMatlab.de | Dies ist keine offizielle Website der Firma The Mathworks

MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.