Borrar filtros
Borrar filtros

Modifying A Variable in an ODEFUN/Boundary Value Problem

2 visualizaciones (últimos 30 días)
Tony Stianchie
Tony Stianchie el 8 de Mayo de 2023
Comentada: Tony Stianchie el 8 de Mayo de 2023
I am trying to modify with each step across my odefun the values of k, mu, and c.
I'd like for these variables for change with each step based on the value calculated for Sxint(4,j)
clc
clear all
close all
function yprime = odefun(eta,y)
yprime = zeros(5,1);
global m etainf Pr mu k c
%% Plotting Velocity and Temperature
etainf = 20; % Find Convergence for both Temp and Velocity
Pr = 0.7; % Enter Pr
for m = [0]
solinit = bvpinit(linspace(0,etainf,100),[0 0 0 1 0]);
sol = bvp4c(@odefun, @odefun_bc,solinit);
xint = linspace(0,etainf,100);
Sxint = deval(sol,xint);
for j = 1:etainf
mu = (Sxint(4,j))^0.7;
c = (Sxint(4,j))^0.19;
k = (Sxint(4,j))^0.85;
figure(1)
hold on
title('Velocity vs Eta, Pr = 0.1')
xlabel('Eta')
ylabel('Velocity')
plot(xint,Sxint(2,:)); % plots f' (velocity)
figure(2)
hold on
title('Temperature vs Eta, Pr = 0.1')
xlabel('Eta')
ylabel('Temperature')
plot(xint,Sxint(4,:)); % plots q (temp profile)
end
end
  2 comentarios
Torsten
Torsten el 8 de Mayo de 2023
Editada: Torsten el 8 de Mayo de 2023
I'm totally lost on what you are trying to do with this code - especially what the "yprime" are you have to supply in function "odefun".
Tony Stianchie
Tony Stianchie el 8 de Mayo de 2023
Sorry - I was vague in my question. I solved my problem, but appreciate the quick response.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by