Modifying A Variable in an ODEFUN/Boundary Value Problem

2 次查看(过去 30 天)
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 个评论
Torsten
Torsten 2023-5-8
编辑:Torsten 2023-5-8
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 2023-5-8
Sorry - I was vague in my question. I solved my problem, but appreciate the quick response.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by