フィルターのクリア

Modifying A Variable in an ODEFUN/Boundary Value Problem

2 ビュー (過去 30 日間)
Tony Stianchie
Tony Stianchie 2023 年 5 月 8 日
コメント済み: Tony Stianchie 2023 年 5 月 8 日
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 Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by